Scholarly article on topic 'Swing-up and Stabilization of the Rotational Inverted Pendulum Using PD and Fuzzy-PD Controllers'

Swing-up and Stabilization of the Rotational Inverted Pendulum Using PD and Fuzzy-PD Controllers Academic research paper on "Computer and information sciences"

Share paper
Academic journal
Procedia Technology
OECD Field of science
{"rotational inverted pendulum" / "swing-up control" / "balance control" / "conventional PD control" / "fuzzy-PD control"}

Abstract of research paper on Computer and information sciences, author of scientific article — Stelian-Emilian Oltean

Abstract The paper proposes a simplified solution of the control problem of the rotational inverted pendulum. The rotational inverted pendulum (RIP) is a complex system, widely studied in many areas due to its complexity and nonlinearities. The control strategy is divided into two subproblems, the swing-up control of the pendulum using a PD cascade scheme and the balance/stabilizing control of the whole system using a fuzzy-PD regulator. The switching mode between these subproblems is also considered. The plant, the swing-up control and the stabilizing system are modeled and studied in the Matlab/Simulink environment.

Academic research paper on topic "Swing-up and Stabilization of the Rotational Inverted Pendulum Using PD and Fuzzy-PD Controllers"

Available online at


Procedía Technology 12 (2014) 57 - 64

The 7th International Conference Interdisciplinarity in Engineering (INTER-ENG 2013)

Swing-up and stabilization of the rotational inverted pendulum using PD and fuzzy-PD controllers

Stelian-Emilian Oltean*

Petru Maior University of Tirgu Mures, 1 N. Iorga sir., 540088, Tirgu Mures, Romania


The paper proposes a simplified solution of the control problem of the rotational inverted pendulum. The rotational inverted pendulum (RIP) is a complex system, widely studied in many areas due to its complexity and nonlinearities. The control strategy is divided into two subproblems, the swing-up control of the pendulum using a PD cascade scheme and the balance/stabilizing control of the whole system using a fuzzy-PD regulator. The switching mode between these subproblems is also considered. The plant, the swing-up control and the stabilizing system are modeled and studied in the Matlab/Simulink environment.


Selectionandpeer-reviewunderresponsibility of the Petru Maior University of Tirgu Mures.

Keywords: rotational inverted pendulum; swing-up control; balance control; conventional PD control; fuzzy-PD control.

1. Introduction

The inverted pendulum (rotational or not) has been widely studied in many areas in both linear and nonlinear control. The rotational inverted pendulum considered in the paper is a complex under actuated mechanical system. This representative problem in the application of the control theory can be analyzed from many points of view: multivariate systems, non-minimum phase process or unstable systems, severe non-linear dynamics, modeling

* Corresponding author. Tel.: +40-265-233212; fax: +40-265-233212. E-mail address:

2212-0173 © 2013 The Authors. Published by Elsevier Ltd.

Selection and peer-review under responsibility of the Petru Maior University of Tirgu Mures. doi: 10.1016/j.protcy.2013.12.456

uncertainties and robustness. The RIP it has also some significant real-life application, such as position control, robotics [1,2,3] and aerospace vehicle control [4, 5].

Different control algorithms have been proposed for swing-up control and stabilization system. Some of the scientific works treats separately these two subproblems using conventional PID controllers, robust and adaptive strategies or intelligent systems. Other authors combine these completely different methods in a hybrid control.

For the swing-up control of the rotational inverted pendulum in [6, 7, 8] a conventional PD algorithm is presented, which is improved to minimize the swing-up time. In these papers, swing-up time is significantly reduced by adding an impulsive control action to the PD algorithm. Also, robust and nonlinear methods were used in [9, 10] to swing-up the RIP. Another technique, namely energy based control [11, 12, 13], neglects the reaction torques from the pendulum to the arm. Moreover, in [13] the stability property of the energy based control is analyzed. Intelligent methods used in [14, 15, 16] have proved the advantages to bring the pendulum to the upright position.

For the inverted pendulum stabilization problem one simplified solution is to linearize along the desired equilibrium point and apply the pole placement technique or the linear quadratic regulator (LQR) [6, 7, 17]. Due to the nature of the plant (the presence of uncertainties and nonlinearities), a better option may be considered the use of modern systems. Such example is the fuzzy controller designed in [8], which has five membership functions for both inputs, which are the angle of the pendulum to the upright position and angular velocity of the pendulum. In [18] a new version of fuzzy controller is proposed (simple-structured FLC with the skew-symmetric property in the control rule table) by keeping the same performances. In [19] evolutionary approaches for designing rotational inverted pendulum controller are presented, including genetic algorithms GA, particle swarm optimization PSO, and ant colony optimization ACO methods.

The switching control method is also discussed. In [7, 8] energy is considered the right criterion to switch over from swing up mode to stabilization mode.

An interesting idea is detailed in [16] to solve the two problems of control for a real inverted pendulum using a single fuzzy rule base. The authors eliminate the necessity of use of two different fuzzy controllers and reduce the number of tuning parameters. So, by combining the functional signals and just by changing the gains they are able to change the mode between swing up and stabilization.

The objectives for the present paper are to find a correct model for the RIP, to design, simulate and study the control of the RIP. The control strategy consists in swinging-up the inverted pendulum and making it stable in the upright position. For this, in first stage the swing-up control problem has the goal to bring the pendulum from the downward position to the upright position by giving a voltage of appropriate magnitude and direction to the dc motor which drives the mechanical system. In the second stage, when the pendulum reaches 20° from the final vertically upright position the balance/stabilizing control system is introduced. Although there are a variety of solutions, these tasks must be done in a simplified manner, to provide a basis for further physical implementation.

The remaining part of the paper is organized as follows. In section II, the mathematical model of the RIP system and its open loop responses are presented. The swing-up control of the rotational inverted pendulum consisting in a cascade control scheme with conventional PD regulators is described in section III. This section contains also the balance/stabilizing control scheme using fuzzy-PD strategy. The simulation results are highlighted in the section V and some conclusions are made in the final part of the paper.

2. The model of the rotational inverted pendulum

2.1. Description of the rotational inverted pendulum

The rotational inverted pendulum (also known as the Furuta pendulum) consists of a rotational servo motor system which drives an independent output gear. A rotational pendulum arm (see Fig. 1(a)) of radius r and mass mr is mounted to the output gear and a pendulum of length 21 and mass ot is attached to the hinge (point P). The pivot arm rotates in a horizontal plane XY by means of a servo motor and must be moved in such a way that the pendulum, which rotates in a plane XZ that is always perpendicular to the rotating arm, is in the upright position.

In the simplified schematic picture from Fig. 1(a) the inverted pendulum is displaced from the upright position with a given a, d denotes the angle of the pivot arm, a dot and d dot are the angular velocities of the inverted

pendulum and pivot arm. The parameters a and 9 are the generalized coordinates that describe the inverted pendulum system.

The Fig. 2(b) presents the physical rotational inverted pendulum system realized from aluminum (1=0.14, r=0.115,m=0.08, m,.=0.35).

Fig. 1. (a) The schematic of the RIP (pendulum upright); (b) The RIP physical system (pendulum downward). (Screen dumps)

2.2. Dynamic model ofthe RIP

The dynamic model of the inverted pendulum results from the decomposition of the plant into two planes: XY horizontal plane of the pivot arm and XZ vertical plane where the pendulum is rotating. From the Newton's laws in the X and Z directions and Euler's equations of the rotational motion around the points G and P results the equations of motion of the mechanical system [3, 8]. These equations which describe the dynamics of the model are quite nonlinear.

^ Fx = m ■ j Z Fz = m • 2 S Mo = Jo Z Mo = Jo

- mlrcos(a)û+ — ml2a2 - mglsin(a) = 0

•• •• • ^ s

(J + mr2 mlrcos(a)a+ mlr sin(a)a + Beq 0 = T

In the dynamic model (1) standard assumptions (such as zero friction, rigid objects) were used and also the velocity of point G (center of gravity) on the pendulum relative to that of point P and the absolute velocity of the point G on the pendulum have been described. In (1) the Fx, Fz, Ma, M0, Jo and J0 are the forces, torques and the moments of inertia, Jeq and Beq are the equivalent inertia and viscous friction of the arm and pendulum (0.0036kg.m2,0.004), g is the gravitational acceleration and T is the input torque.

The kinetic energy of the mechanical system arises from the rotating arm. The rotating arm is driven by the dc motor and the input torque can be deduced from the equivalent model of a dc motor. The electromechanical parameters specific to the dc motor are: Rm motor resistance (12.5Q), Lm motor inductance (negligible), Kt, Km motor torque and electromotive constants (0.007N.m/Amp, 0.007V/rad/sec), Jm moment of inertia of the motor (4.2e" 7kg.m2), um voltage applied to the dc motor.

T = ^L . Um _ ^^ .0 _

R„ R„

2.3. Linearized model ofthe rotational inverted pendulum

A linear approximation of the non-linear system equations (1) and (2) is obtained in the model (3) using the small angle formula.

kl -0 - k2 • cos(a) • a + k2 • sin(a) • a2 + k5 - 0 = k6 ■ Vm J&j - 0 - k2 • a + k5 -0 = k6 ■ um ^

- k2 • cos(a) - 0 + k3 - a - kA • sin(a) = 0 k2 - 0 + k3 • a - kA ■ a = 0

In (3) several notations were introduced.

4 K • K K

ki = Jeq + m ■ r2 + Jm, k2 = m ■ I ■ r, k, m ■ 12, k4 = m ■ g • /, k5 = Beq + ' m , k6

i Rm Rm

The transfer function of the plant relates the variation from the desired position of the pendulum to the input voltage of the motor (initial conditions are zero). Since the interested output from the plant is the pendulum angle a, the pivot arm position 0 was first eliminated from the linearized system (3) and then the Laplace transform was applied. In the transfer function a pole and a zero at the origin have been cancelled.

Hmp ) = AQ) =_k2 • *^ • __(4)

i/^ (5) (^j ' k^ k 2)'s ^ k 2 ' k ^ ' s k^ ' k ^ ' s k ^ ' k ^

2.4. Open loop response

The non-linear and the liniarized models were implemented in the modeling and simulation environment Matlab/Simulink and the comparative open loop responses of both systems are presented in Fig. 2. The pendulum is initially situated in the upright position with a very small displacement (0.0001 rad) and thus is allowed to fall. All this time the motor is not supplied. The simulation results highlight that the linear model correctly depicts the motion of the pendulum for the first 1.2 seconds, until it reached 20 degrees and then began to diverge from the actual motion. The system is also unstable and non-linear.

3. Swing-up control and balance control of the inverted pendulum

As stated in the introduction of the paper the objective of the global control problem is to bring the pendulum from the stable downward position in the unstable upright position and balance it there. These tasks can be done with a single controller or by multiple systems. From this point of view, the overall problem is divided into two control subproblems: swing-up control and balance/stabilizing control. Of course, another important subject is to find the right switching criterion between these two control strategies.

Most of the scientific works mention that switching process is done by a third controller, named switching/catching controller. The whole control process is more robust in case of any disturbance is applied to the pendulum, if the catching controller can switch properly between the swing up control and the balance control. Some authors in [7, 8] implement an energy - based mode switching control to achieve a much better performance, by measuring the pendulum angle and by comparing the energy of the system with a threshold E0. Others authors [20] use a dynamic programming and reinforcement learning control. But the dynamic programming may require impractical amount of computation effort.

In this paper the term switching/catching controller it is replaced with the term switching criterion, because it is more appropriate. The experiments and simulations shown that RIP system is quite robust and the performances are kept also if the switch mode it is based on fixing a simple threshold of 20° for the pendulum angle a. If this condition is satisfied, balance control will be selected by the switching criterion, otherwise the controller will stay in the swing up mode. When the RIP system is disturbed from the balance state and the pendulum is deviated from the upright position to certain degrees larger than the threshold value, the criterion should switch back the system to the swing up control.

3.1. Swing-up control using conventional PD controllers

Swing-up controller will drive the position of the arm in order to get away from the stable downward position of the pendulum. It makes sense that, by supplying the dc motor and by moving the arm back and forth strongly enough, the energy is gradually added to the RIP system, so the pendulum it can be swing-up to the unstable position.

Many different control algorithms (trajectory tracking, energy based method, rectangular reference input swing up type, adaptive or intelligent strategies) can be used to perform the swing up control. Here, a positive feedback PID controller is proposed because of its simple structure, effectiveness and easy tuning. The block control diagram consists of two loops as shown in Fig. 3. The inner loop performs the position control of the arm, while the outer loop specifies the desired trajectory for the arm angle to swing the pendulum to the balancing position.

Fig. 3. Simulink block diagram of the RIP swing-up control.

For the servo arm to track the desired position, a negative feedback PD control law (5) is designed.

um «) = kp0-s0+ kd0- ^ (5)

The position PD controller offers the voltage applied to the motor so that angle of the arm 6 tracks the desired position 6d. The tuning parameters of the conventional PD controller kpe and kde have been set to 100 and 2.5, to achieve the desired performances for the inner closed loop.

In the outer loop, for swing-up the pendulum a positive feedback PD control loop was chosen. This positive feedback loop increases the energy provided to the pendulum and actually has a role of destabilizing the system, because the downward position of the pendulum is stable. The values of the tuning PD parameters kpa and kda play a key role in bringing up the pendulum smoothly. These parameters (the proportional and derivative constants) can be tuned to adjust the "positive damping" in the system. Moreover, the command provided by the swing-up controller

(desired angle of the pivot arm) must be limited in a range of ±180° to ensure that the arm does not reach a position that will cause a collision with other hardware. The swing-up PD control law has the form (6).

0* (') = *,«■*« + kda• ^ (6)

The values chosen for the proportional and derivative constants are 0.2 and 0.05. For derivative constant kda a compromise should be made between increasing the reaction time and decreasing the noise amplification [7].

3.2. Balance/stabilizing control usingfuzzy-PD controller

The goal of the stabilizing controller is to maintain the pendulum in the upright position when it is almost there. In this case also a lot of algorithms can be used (state feedback, linear quadratic based on the linearized plant model, pole placement). Due the nature of the RIP which includes the unstable upright position, non-linearities and modeling uncertainties a fuzzy-PD controller was chosen for the stabilization problem. The block diagram of the swing-up control is presented in Fig. 4.


Setpoint Alpha (deg)

Control signal

du/dt —► gcT>J Balance Fuzzy --Controller

Theta (rad)

Um (V) Alpha (rad)

RIP NonLinear

Fig. 4. Simulink block diagram of the RIP balance/stabilizing control.

The design of the fuzzy controller for the stabilization problem can be resumed to choosing and processing the inputs and outputs of the controller and designing its four component elements (the rule base, the inference engine, the fuzzification and the defuzzification interfaces) [21,22].

The inputs to the fuzzy system are angle error sa (if the reference is the upright position then the angle error becomes the displaced from the upright position) and the change in angle error csa. The output from the fuzzy system is the voltage um. The universe of discourse of the variables was normalized to cover a range of [-1, 1] and scaling gains (ge, gc, gu) were used to normalize. To simplify the future implementation of the controller a standard choice for the membership functions was used with five membership functions for the three fuzzy variables (meaning 25 = 52 rules in the rule base) and symmetric, 50% overlapping triangular shaped membership functions (Fig. 5 (b)), meaning that only 4 (22) rules at most can be active at any given time.

The fuzzy controller implements a rule base made of a set of IF-THEN type of rules. These rules were determined heuristically based on the knowledge of the plant. The resulting rule table is shown in Fig. 5 (a).

The min-max inference engine was chosen, which for the premises, uses maximum for the OR operator and minimum for the AND operator. The conclusion of each rule, introduced by THEN, is also done by minimum. The final conclusion for the active rules is obtained by the maximum of the considered fuzzy sets.

To obtain the crisp output, the centre of gravity (COG) defuzzification method is used. This crisp value is the resulting controller output.

e(kT) /c(kT) NB NS z PS PB






-1 -0.66 -0.33 0 0.33 0.66 1

4. Simulation results

Fig. 5. (a) Fuzzy controller rule table; (b) Fuzzy sets for the variables.

To study the simulation of the rotational inverted pendulum control, the systems were modeled in Matlab Simulink and the results are shown in Fig. 6.

First diagram tested was the inner loop from the swing-up control (pivot position controller) and the responses of the closed-loop system to the 10° step reference are presented in Fig 6 (a). It can be seen that the response has a 4% overshoot and the first peak is at 0.1 second. So, the position controller meets the required specifications.

Fig. 6 (b) shows also that the swing-up control system achieves its goal and the pendulum is brought up (the curve of the angle passes -20° line) in about 4.5 seconds. As stated before the swing-up time can be reduced by adding an impulsive control which will increase the energy in the system.

100 50 0 -50 -100

-0 -dd

t (sec)

0.1 0.2 0.3 0.4

is r*

•\ / f

t [sec)

t( 'sec)

0.1 0.2 0.3 0.4

20 10 0 -10 -20

& * W« W

t (sec)

t (sec)

-170 -175 -180 -185 -190

t (sec)

0.1 0.2 0.3 0.4

Fig. 6. (a) Signals from the arm position control; (b) Signals from the swing-up control; (c) Signals from the balance/stabilizing control.

After this process the RIP control is taken by the balance/stabilization fuzzy system. To study the balance/stabilization fuzzy controller an impulse disturbance with amplitude of 10 degrees and period of 4 seconds is added to the measured a. Fig. 6 (c) highlights that the balance controller is good enough to maintain the pendulum in the upright position and keep it there stably.

5. Conclusions

In this paper the rotational inverted pendulum RIP control has been studied. The RIP control problem can be divided in several tasks. First the pendulum must be brought up from its stable position (named downward position). This was done using a cascade control scheme with two conventional PD controllers. The inner loop has a PD position controller of the pivot arm, while on the outer loop is the swing-up controller. So, the task is achieved in about 4.5 seconds. From this point the balance/stabilizing control is made by the fuzzy-PD system. The modern system was implemented knowing the particular nature of the RIP system consists in non-linearities, modeling uncertainties and instability and investigated even in the presence of small impulse perturbations. To make the whole control process globally stable, a simple switching criterion based on a threshold for the pendulum angle was also attempted. The control strategies experienced in this paper can also be applied to other complex systems.


[1] Ortega R, Spong MW, Gomez-Estern F, Blankenstein G. Stabilization of a class of underactuated mechanical systems via interconnection and damping assignment. IEEE Transactions on Automatic Control, 2002; 47:1218-1233.

[2] Spong MW, Block DJ. The Pendubot: a mechatronic system for control research and education. Proceedings of the 34th IEEE Conference on Decision and Control. New Orleans, LA, 1995: 555-556.

[3] Mei H, He Z. Study on stability control for single link rotary inverted pendulum. International Conference on Mechanic Automation and Control Engineering MACE. Wuhan, 2010: 6127-6130.

[4] Grasser F, D'Arrigo A, Colombi S, Rufer AC. JOE: A mobile, inverted pendulum. IEEE Transactions on Industrial Electronics, 2002; 49:107-114.

[5] Phuong NT, Loc HD, Thuan TQ. Control of two wheeled inverted pendulum using sliding mode technique. International Journal of Engineering Research and Applications, 2013; 3: 1276-1282.

[6] Park M, Kim YJ, Lee JJ. Swing-up and LQR stabilization of a rotary inverted pendulum. Artificial Life and Robotics, 2011;16(l):94-97.

[7] Wang Z, Chen YQ, Fang N. Minimum-time swing-up of a rotary inverted pendulum by iterative impulsive control. Proceeding of the 2004 American Control Conference. Boston, MA, 2004: 1335-1340.

[8] Melba Mary P, Marimuthu NS. Minimum time swing up and stabilization of rotary inverted pendulum using pulse step control. Iranian Journal of Fuzzy Systems, 2009; 6:1-15.

[9] Yamakita M et al. Robust swing up control of double pendulum. Proc. of the American Control Conference. Seattle, WA, 1995: 290-295.

[10] Torres-Pomales W, Gonzalez OR. Nonlinear control of swing-up inverted pendulum. Proceedings of the IEEE International Conference on control application. Dearborn, MI, 1996: 259-264.

[11] Yoshida K. Swing up control of an inverted pendulum by energy based methods. Proceedings of the American Control Conference. San Diego, CA, 1999: 4045-4047.

[12] Astrom KJ, Furuta K. Swinging up a pendulum by energy control. Automatica, 2000; 36:287-295.

[13] Fantoni I, Lozano R, Spong MW. Energy based control of the Pendubot. IEEE Transactions on Automatic Control, 2000; 45:725-729.

[14] Dotoli M, Maione B, Naso D, Turchiano B. Fuzzy sliding mode control for inverted pendulum swingup with restricted travel. Proceedings of The 10th IEEE International Conference on Fuzzy Systems. Melbourne, Vic, 2001: 753-756.

[15] Nechyba CM, Xu Y. Neural network approach to control system identification with variable activation functions. Proc. IEEE Int. Symp. on Intelligent Control, 1994: 358-363.

[16] Radhamohan SV, Subramaniam MA, Nigam MJ. Fuzzy swing-up and stabilization of real inverted pendulum using single rulebase, Journal of Theoretical and Applied Information Technology, 2010; 14: 43-50.

[17] Acosta JA, Gordillo F, Aracil J. A new swing-up law for the Furuta pendulum. International Journal of Control, 2003; 76(8): 836-844.

[18] Ryu C, Choi BJ, Choi BY. Design of a fuzzy logic controller for a rotary-type inverted pendulum system. International Journal of Fuzzy Logic and Intelligent Systems, 2002; 2(2): 109-114.

[19] Hassanzadeh I, Mobayen S. Controller design for rotary inverted pendulum system using evolutionary algorithms. Mathematical Problems in Engineering, 2011; 17 pages.

[20] Atkeson CG, Santamaria JC. A comparison of direct and model-based reinforcement learning.Proceedings of the IEEE International Conference on Robotics and Automation, 1997: 3557-3564.

[21] Passino KM, Yurkovich S. Fuzzy control, Addison Wesley Longman Inc., 1998.

[22] Duka AV, Abrudean M. Simulation of a Fuzzy-PD Learning Control System. IEEE International Conference on Automation, Quality and Testing Robotics, 2008: 81-84.