Simulation and Robustness Studies on an Inverted ... - IEEE Xplore

2 downloads 0 Views 263KB Size Report
Simulation and Robustness Studies on an Inverted Pendulum. HUANG Chun-E1, LI Dong-Hai1, SU Yong2. 1. State Key Laboratory of Power Systems, ...
Proceedings of the 30th Chinese Control Conference July 22-24, 2011, Yantai, China

Simulation and Robustness Studies on an Inverted Pendulum HUANG Chun-E1 , LI Dong-Hai1 , SU Yong2 1. State Key Laboratory of Power Systems, Department of Thermal Engineering, Tsinghua University, Beijing 100084, P. R. China E-mail: hce [email protected], [email protected] 2. China Center for Information Industry Development, Beijing 100081, P. R. China Abstract: In this paper, angular control of the pendulum and position control of the cart for an inverted pendulum are considered, and the design of its four typical controllers are introduced by using PID control, fuzzy control, state feedback control and TC control. Simulation results and Monte-Carlo experiments show that the four controllers have good performance and robustness when the initial angle is 0.3 radians. Key Words: Inverted Pendulum, PID Control, Fuzzy Control, State Feedback Control, TC Control, Monte-Carlo Experiment

1 Introduction Inverted pendulum problem is one of the most important issues and has attracted the attention of massive scholars in control literatures. As a typical unstable nonlinear system, an inverted pendulum is often used as a benchmark for checking the performance and effectiveness of a new control method. Recently, a lot of studies on its stabilization control have been done, such as PID control [1, 2, 3], fuzzy inference [4, 5, 6, 7], etc.. In [5], Passino applied a fuzzy PD inference to the angular control of an inverted pendulum. Becerikli [7] designed a fuzzy controller to control the angle of the pendulum by using internet technologies Java Applets. It is well known that stabilization control of an inverted pendulum system includes the position control of the cart besides the angular control of the pendulum. However, the above stated approaches only took into consideration the angular control of pendulum. For an inverted pendulum system, the angle control of the pendulum and the position control of the cart are researched widely, many different control methods have been introduced. In [3], Wang introduced the controller by using PID control. Yi [6] adopted SIRMS and the dynamic degrees to control the pendulum and the cart such that the angular control of the pendulum has priority over position control of the cart. From the points of control engineering, PID control as the tool of choice in over 90% of current industrial control applications [8], fuzzy control which has the strong ability to deal with the complex and uncertain system, state feedback control as one of the most important and basic method in modern control process and TC control which is a way that can arrive at good robustness for the non-accurate and nonlinear model are very representative. In this paper, we investigate an inverted pendulum system, and introduce how to design controllers by the four methods such that the angle of the pendulum and the position of the cart can be controlled completely. The simulation results and Monte-Carlo experiments show that the four control methods on an inverted pendulum have a high ability to stabilize completely the pendulum and the cart and good robustness when the initial angle is 0.3

Fig. 1: The inverted pendulum system Table 1: Parameters of the inverted pendulum Parameter Value

M (kg) 1

m(kg) 0.1

l(m) 0.3

g(m/s2 ) 9.8

radians.

2 An Inverted Pendulum System An inverted pendulum system considered here is shown in Fig. 1, which consists of an inverted pendulum, a cart, a straight-line rail and a driving unit. The cart can move on the rail freely and the pendulum can rotate around the pivot in the same vertical plane with the rail. Suppose that no friction exists in the system and the dynamic equation of the system can be expressed as [9] 

x ¨= θ¨ =

−3mg sin θ cos θ+4ml sin θ θ˙ 2 +4F (4M +m)+3m sin2 θ − cos θF −ml sin θ cos θ θ˙ 2 +(M +m)g sin θ (4M +m)l/3+ml sin2 θ

(1)

where M and m are the mass of the cart and the pendulum in the unit [kg], respectively, l is the half length of the pendulum in the unit [m], and g is the gravity acceleration in unit [m/s2 ]. The variable F is the driving force in the unit [N] applied horizontally to the cart. The variables θ and x represent the angle of the pendulum from upright position and the position of the cart from the rail origin, respectively. For the variables θ and x, we suppose that the clockwise and right direction are positive. The parameters of the inverted pendulum system is given in Tab. 1. In whole paper, we design four controllers to control the angle of the pendulum and the position of the cart such that the pendulum arrives and keeps at the upright position and the cart can be stabilized at the origin.

This work is supported by National Nature Science Foundation under Grant 51076071.

615

3 Design of Controllers on the Inverted Pendulum For an inverted pendulum system, it is not an easy thing to control the angular of the pendulum and the position of the cart, and there exist some problems for different controllers, such as tuning parameters, response time and so on. In this section, we design four controllers of the inverted pendulum (1) such that they arrive at the optimization of performance when the initial angle is 0.3 radians. 3.1 PID Controller on the Inverted Pendulum In this subsection, we utilize two PID controllers to control the angle and position of the inverted pendulum. The control structure is given in the Fig. 3(a). The parameters of PID controllers are tuned as follows. Step 1 Suppose that the parameters of PID2 for the inverted pendulum are all equal to zero, we tune the parameters of PID1 such that satisfying simulation result of the angle is obtained. The parameters of PID1 are given as PID1 : KP1 = 25, Step 2

1 KD = 15,

Fig. 2: Membership functions of FLC1 Table 2: Fuzzy rule-bases Force F

Error e

KI1 = 4.8.

Tuning the parameters of PID2. We have

PID2 : KP2 = −2,

2 KD = −0.65,

NL PL PL PL PS ZE

NL NS ZE PS PL

Chang-in-error e˙ NS ZE PS PL PL PS PL PS ZE PS ZE NS ZE NS NL NS NL NL

PL ZE NS NL NL NL

of FLC1 such that satisfying simulation result of the angle is obtained, and choose the parameters of FLC1 as follows.

KI2 = −1.2.

FLC1 : g01 = 1.8,

Simulation results are shown in Fig. 4(a) and imply that two PID controllers can control completely the angle and position of the inverted pendulum.

Step 2

g21 = 3.

Tuning the parameters of FLC2. We have FLC2 : g02 = 1,

3.2 Fuzzy Controller on the Inverted Pendulum In this subsection, we introduce fuzzy controller of the inverted pendulum which consists of two fuzzy logic controllers, denoted by FLC1 and FLC2. For FLC1, there are two input linguistic variables the error e and chang-in-error e˙ of the angle and one output variable force. Suppose that they are all taking on the following linguistic values: neglarge, negsmall, zero, possmall, poslarge, and use capital letters to describe simply as follows: NL, NS, ZE, PS, PL. Theirs membership functions are all defined in Fig. 3 as trapezoids or triangles. For the inverted pendulum, we can obtain the fuzzy rule-bases of FLC1 according to analyzing its dynamics process, as shown in Tab. 2. The inference result can be calculated by min-min-gravity method. For the fuzzy controller FLC2, there are two input linguistic variables the error and chang-in-error of the position of the cart and one output variable. Similarly, we can define linguistic values, theirs corresponding membership functions and fuzzy rulebases of FLC2. Assume that FLC2 has the same linguistic values, corresponding membership functions and fuzzy rulebases with FLC1. In order to get satisfying control performance, we add the proportional and derivative gains before the FLC1 and FLC2, respectively, and also put a gain between each fuzzy controller and the inverted pendulum. The control structure is shown in Fig. 3(b). We use the fourthorder Runge-Kutta method and an integration step size of 0.001. Subsequently, we tune the gains such that the controller arrives at a good performance. Step 1 Suppose that the parameters of FLC2 for the inverted pendulum are all equal to zero, we tune the parameters

g11 = 0.15,

g12 = 0.6,

g22 = 1.

Simulation results are shown in Fig. 4(b), we can observe that two FLC controllers can realize completely the control of angle and position of the inverted pendulum in less than five seconds. 3.3 State Feedback Controller on the Inverted Pendulum In this subsection, the design of state feedback controller on the inverted pendulum is introduced and simulation results are shown. Let the four state variable of the inverted pendulum system x1 , x2 , x3 , x4 be the position of the cart from the rail origin, its velocity, the angle of the pendulum from upright position, its angular velocity, respectively. Then x˙2 and x˙4 are the position and angular acceleration of the inverted pendulum. In order to design the state feedback controller of the inverted pendulum, we linearize the system equation (1) at the initial θ = 0. Let sin θ ≈ θ, θ˙2 ≈ 0 and cos θ ≈ 1. We can obtain the linear state space model of the inverted pendulum as follows. x˙ = Ax + BF y = Cx + DF where ⎡

0 ⎢ 0 A=⎢ ⎣ 0 0

616

1 0 0 0

0

3mg − 4M +m 0

3(M +m)g (4M +m)l

⎤ 0 0 ⎥ ⎥ 1 ⎦, 0

(2) ⎡

⎢ B=⎢ ⎣

0

4 4M +m

0

− (4M 3+m)l

⎤ ⎥ ⎥, ⎦

C=



1 0 0 0 0 0 1 0

,

D = 0.

We can check easily that the followings hold rank{B

AB

A2 B

A3 B} = 4,

rank{C

CA

CA2

CA3 } = 4,

(a) PID controller

they imply that the state space model of the inverted pendulum is complete controllable and observable. Hence, we can choose the polar points of the system at any desired positions. √Suppose that√desired close-loop polar points are −2 + 2 3i, −2 − 2 3i, −3, −3. We can obtain desired characteristic polynomial f (λ) = λ4 + 10λ3 + 49λ2 + 132λ + 144.

(b) Fuzzy controller

(3)

For the system (2), let K = [k1 k2 k3 k4 ], we can calculate out the characteristic polynomial of the close-loop system f ∗ (λ) =

λ4 + (0.9756k2 − 2.4390k4 )λ3 +(0.9756k1 − 2.4390k3 − 26.2927)λ2 −25.6514k2 λ − 25.6514k1 .

(c) State feedback controller

(4)

Let f (λ) = f ∗ (λ). We have k1 = −5.6137, k3 = −33.1155,

k2 = −5.1459, k4 = −6.1584.

The diagram and simulation results are shown in Fig. 3(c) and Fig. 4(c), respectively.

(d) TC controller

Fig. 3: Four controllers of the inverted pendulum structures

3.4 TC Controller on the Inverted Pendulum In [10], Tornambe introduced how to design TC controller for Multi-input Multi-output system, and obtained satisfying effectiveness. In this subsection, we design a TC controller to control the angle of the pendulum and the position of the cart for the inverted pendulum. In the following, we transform the state equation (2) into control standard form. Suppose that there is linear nonsingular transformation x = T z such that the system (2) can be change into control standard form ⎡

0 1 ⎢ 0 0 z˙ = ⎢ ⎣ 0 0 0 0

0 1 0

3(M +m)g (4M +m)l

⎤ ⎡ 0 ⎢ 0 ⎥ ⎥ ⎢ 1 ⎦z + ⎣ 0

⎤ 0 0 ⎥ ⎥ F. 0 ⎦ 1

The design of TC controller for the inverted pendulum is the following, its structure is shown in Fig. 3(d): ⎧ ˆ ⎪ ⎪ F = −h0 (z1 − yd ) − h1 z2 − h2 z3 − h3 z4 − d ⎨ ˆ d = ξ + k0 (z1 − yd ) + k1 z2 + k2 z3 + k3 z4 ⎪ ξ ⎪ ˙ = −k3 ξ − k3 (k0 (z1 − yd ) + k1 z2 + k2 z3 + k3 z4 ) ⎩ −(k0 z2 + k1 z3 + k2 z4 ) − k3 F, (6) where yd is referenced input of the system. In TC controller of the inverted pendulum, the parameters hi (i = 0, 1, 2, 3) are decided by anticipated dynamic character of the system, and the parameters ki (i = 0, 1, 2, 3) decide the robustness of the system. Based on massive simulation experiments, we can choose the parameters as follows.

(5)

We can calculate nonsingular transformation matrix T and its inverse matrix T −1 as follows. ⎡ ⎢ ⎢ ⎢ ⎣ ⎡ ⎢ ⎢ ⎢ ⎢ ⎣

− (4M3g +m)l 0 0 0 +m)l − (4M3g

0 0 0

0

− (4M3g +m)l

4 4M +m

0

0 4 4M +m

0 0

− (4M 3+m)l 0

− (4M 3+m)l

0

4l2 (4M +m) 9g

0

+m)l − (4M3g 0 0

0

− (4M 3+m)l 0

0

4l2 (4M +m) 9g

0

− (4M 3+m)l

h0 = 81, k0 = 0,

⎤ ⎥ ⎥ ⎥ ⎦

h1 = 108, k1 = 0,

h2 = 54, k2 = 0,

h3 = 12; k3 = 50.

Simulation results of the inverted pendulum on TC controller are shown in Fig. 4(d).

⎤ ⎥ ⎥ ⎥ ⎥ ⎦

617

0.4

0.8

10

0.2

0

5

Force (N)

Position (m)

Angle (rad)

0.6 0.4 0.2

0

0 −0.2

−0.2

0

2

4

6 8 Time(sec)

10

12

0

2

4

6 8 Time(sec)

10

−5

12

0

2

4

6 Time(sec)

8

10

12

0

2

4

6 Time(sec)

8

10

12

0

2

4

6 Time(sec)

8

10

12

0

2

4

6 Time(sec)

8

10

12

(a) PID controller 0.4

0.8

10

0.2

0

0.4

5

Force (N)

Position (m)

Angle (rad)

0.6

0.2 0

0

−0.2 −0.2

0

2

4

6 8 Time(sec)

10

12

0

2

4

6 8 Time(sec)

10

−5

12

(b) Fuzzy controller 0.4

0.8

10

0.2

0

5

Force (N)

Position (m)

Angle (rad)

0.6 0.4 0.2

0

0 −0.2

−0.2

0

2

4

6 Time(sec)

8

10

12

0

2

4

6 Time(sec)

8

10

−5

12

(c) State feedback controller 0.4

0.8

10

0.2

0

5

Force(N)

Position (m)

Angle(rad)

0.6 0.4 0.2

0

0 −0.2

−0.2

0

2

4

6 8 Time(sec)

10

12

0

2

4

6 8 Time(sec)

10

12

−5

(d) TC controller

Fig. 4: Simulation results of the inverted pendulum on the four controllers

5

2

3 2

2

1

1

0

0

0

5

10 15 Angle overshoot (%)

20

0

5

10 15 Angle overshoot (%)

8

PID control

Fuzzy control

4 2

2

0

0

0

5

10 15 20 Position overshoot (%)

25

30

5

10 15 Angle overshoot (%)

0

5

10 15 20 Position overshoot (%)

25

30

2

0

20

0

5

10 15 Angle overshoot (%)

8

State feedback control

TC control

4 2

0

5

10 15 20 Position overshoot (%)

25

0

30

0

5

10 15 20 Position overshoot (%)

Fig. 5: Monte-Carlo experiments of the inverted pendulum

Table 3: System robustness analysis Control method PID Fuzzy State feedback TC

Angle overshoot Mean Variance 0.0399 0.0137 0.0003 0.0022 0.0294 0.0124 0.0177 0.0067

Angle transient time Mean Variance 1.8268 0.0035 2.3659 0.0002 1.4925 0.0029 1.3236 0.0009

Position overshoot Mean Variance 0.8505 0.1682 0.9598 0.0374 0.8225 0.1296 0.8843 0.0821

Position transient time Mean Variance 5.4827 0.0103 3.4572 0.0025 0.9974 0.0134 1.6764 0.0011

Table 4: Contrast of the four methods Control method PID Fuzzy State feedback TC

Rail length(m) ≥ 0.8703 ≥ 0.3206 ≥ 0.4018 ≥ 0.4470

Response time 10 4.5 3.4 4

618

20

6

4

2

0

0

6 Time(sec)

4

3

1

8

6 Time(sec)

6

20

TC control

4

3

1 0

5

State feedback control

4 Time(sec)

Time(sec)

Time(sec)

3

8

Time(sec)

5

Fuzzy control

4

Time(sec)

PID control

4

Time(sec)

5

Control force(N) [-2.2109,7.5000] [-12.75,18.9450] [-3.3534,9.9347] [-2.6374,8.5256]

Parameters 6 4 0 8

Robustness good good good excellent

25

30

4 Robustness Analysis on the Inverted Pendulum

(iv) TC controller can obtain good performance and excellent robustness. However, there is the same problem with state feedback controller during the process of simulation. At the same time, there are eight parameters needed to tune.

In this section, we analyze the robustness of the above four control methods by making Monte-Carlo experiments. Suppose that the mass of the cart M , the mass of the pendulum m and the half length of the pendulum l are the perturbation parameters of the system, theirs values change between the range ±10%. Given a step 1 to the position of the cart, we make 300 times Monte-Carlo experiments, and obtain the angle overshoot of the pendulum, the position overshoot of the cart and the estimation of the controllers performance, as shown in Fig. 5 and Tab. 3. The results show that the four controllers of the inverted pendulum system can completely control the angular of the pendulum and the position of the cart when there are three perturbation parameters, and have good robustness.

References [1] A. M. Bloch, N. E. Leonard, J. E. Marsden. Controlled lagrangians and the stabilization of mechanical systems I: the first matching theorem[J]. IEEE Transactions on Automatic Control 2000, 45(12): 2253-2270. [2] N. A. Chaturvedi, N. H. McClamroch, D. S. Bernstein. Stabilization of a 3D axially symmetric pendulum[J]. Automatica, 2008, 44(9): 2258-2265. [3] Jia-Jun Wang. Simulation studies of inverted pendulum based on PID controllers[J]. Simulation Modelling Practice and Theory, 2011, 19: 440-449. [4] R. Shahnazi, T. M. R. Akbarzadeh. PI adaptive fuzzy control with large and fast disturbance rejection for a class of uncertain nonlinear systems[J]. IEEE Transactions on Fuzzy Systems, 2008, 16(1): 187-197. [5] K. M. Passino, S. Yurkovich. Fuzzy Control[M]. AddisonWesley, Chap.2, 2001. [6] J. Yi, N. Yubazaki. Stabilization fuzzy control of inverted pendulum systems[J]. Artificial Intelligence in Engineering, 2000, 14: 153-163. [7] Y. Becerikli, B. K. Celik. Fuzzy control of inverted pendulum and concept of stability using Java application[J]. Mathematical and Computer Modelling, 2007, 46: 24-37. [8] K. J. Astrom, T. Hagglund. PID Control[M]. New York: CRC Press, p. 198, 1996. [9] Hai-Ying Wang, Li-Ying Yuan, Bo Wu. Matalab Simulations And Designs On Control Systems[M]. Higher Education Publisher, Beijing, 2009.(Chinese) [10] A. Tornambe. A decentralized controller for the robust stabilization of a class of MIMO dynamical systems[C]. American Control Conference, 1992, 24-26: 3284-3288.

5 Conclusions From the simulation results in section 3 and Monte-Carlo experiments in section 4, we contrast the four control methods from rail length, response time, control force, parameters and robustness, as shown in Tab. 4. We have the conclusions: (i) PID controller can get good performance by tuning parameters, and it is no requirement on system model. We observe that it has the longest rail length than the other controllers, despite of it realizes easily in real experiment. (ii) Fuzzy controller can arrive at good performance in short time. We find that the range of the driving force is large, in spit of it is accepted. (iii) State feedback controller can obtain a satisfying efficiency in short time. Although the nonlinear model in the process of simulation is adopted, the initial value of the system shouldn’t be far from the linearized point when the simulation is done.

619

Suggest Documents