You are on page 1of 3

2010 International Symposium on Computer, Communication, Control and Automation

Design of Controller for Inverted Pendulum

Yat-Chen Chen Chih-Chin Wen


Department of Electrical Engineering, Mechatronics section, Energy and Agile System
ao uan niversity Department, Metal Industries esearch
aoshuing, Taiwan Development Centre, aohsiung, Taiwan
e mail mikechen cc.kyu.edu.tw e mail ccwen mail.mirdc.org.tw

The inverted pendulum system (Figure 1) is composed of


Abstract--- Based on the Lyapunov stability theorem, an a rigid pole and a cart. The rigid pole is hinged on the cart.
adaptive controller is proposed for the inverted pendulum The cart can move left or right along the rail. The
in this paper. The design of the robust controller can be objective of controlling the inverted pendulum is to drive
used to suppress the uncertainties. The simulation results the cart so that the rigid pole can be balanced, that is,
of inverted pendulum control have demonstrated the
feasibility of the proposed method.
T 0 . The dynamic equations of the inverted pendulum
Key ords-- ya uno stability ada ti e control are governed by [8]
in erted endulu km k g km2 k g2
in  2
p (m  M ) p  mT cos(T )
m r m r
I. Introduction
 mT 2 sin(T )
The inverted pendulum on a cart which is a 0 p  m sin(T )T p
m cos(T ) 
popular practice to learn control techniques for its  mT  mg sin(T ),
2
(1)
nonlinear unstable behavior is an under-actuated
mechanical system with two degrees of freedom and one where M is the mass of the cart, m is the mass of the rigid
control input and . The systems characteristics are an pole, L is the half the actual rigid pole length, F is the
unstable equilibrium point at the pendant position, as input force to the cart, p is the position of the cart, T is
well as two uncontrollable points when the pendulum is the angular position of the rigid pole, in is the voltage
at the horizontal position. input, m is the armature resistance, k g is the internal
In recent years, many researchers have presented the gear ratio, km is the motor torque constant, and r is the
achievements of asymptotical stability for controlling the
inverted pendulum. Muskinja Tovornik [1] and Hojati motor gear radius. The parameters of the inverted
Gazor [2] designed the fuzzy controller for inverted pendulum is listed on table 1 [8] and the linearization
pendulum. Using an energy-based control law, equation of (1) at ( p, T, 
p, T) (0, 0, 0, 0)
Chatterjee et al. [3] stabilized a cart-pendulum system s ( $  '$) s  b1 in (2)
with restricted travel. hao Spong [4] proposed a
where s [ s1 s2 s3 s4 ]T [ p T p T]T ,
hybrid-control strategy to achieve globally
asymptotically stability. By combing the FLC and a b1 [0 0 3.8 12.4]T and
linear state feedback technique, Lin Sheu [5] ª0 0 1 0º
controlled the linearized model of the inverted pendulum. «0 0 0 1»»
Harrison [6] designed the linear quadratic optimal
( $  '$) « .
controller to stable the inverted pendulum. Huang «0  4.5  16.8 0»
Huang [7] used the grey prediction strategy to control the « »
inverted pendulum. ¬0 46.9 55.3 0¼
In this paper, we proposed an adaptive controller for In order to control the system (2), we employ the state
the posture control problem of inverted pendulum transformation x(t ) ª¬ x1T º¼
T
7s(t ) ,
4
control to achieve the property of the asymptotical
x1 # > @
T
stability even though the mismatched perturbations 1 2 3 , where the state transformation
existed in the plant. This paper is organized as follows.
matrix 7 is given by
In Section 2, we briefly introduce the inverted pendulum
to be controlled. Section 3 gives the design of the robust ª1 0 0 0 º
controllers. The analysis of stability is presented in «0 0 0 0 »»
Section 4. In Section 5, a numerical simulation is used to 7 «
show the applicability of the proposed design technique. «0 0 1 0.3065»
« »
¬0 0 0 1 ¼
II. Preliminaries and Problem Formulations

978-1-4244-5567-6/10/$26.00 ©2010 IEEE 3CA 2010



Note that 1 s1 and 2 s2 . Then one can get ] # 'f1  .'$1x1
1
x 7$7 x  7'$7 x  7b1 1
in . (3) satisfy the in the domain of interest satisfy the constraints
(3) can also be written as ] dg , the tracking error e will reach zero
x 1 ( $1  '$1 )x1  $ 2 4 (4a) asymptotically.
4 f1  'f1  u (4b) Proof: Substituting (5) into (4a), one can obtain
e x 1  x r
where
ª 0.3065º $1x1  '$1x1  $ 2 z  $ 2  z  x r
ª0 0 1 º 4

$1 «0 0 0 »» , $ 2
« 1 » $ e  '$1x1  $ 2I .
c
(7)
« « » 1

¬«0 9.8762 0.4924 ¼» «¬ 0.043 »¼ To show the virtual input can stabilize the dynamic of the
tracking error e asymptotically, one can use the
are known constant
matrices,
f1 46.9 2  55.3 3  16.9 4 is a known
function, 1 T
following Lyapunov function 1 e We . Now
'f1 0 is the matched perturbation, b= -12.4 and u= in . 2
differentiating 1 along the trajectory of (7) yields
ª0 0 0 º
'$1 «0 0 0 »»   1 eT Qe + eT (W +  T W)x + eT W$ I
« 1
2
1 1 1 2
«¬0 0 0.646 »¼
1
d  Q e + W 1 e + eT WA 2I
2 2
can be assumed as the mismatched perturbation.
2
Let y x is the plant output and the desired reference
d H1 e + eT WA 2I .
2
(8)
> @
T
model is x r $ r x r , where y r xr r1 r2 r3 .
In order to proof the tracking error will approach zero,
Since it is desired to drive the angle of inverted pendulum we can define a Lyapunov function candidate as
to zero, we have to set r 2 0 and r 2 (0) 0 so that 1
2 1  I 2 . From (5), one may obtain the time
r 2 (t ) 0 forever. 2
derivative of the virtual input I as
III. Design of the Robust Controller I   .e  a c x
4 r r

f1  'f1  u  . ª¬ $1  $1 x1  $ 2 º¼
In order to track the desire reference signal x r under 4

the mismatched perturbations in system (4), the variables ] u2  u3 . (9)


I and z can be designed as By using (8), one can obtain the time derivative of 2
I 4 z along the trajectories of (9) as
z (Ke  acr x r ), (5)    II d H e 2 + eT W$ I  I ª]  u  u º
2 1 1 2 ¬ 2 3 ¼
1u3
where a constant vector K  can be found so that d H1 e  I ]  I u3 d H1 e  I g  ( g  H 2 ) I
2 2

Re ª¬ $1c º¼  0 , where $1c # $1  $ 2.. There exist


H1 e  H 2 I .
2

acr  1u3
so that $1  $ r $ 2 acr . An error vector is
It indicates that the tracking error e and the variable I
3u1
defined as e = x1 - x r  . W  3u3 is a designed will approach zero asymptotically. ,
symmetric and positive definite matrix, where
 # WA1c  A1cTW . is also a designed symmetric and V. Example
positive definite matrix and t 2 '$1 W  H1 ,
The virtual input and controller are designed as (5) and
where H1 is a positive constant. The proposed controller (6) respectively, where the parameters are chosen as
is designed as . > 2.73 9.44 2.31@ , g , H1 , H 2 (5, 0.1, 0.1) and
u u1  u2  u3 , (6)
where ª3.97 1.80 0.90º
«1.80 1.96 1.14 » .
u1  f1  1 ª¬. $1x1  $ 2 4  (acr  . ) $ r x r º¼ W « »
u2  1
$ We
T
1
«¬0.90 1.14 0.98»¼
u3  1
g  H 2 sign I . Let $r $1 and the initial conditions are
g and H 2 are the designed positive constants. x 0 > 0.5 0.2 0.5 0@ xr 0
T
, 0 .The results of
simulation are given from Figure 2 to Figure 4. The
IV. Stability Analysis angular position T is shown in Figure 2. It is clear that
by applying the proposed control input to the inverted
Theorem 1 Consider the system . If the ro ust pendulum, the angular position T of the pendulum tends
controller is given y , and the lump pertur ation to zero. Figure 3 shows the tracking error e , which are all


driven to zero as t o f . Figure 4 is the control input.
q
To avoid undesirable chattering, the discontinuous
function can be replaced by a saturation function [10].
However, it will lose the property of the asymptotically
stability.
L

VI. Conclusions mg

An adaptive controller based on the Lyapunov stability F


M
theorem is presented in this paper. The simulations have
show that an inverted pendulum control system have
successfully achieved the property of the asymptotical p
stability even though some matched and mismatched F i g . 1 : I n v e r t e d p e n d u l u m s y s t e m.
perturbations existed in the plant. 0.10

Table 1: Parameters of the inverted pendulum [8] 0.05

mass of the cart M 0.455Kg 0.00


mass of the rigid pole m 0.210Kg
-0.05
half the actual rigid pole
0.305m
length L -0.10

motor gear radius r 0.635m


-0.15
armature resistance m 2.6 :
-0.20
the internal gear ratio kg 3.7:1
0 2 4 6 8 10 12
motor torque constant m 0.0076Nm/Amp
Fig. 2: Angular position T .
0.20
0.15
0.10
References 0.05
0.00

[1] N. Muskinja and B. Tovornik, Swing Up and stabilization of a -0.05

Real Inverted Pendulum, IEEE Transactions on Industrial -0.10 e1


Electronics, Vol. 53, No. 2, pp. 631-639, 2006. -0.15 e2
-0.20 e3
[2] M. Hojati and S. Gazor, Hybrid Adaptive Fuzzy Identification an -0.25
Control of Nonlinear System, IEEE Transactions on Fuzzy -0.30
system, Vol. 10, No. 2, pp. 198-208, 2002. -0.35
-0.40
[3] D. Chatterjee, A. Patra, and H. K. Hoglekar, Swing-up and
0 2 4 6 8 10 12
stabilization of cart-pendulum system under restricted cart track
length, System Control Letters, Vol. 47, pp. 355-364, 2002. Fig. 3: tracking errors e .
[4] J. hao and M. W. Spong, Hybrid control for global stabilization 1.0
u
of the cart-pendulum system, Automatica, Vol. 37, pp.
1941-1951, 2001. 0.5

[5] C. E. Lin and Y. R. Sheu, A hybrid control approach for 0.0

pendulum-cart control, IEEE Transaction on Industrial Electronic, -0.5


Vol. 39, pp. 208-214, 1992.
-1.0
[6] R. F. Harrison, Asymptotically optimal stabling quadratic control
of an inverted pendulum, IEE Proceeding Control Theory and -1.5
Applications, Vol. 150, No. 1, pp. 7-16, 2003.
-2.0
[7] S.-J. Huang, and C.-L. Huang, Control of an Inverted Pendulum
-2.5
Using Grey Prediction Model, IEEE Transactions on Industry
Applications, Vol. 36, No. 2, pp. 452, 2000. -3.0

[8] A. Apkarian, A Comprehensive and Modular Laboratory for 0 2 4 6 8 10 12


Control Systems Design and Implementation, uanser Consulting,
1995. Fig. 4: Control input u.
[9] C. M. Kwan, Sliding mode control of linear system with
mismatched uncertainties, Automatica, Vol. 31, No. 2,
pp. 303-307, 1995.
[10] J. Y. Hung, W. Gao, and J. C. Hung, Variable structure control: A
Survey, IEEE Transactions on Industrial Electronics, Vol. 40, No.
1, pp. 2-22, 1993.



You might also like