Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/226127431

Lyapunov-Based Controller for the Inverted Pendulum Cart System

Article  in  Nonlinear Dynamics · June 2005


DOI: 10.1007/s11071-005-7290-y

CITATIONS READS

66 1,426

3 authors, including:

Carlos Aguilar-Ibáñez
Instituto Politécnico Nacional
122 PUBLICATIONS   910 CITATIONS   

SEE PROFILE

Some of the authors of this publication are also working on these related projects:

Control of autonomus unmanned aerial vehicles View project

All content following this page was uploaded by Carlos Aguilar-Ibáñez on 19 May 2015.

The user has requested enhancement of the downloaded file.


Lyapunov Based Controller for the Inverted Pendulum Cart System
CARLOS AGUILAR I., OCTAVIO GUTIERREZ F. and MIGUEL S. SUÁREZ C.
Laboratorio de Automatización y Control
Centro de Investigación en Computación
Instituto Politécnico Nacional
Av. Juan de Dios Bátiz s/n Esq. Manuel Othón de Mendizabal
Unidad Profesional Adolfo López Mateos
Col. San Pedro Zacatenco, A.P. 75476 México, D.F. 07700, MEXICO

Abstract A nonlinear control force is presented to stabilize the under actuated inverted pendulum mounted
on a cart. The control strategy is based on partial feedback linearization, in a first stage, to linearize only the
actuated coordinate of the inverted pendulum, and then, a suitable Lyapunov function is formed to obtain a
stabilizing feedback controller. The obtained closed loop system is locally asymptotically stable around its
unstable equilibrium point. Additionally, it has a very large attraction domain.

Key-Words: Under Actuated System; Nonlinear Systems; Lyapunov-Based Control.

1 Introduction IPCS. It is worth mentioning that partial feeback


Control of the simple inverted pendulum cart linearization of an under actuated system has been
system has been one of the most interesting considered in previous works. For instance in [10] and
problems in modern control theory. The device [11], a methodology was proposed to control IPCS by
consists of a pole whose pivot point is mounted on swinging it up to its unstable equilibrium position,
a cart. The pendulum is free to rotate about its pivot based on partial feedback linearization and Lyapunov
point. The cart can move horizontally perpendicular technique. Also, Olfati-Saber in [13] and [14] based on
to the axis's pendulum and is actuated by a a partial feedback linearization, developed a fixed
horizontal force. The control objective is to point backstepping procedure for global and semi-
stabilize the mechanism around the unstable global stabilization applicable for the stabilization of
equilibrium point by applying a force to the cart. the IPCS over the upper half plane.
This system has attracted the attention of many This paper is organized as follows. Section 1
researchers, as seen by a growing list of articles presents the dynamic model of the IPCS and a partial
(for example, see [12], [13], [3], [8],[4] and [9]). feedback linearization of the nonlinear equations is
The interest is due to the following facts. The proposed. Section 2 derives a nonlinear controller for
system is non-feedback linearizable by means of the stabilization of the IPCS around its unstable
dynamics state feedback [2], and hence, it is not equilibrium point. In the same section, we present
linearizable by means of dynamic state feedback some computer simulation results depicting the
control either. The system loses controllability, performance of the closed-loop system. Finally, section
when the pendulum swings past the horizontal. 3 is devoted to presenting the conclusions.
These obstacles makes it especially difficult to
perform some controlled maneuvers; for instance,
there is not a continuous force which globally
stabilizes the upright equilibrium of the pendulum
with zero displacement of the cart [1]. However,
the problem can be solved producing at least one
discontinuity in the acceleration of the cart.
Nevertheless, it is well-known how to construct a
linear locally stabilizing controller [6] but, the
linear based control design has the inconvenience
of having a very small domain of attraction. Fig. 1. The IPC
In this article, we present a nonlinear control
force to locally asymptotically stabilize the inverted
pendulum cart system (IPCS), for a very large
2 Dynamic model of the IPCS
Consider the traditional inverted pendulum mounted on
attraction domain, which is almost the whole upper
half plane. The design of the proposed control law a cart (see Figure 1). The nonlinear model of the
is based on Lyapunov's approach, in conjunction system, which can be obtained from either the Newton
with a suitable partial feedback linearization of the
or the Euler-Lagrage equations, (see more detail We stress that for the new input v = 0 and θ ∈ [0, 2π ]
[7]) is given by the aforementioned system has two equilibrium points;
one is an unstable equilibrium point x = 0 and the
mL cos θ &x& + mL2θ&& − gmL sin θ = 0
(1) other is a stable equilibrium point x = (π ,0,0,0) .
(M + m)&x& + Lm cos θθ&& − mLθ& 2 sin θ = f
3 Lyapunov based control law
where x is the cart displacement, θ is the angle
that the pendulum forms with the vertical, f is the
force applied to the cart, acting as the control input. The main issue is to stabilize the system around its
M and m stand for the cart mass and the pendulum unstable equilibrium point, under assumption that the
mass concentrated in the bob, L is the length of the pendulum is initially above the horizontal plane. The
pendulum. problem will be solved by means of Lyapunov's
method. Roughly speaking, the method consists of
To simplify the algebraic manipulation in the proposing a positive definite function (or Lyapunov
forthcoming developments, we normalize the above function), provided that its time derivative along the
equations by introducing the following scaling trajectories of the system is, at least, semi-definite 2 .
transformations , Finally, the asymptotic stability of the closed loop
system follows by applying LaSalle's invariance
theorem.
q = x L, u = f (mg), dτ = dt g L , δ = M m (2)
3.1 How to propose a candidate Lyapunov function:
This normalization leads to the simple system, Let ξ x be the following auxiliary variable defined as,
ξ x = q + k p sin θ where k p is a positive constant, and
cosθ &q& + θ&& − sin θ = 0
(3) naturally, ξ&x = q& + k pθ& cos θ .
(1 + δ )&q& + cos θθ&& − θ& 2 sin θ = u,
The idea is to form a positive function V provided that
where, with an abuse of notation “.” stands for
the time derivative along the trajectories of system (5)
differentiation with respect to the dimensionless can be expressed as
time τ . Then, a convenient partial feedback
V& = ξ&x (η( x ) + δ ( x )v )
linearization input is proposed as follow (see [10]),
(7)
(
u = cosθ sin θ − θ& 2 sin θ + v sin 2 θ + δ ) (4)
where η and δ are some functions, with the restriction
which produces the feedback equivalent system: that δ ( x ) ≠ 0 for all x ∈ D ⊂ R 4 3 . Now, in order to
built V we propose:
θ&& = sin θ − cos θv,
(5)
V (x) = ξ x + ξ&x + k lφ ( x )
ki 2 1 2
q&& = v (8)
2 2
Naturally, we may write the last differential
equations as: where k i and k l are positive constants and, φ is a
function selected such that
x& = f (x ) + g (x )v (6)
∂ ∂
φ (x ) f ( x ) = 0, φ ( x )g (x ) = ξ&x
( )
(9)
with x = θ ,θ&, q , q& ∈ R .
T 4 1
∂x ∂x

2
1 The very hard problem is how to find the Lyapunov
It can be easily seen that (5) define an under-actuated
function. Perhaps the most efficient technique used to built
system, because it has only one input v and two degrees
a Lyapunov's function is the propused by R. Sepulchre [15]
of freedom θ and q 3 The set D is stability region for the closed loop system,
which will be determined further on.
It turns out that φ ( x ) can be chosen as where θ s was defined previously. Indeed, it follows
since V is a non-increasing function see relation (15).
φ ( x ) = kp(1 − cos θ ) −
kp & 2 1 2
θ + q& (10) It is important to emphasize that, inequality (16)
2 2
defines a stability region for the closed loop system.
Moreover, it is easy to verify that the proposed V Since, for all initial conditions x 0 such that
is positive definite for all θ ∈ I s where the set is V ( x 0 ) < K s with θ 0 < π 2 , then V ( x(t )) < K s , with
θ (t ) < θ s . According to this fact, we can define a
defined as:

I s = {θ ∈ R : θ < θ s < π 2}, (11) compact set Ω as:

Ω = {x = (θ ,θ&, q , q& ), θ < π 2 : V ( x ) < K s }


and θ s = cos −1 (1 + kl ) kp .
The set Ω has the property that all solutions of the
Notice that the time derivative of V along the closed loop system (see equations (5) and (14)) that
trajectories of system (5) can be expressed as: start in Ω remain in Ω for ever. That is, Ω is an
invariant set for the closed loop system and it will be
( )
V& = ξ&x kiξ x + ξ&&x + kl v = ξ&x (η ( x ) + δ ( x )v ) (12) used to apply LaSalle's invariant Theorem [5].

where 3.3 Stability analysis


Due to the fact that V ( x ) is a positive definite function
(
η ( x ) = k iξ x + kp cosθ − θ& 2 sin θ ) (13)
for all, x ∈ Ω and V& ( x ) is a semi-definite function for
δ (θ ) = 1 + k l − k p cos 2 θ all x ∈ R 4 , we conclude stability of the equilibrium
point, in the sense of Lyapunov. To complete the
3.2 A nonlinear feedback control law: proof, it is necessary to use LaSalle's invariance
Let us consider the aforementioned Lyapunov theorem.
function V with its time derivative V& given in Define the set:
equations (8) and (12), respectively.

From equation (12), a convenient control law is {


S = x ∈ Ω : (q& + k pθ& cos θ ) = ξ& 2 = 0
2
} (18)
introduced as:
Now, we need to compute the largest invariant set M
ξ& + η( x ) in S 4 .
v=− x (14)
δ (θ )
Evidently, on the set S , we have that, ξ = ξ , ξ& = 0
which produces where ξ is a fixed constant. And from relations (12)
V& = −ξ&x
2
(15) and (14), it follows that the control law has been
chosen as:
Notice that the control law (14) has no singularities,
when angle θ ∈ I s . In order to avoid having (k iξ x + ξ& x + k l v ) = (η ( x ) + δ ( x )v ) = −ξ& (19)
δ (θ ) = 0 , it is sufficient that the initial conditions
and in the set S , it satisfie d
x 0 = (θ 0 ,θ&0 , q0 , q& 0 ) with θ 0 < π 2 belonging to
a neighbourhood of the origin such that ki ξ + kl v = 0 (20)

k ik p
V ( x0 ) < K s = sin θ s2 + kl k p (1 − cos θ s ) (16)
2 4
La Salle’s Theorem ensures that all solutions of the closed
loop system starting in S ⊂ Ω approach M as t →∝ ,
where is largest invariant set in S
Then, on the set S , input v is evidently constant in In the first experiment, we used the proposed controller
S and given by the quantity v = v . Now, from (14), when it was applied to the nonlinear model (5).
system (5), we have The design parameters were set as k p = 25 ,
k i = 0 .25 and k l = 1 , and the initial conditions were
θ&& = sin θ − cos θ v ; q&& = v (21)
set as θ 0 = 1.2[rad ] , θ&0 = 0.05[rad / sec] , q0 = 0
We analyze the two possible cases arising from the and q& 0 = 0 . Figure 2 shows the closed loop responses
above equations: to the proposed nonlinear control force.

Case a) If the constant v ≠ 0 then q& (t ) is not In the second experiment, we considered the
bounded on S , and this fact leads to a design parameters and the initial conditions as
contradiction. Hence, we must have that v = 0 . before, but introduced a dissipative force in the
Additionally, when v = 0 means that q& (t ) is unactuated direction, i.e., we added the damping
constant on S , thus q (t ) is not bounded on S , and − γθ& into the first differential equation of the
we also have a contradiction. model (5), with γ = 0.25 . Figure 3 shows the
robustness of the proposed nonlinear control when
Case b) If q = 0 then from (21), we get the damping is considered in the numerical
differential equation θ&& = sin θ . This means that simulations. Notice that it is not generally true that
the pendulum can be either at rest or oscillating in damping makes a feedback-stabilized equilibrium
S . Then, from definition of the variable ξ , it asymptotically stable. That is to say, if damping is
follows that θ = sin
−1
(ξ k p ) , and necessarily, included then the response of the closed loop
system tends to destabilize.
θ = 0 or θ = nπ . But, under the assumption that
the initial conditions belong to Ω , we conclude
that the variable θ must be zero. 5 Conclusions
We conclude from the above that, the largest A Lyapunov based controller for the stabilization of
invariant set M contained in the set S is the IPCS was presented, in the case of the set of initial
constituted by the single point x = 0 . According to conditions belongs to the above horizontal plane. The
LaSalle's theorem all the trajectories of the closed proposed feedback controller makes the closed loop
loop system asymptotically converge towards the system be locally asymptotically stable, around the
invariant set contained in S , which is the unstable equilibrium position x = 0 . The domain of
equilibrium point x = 0 . attraction of the closed loop system is almost the whole
upper half plane, and it can be estimated by inequality
We summarize our results in the following (16). The control strategy is based, in a first step, on
proposition. partial feedback linearization of the IPCS, followed, in
a second step, by Lyapunov's approach. The
Proposition 1 Consider the system (5) in the closed convergence analysis is carried out using LaSalle's
loop with the controller (14), with strictly positive invariance principle, which guarantees that the closed
constants k i , k l and k p under assumption that the loop system is locally asymptotically stable.

initial deviation of angle θ is in the upper half Finally, by means of computer simulations, the
plane. Then, the origin of the closed loop system is closed loop performances of the controlled system
locally asymptotically stable and the domain of
seems to be quite robust with respect to the
attraction is the region defined by the inequality
(16). presence of dissipative forces, as assessed from
the digital experiments. However, the proposed
controller has the inconvenience of having a very
4 Numerical Simulations slow time convergence.
To assess the performance of the proposed
nonlinear control, we have carried out some digital
computer simulations, using the SIMNONÔ
simulation package.
Acknowledgments [7] I. Fantoni, R. Lozano,. Non-linear Control for
This work was supported by CIC-IPN, and by Underactuated Mechanical System., Springer Verlag,
the Coordinación General de Posgrado e London , 2002.
Investigación (CGPI-IPN) under research [8] K. Furuta, M. Yamakita, S. Kobayashi,. Swing up
Grant 20040877. Also this paper is dedicated control of inverted pendulum using pseudo-state
feedback, Journal of System and Control Engineering,
in memory of Professor Leopoldo Arustegui
Vol. 206, 1992 , pp. 263-269.
(CBTIS 78) [9] K. J. Astrom and K. Furuta,. Nonlinear control of a
swinging pendulum, Automatica, Vol. 31(6),1995, pp.
851-862.
[10] M. V. Spong,. Energy Based Control of a class of
Underactuated Mechanical Systems, IFAC World
Congress,1996, San Francisco, CA.
[11] M. W. Spong, and L. Praly, Control of
Underactuated mechanical systems using switching
and saturation, Procc. of Block Island Workshop on
Fig. 2. Feedback controlled performance of the Control Using Logic Based Switching,1996. .
normalized system to the proposed non-linear [12] R. Lozano, I. Fantoni, and D. J. Block,
control. Stabilization on the inverted pendulum around its
homoclinic orbit, System \& Control Letters, Vol. (40)
3, 2000, pp.197-204.
[13] R. Olfati-Saber,. Fixed Point Controllers and
Stabilization of the Cart-Pole and Rotating Pendulum,
Proc. of the 38th Conf. on Decision and Control, Dec.
1999., pp.1174-1181, Phoenix, Az.
[14] R. Olfati-Saber, Nonlinear Control of
Underactuated Mechanical systems with Applications
to Robotic and Aerospace Vehicles, PhD thesis ,
Fig. 3. Closed loop responses of Lyapunov-based Department of electrical Engineering and Computer
controlled, when damping is included. Science of the Massachusetts Institute of Technology,
Cambridge, USA, 2001.
[15] R. Sepulchre, M. Jankovíc, and P. Kokotovíc ,.
References: Constructive Nonlinear Control, Springer-Verlag ,
London,1997.
[1] A. S. Shir iaev, A. L. Fradkov. Stabilization of
invariant sets of nonlinear systems with
applications to control of oscillations. Int. J. of
Robust and Nonlinear Control, Vol. 11, 2001,
pp.215-240
[2] B. Jakubczyk, W. Respondek,. On the
linearization of control systems, Bull. Acad. Polon.
Sci. Math., Vol. 28, 1980, pp.517-522.
[3] Bloch, A. M., N. E. Leonard, and J. E. Marsden,
Controlled lagrangians and the Stabilization of
Mechanical Systems I: The First matching theorem,
IEEE Trans.on Sytems and Control, Vol. 45, 2000,
pp. 2253-2270.
[4] C.C. Chung and J. Hauser, Swing up a
pendulum by energy control, Automatica, Vol.
36(2), 2000,pp. 287-295.
[5] H.K. Khalil,. Non-linear Systems. Prentice Hall
, 2nd. Edition, 1996.
[6] H. Kwakernaak, R. Sivan. Linear Optimal
Control Systems Wiley, New York , 1972.

View publication stats

You might also like