Dynamics and Control of A Chain Pendulum On A Cart: Taeyoung Lee, Melvin Leok, and N. Harris Mcclamroch
Dynamics and Control of A Chain Pendulum On A Cart: Taeyoung Lee, Melvin Leok, and N. Harris Mcclamroch
Dynamics and Control of A Chain Pendulum On A Cart: Taeyoung Lee, Melvin Leok, and N. Harris Mcclamroch
are vertical: qi = ±e3 for i = 1, . . . , n. The equilibrium for where sij = si sj for i, j = 1, . . . , n.
which all links are aligned with the gravity direction, qi = e3 Proof: See Appendix B.
for i = 1, . . . , n, is referred to as the hanging equilibrium; The local eigenstructure near each equilibrium can be
the equilibrium for which all links are aligned opposite to determined from the linearized dynamics. The eigenvalues
of (19) are the roots of det[λ2 M + G] = 0. Note that there 0.4 1
e3 · q 3
0
are zero eigenvalues since the first two columns and rows of
e1 · x
0.2
−1
G are zero. These correspond to the cart dynamics. 0 2 4 6 8 10
1
For the hanging equilibrium, given by si = 1 for all 0
e3 · q 4
0 2 4 6 8 10
0
i = 1, . . . , n, the matrix Gqq becomes positive-definite. 0.5
−1
0 2 4 6 8 10
This implies that λ2 ≤ 0 always. Then, the stability of the 0
e2 · x
1
e3 · q 5
nonlinear dynamics (16) is inconclusive from the linearized −0.5 0
−1 −1
equation (19) as Re[λ] = 0. But, it can be shown that the 0 2 4
t
6 8 10 0 2 4
t
6 8 10
T , Tq
0
uncontrolled system. For each of the other 2n −1 equilibrium 1
0.1
configurations, there exist a pair of positive and negative 0
0 2 4 6 8 10
e3
0.2
eigenvalues, which implies that it is an unstable saddle. Het- 1
V
a non-local characterization of the dynamic flow. 0.4 −1
−2
−0.3 −0.2 −0.1 0 0.1 0.2 0.3 0 2 4 6 8 10
e1 t
IV. C ONTROL A NALYSIS
(c) Location of m5 with respect to the (d) Kinetic energy T (Tq in (10):
Various control problems can be posed for the chain pen- cart (P5 li qi ) in the e1 e3 plane red,dotted) and potential energy V
i=1
dulum on a cart system. For example, feedback control might
be used to achieve asymptotic stabilization of any of the Fig. 2. Uncontrolled response: perturbation from a folded equilibrium
natural equilibrium solutions. From the linearized equation
(19), we find a criterion for controllability as follows.
Proposition 3: Consider an equilibrium of a chain pendu- such that the equilibrium of the controlled system is locally
lum on a cart, specified by s = (s1 , . . . , sn ) and x = 0. asymptotically stable.
Suppose that the inertia matrix M of the linearized equation Proof: See Appendix D.
(19) is positive-definite. Then, the equilibrium is controllable This control system can be used uniformly to stabilize any of
n
if and only if the following subsystem is controllable 2 equilibrium configurations of a chain pendulum on a cart.
But, as it is based on the linearized dynamics, the region of
Mqq ẍq + Gqq = Mxq u (20) attraction could be limited.
for a control input u ∈ R2 , or equivalently V. N UMERICAL E XAMPLES
2 In the subsequent numerical simulations, we consider a
rank[λ Mqq + Gqq , Mqx ] = 2n (21)
chain pendulum model with five identical links, i.e. n = 5.
for any λ ∈ C. This system has twelve degrees of freedom with two force
Proof: See Appendix C. control inputs on the cart. The properties of the cart and the
This proposition states that the controllability of (19) is links are chosen as
equivalent to the controllability of a reduced system given
by (20). It represents the dynamics of the chain pendulum, m = 0.5 kg, mi = 0.1 kg, li = 0.1 m for i = 1, . . . , 5.
without the cart, where the input matrix is given by Mqx
Throughout this section, the following units are used:
that corresponds to the inertia coupling between the chain
kg, m, sec and rad, unless otherwise specified.
dynamics and the cart dynamics.
First, simulation results for the uncontrolled chain pendu-
If the linearized equation about a specific equilibrium
lum on a cart system are presented. The initial condition is a
configuration is controllable, then we can design a control
small perturbation from one of the completely folded equi-
system to asymptotically stabilize that equilibrium.
libria, given by s = (−1, 1, −1, 1, −1). More specifically,
Proposition 4: Consider an equilibrium of a chain pen-
dulum on a cart, specified by s = (s1 , . . . , sn ) and x = x(0) = [0.2; 0.1], ẋ(0) = [0; −0.1],
0. Assume that the corresponding linearized equation is qi (0) = si e3 = (−1)i e3 for i = 1, . . . , 4,
controllable (as characterized by Proposition 3). The control (23)
force u is chosen as follows: q5 (0) = [sin 1◦ ; 0; − cos 1◦ ],
Xn ωi (0) = 03×1 for i = 1, . . . , 5,
u = −Kx x − Kẋ ẋ − {Kqi C T (si e3 × qi ) + Kωi C T ωi }, where the fifth link is perturbed by 1◦ from the equilibrium.
i=1
(22) The corresponding simulation results are shown at Figure
2. The given initial condition guarantees that the relative
2×2
for controller gains Kx , Kẋ , Kqi , Kωi ∈ R for i = motion of the links with respect to the cart always lies in
1, . . . , n. Then, there exist values of the controller gains the e1 e3 plane, which is depicted in Figure 2(c). Figure 2(d)
1 10 0.5 2
e1 · x
e1 · x
eq
1
eq
5 0
−1
−2 0 −0.5 0
0 2 4 6 8 10 0 2 4 6 8 10 0 2 4 6 8 10 0 2 4 6 8 10
0.4 150 0.5 30
0.2 100 0 20
e2 · x
e2 · x
eω
eω
0 50 −0.5 10
−0.2 0 −1 0
0 2 4 6 8 10 0 2 4 6 8 10 0 2 4 6 8 10 0 2 4 6 8 10
t t t t
(a) Cart position x (b) Direction error eq and angular ve- (a) Cart position x (b) Direction error eq and angular
locity error eω for links velocity error eω for links
20
20
0
u
0 −0.14
0
u
−0.12 −20
0.1 −20 0 2 4 6 8 10
−0.1
e3
0.2 40
e3
−40
0 2 4 6 8 10
−0.08
0.3 20
20
−0.06 0.05
0.4 0
−0.03
−0.02 0
0 −0.01 0 −20
−0.2 −0.05 e 1 0 2 4 6 8 10
0.2 e 2 0.01 t
−0.1
0 0 −20
e2 0.1 −0.2 e 1 0 2 4 6 8 10 (c) LocationPof m5 with respect (d) Control force u
t
to the cart ( 5i=1 li qi )
(c) Location of m P5 with re- (d) Control force u
spect to the cart ( 5i=1 li qi ) Fig. 4. Controlled response: asymptotic stabilization of a partially-folded
equilibrium s = {−1, −1, −1, 1, 1}
Fig. 3. Controlled response: asymptotic stabilization of the hanging
equilibrium s = {1, 1, 1, 1, 1}
ear quadratic regulator with the weighting matrices Q = where Dx L represents the derivative of L with respect to x.
diag[I2 , 8I2n , I2 , 8I2n ] and R = I2 . Figure 4 illustrates that From (14), the variation of qi is δqi = ξi × qi for ξi ∈ R3
with ξi · qi = 0. The variation of the Lagrangian with respect Substituting this into (24) and (26), and using the fact that
to qi is given by ω̇i · qi = 0, we obtain (16).
n n
X X B. Proof of Proposition 2
Dqi L · δqi = ma gli e3 · (ξi × qi ) = − ma gli ê3 qi · ξi ,
a=i a=i Consider the hanging equilibrium where s = (1, 1, . . . , 1),
where (3) has been used. The variation of q̇i is given by and x = 0. The variations from the hanging equilibrium are
δ q̇i = ξ˙i × qi + ξ× q̇i . x = δx, ẋ = δ ẋ, qi = exp(ξˆi )e3 , ωi = δωi ,
From this and (3), the variation of the Lagrangian with where δx, δ ẋ ∈ R2 , and ξi , δωi ∈ R3 with ξi · e3 = 0 and
respect to q̇i is given by δωi · e3 = 0. This yields the following infinitesimal variation
n
X δqi = ξi × e3 . From (1), δ q̇i is given by
Dq̇i L · δ q̇i = (Mi0 ẋ + Mij q̇j ) · (ξ˙i × q + ξi × q̇i ) δ q̇i = ξ˙i × e3 = δωi × e3 + 0 × (ξi × e3 ) = δωi × e3 .
j=1
n
X n
X Since both sides of the above equation is perpendicular to
= q̂i (Mi0 ẋ + Mij q̇j ) · ξ˙i + q̇ˆi (Mi0 ẋ + Mij q̇j ) · ξi . e3 , this is equivalent to e3 × (ξ˙i × e3 ) = e3 × (δωi × e3 ),
j=1 j=1 which yields
Using these expressions and integrating by parts, the
ξ˙ − (e3 · ξ)e
˙ 3 = δωi − (e3 · δωi )e3 .
variation of the action integral can be written as
Z tf Xn Since ξi · e3 = 0, we have ξ˙ · e3 = 0. As e3 · δωi = 0 from
δG = −{M00 ẍ + M0i q̈i } · δx the constraint, we obtain the linearized equation for (1):
t0 i=1
n
X Xn n
X ξ˙i = δωi . (27)
+ {−q̂i (Mi0 ẍ + Mij q̈j ) − ma gli ê3 qi } · ξi dt.
i=1 j=1 a=i
Substituting these into (16), and ignoring the higher order
terms, we obtain
According to the Lagrange-d’Alembert principle, the sum
of the variation of the action integral, and the integral of the M00 I2×2 −M01 ê3 C −M02 ê3 C · · · −M0n ê3 C
virtual work done by the control force on the cart, namely C T ê3 M10 M11 I2 M12 I2 ··· M1n I2
R tf T
uδx dt, is zero. This implies that the expression within C ê3 M20 M 21 2I M 22 2I · · · M2n I2
t0
the first pair of braces in the above equation is equal to .. .. .. ..
. . . .
−u, and the expression within the second pair of braces is C T ê3 Mn0 Mn1 I2 Mn2 I2 ··· Mnn I2
parallel to qi for any 1 ≤ i ≤ n, as ξi is perpendicular to qi .
δ ẍ
P u
Therefore, we obtain
C T ξ¨1 − na=1 ma gl1 ξ10
n T Pn
¨ 0
× C ξ2 = − a=2 ma gl2 ξ2 ,
X
M00 ẍ + M0i q̈i = u, (24) (28)
. ..
..
i=1 .
n n
−q̂i2 (Mi0 ẍ +
X
Mij q̈j ) +
X
ma gli q̂i2 e3 = 0. (25) C T ξ¨n −mn gln ξˆ0 n
j=1 a=i where we have used the fact that ê23 = diag[−1, −1, 0],
Equation (25) is rewritten to obtain an explicit expression C T ê23 C = −I2 and ê3 CC T = ê3 . This is the linearized
for q̈i . As qi · q̇i = 0, we have q̇i · q̇i + qi · q̈i = 0. Using this equation about the hanging equilibrium.
and (4), we have This analysis can be easily generalized to other equilibria,
where one or more links are aligned opposite to the gravity.
−q̂i2 q̈i = −(qi · q̈i )qi + (qi · qi )q̈i = (q̇i · q̇i )qi + q̈i .
Consider the equilibrium where only the i-th link is pointing
Substituting this into (25), upward, i.e. qi = e3 and qj = −e3 for all j 6= i. By
n
X following the same procedure, we obtain the same form of
Mii q̈i − q̂i2 (Mi0 ẍ + Mij q̈j ) the linearized equation as (28), where all of the terms related
j=1 to Mij , Mji and li for all j 6= i are multiplied by −1. This
j6=i
n
yields (19).
X
= −Mii kq̇i k2 qi − ma gli q̂i2 e3 . (26) C. Proof of Proposition 3
a=i
Suppose that M is invertible. It is well-known that the
These equations (24) and (26) are rewritten in a matrix form linearized system (19) is controllable, if and only if
to obtain (15).
These can also be rewritten in terms of the angular rank[λ2 M + G, B] = 2n + 2 (29)
velocities. Since q̇i = ωi × qi for the angular velocity ωi 2
for any generalized eigenvalue λ satisfying det[λ M+G] =
satisfying qi · ωi = 0, we have
0 (see [18], [19]). This is a generalization of the Popov-
q̈i = ω̇i × qi + ωi × (ωi × qi ) = −q̂i ω̇i − kωi k2 qi . Belevitch-Hautus (PBH) eigenvalue test to a second-order
system. While it is not explicitly stated in the above refer- where Kx = [Kx , Kqi , . . . , Kqn ] ∈ R2×2n+2 and Kẋ =
ences [18], [19], it is straightforward to find an equivalent [Kẋ , Kω1 , . . . , Kωn ] ∈ R2×2n+2 . Since (19) is controllable,
condition in terms of eigenvectors, which is similar to the we can choose the controller gains Kx , Kẋ such that the
PBH eigenvector test. equilibrium is asymptotically stable for the linearized equa-
We claim that (29) holds if and only if there is no general- tion (19). According to Theorem 4.7 in [20], the equilib-
ized left eigenvector that is orthogonal to B, i.e. for any non- rium becomes asymptotically stable for the nonlinear Euler-
zero eigenvector vi ∈ R2n+2 satisfying viT (λ2i M + G) = 0, Lagrange equation (16).
we have viT B 6= 01×2 . The proof is as follows:
(Sufficiency) Suppose that there is a generalized eigenvector
vi that is orthogonal to B. Left-multiplying (29) by vi yields R EFERENCES
[1] F. Furuta, “Control of pendulum: From super mechano-system to hu-
viT [λ2 M + G, B] = [viT (λ2 M + G), viT B], man adaptive mechatronics,” in Proceedings of 42nd IEEE Conference
on Decision and Control, Dec. 2003, pp. 1498–1507.
which becomes [01×2n+2 , 01×2 ] when λ = λi . Therefore, [2] S. Mori, H. Nisihara, and K. Furuta, “Control of unstable mechanical
the matrix given in (29) has linearly dependent rows, which systems: Control of pendulum,” International Journal of Control,
vol. 23, pp. 673–692, 1976.
implies that it is rank-deficient. [3] S. Bendersky and B. Sandler, “Investigation of spatial double pen-
(Necessity) If the matrix given in (29) is rank-deficient for dulum: an engineering approach,” Discrete Dynamics in Nature and
λi , there exists a vector vi satisfying Society, vol. 2006, pp. 1–12, 2006.
[4] J. Marsden, J. Scheurle, and J. Wendlandt, “Visualization of orbits and
viT [λ2i M + G, B] = [((λ2 M + G)vi )T , viT B] = [01×2n+4 ], pattern evocation for the double spherical pendulum,” ZAMP, vol. 44,
no. 1, pp. 17–43, 1993.
which implies that vi is a generalized eigenvector that is [5] R. Cushman and J. van der Meer, “The Hamiltonian Hopf bifurcation
in the Lagrange top,” in Géométrie Symplectique et Mécanique, ser.
orthogonal to B. Lecture Notes in Mathematics, C. Albert, Ed. Springer, 1990, vol.
Using this eigenvector test, we show that (21) implies (29). 1416, pp. 26–38.
More specifically, we show that if (29) is false, then (21) [6] N. Chaturvedi, T. Lee, M. Leok, and N. McClamroch, “Nonlinear
dynamics of the 3D pendulum,” Journal of Nonlinear Science, vol. 21,
is false. Suppose that there exists a generalized eigenvector no. 1, pp. 3–32, 2011.
vi = [vx ; vq ] that is orthogonal to B. Then, we have viT B = [7] T. Lee, M. Leok, and N. McClamroch, “Computational dynamics of a
vxT I2 + vqT 02n×2 = vxT = 01×2 from the definition of B in 3D elastic string pendulum attached to a rigid body and an inertially
fixed reel mechanism,” Nonlinear Dynamics, vol. 64, no. 1-2, pp. 97–
(19). As vi is the left eigenvector, we also have 115, 2011.
2 [8] A. Shirieav, A. Pogromsky, H. Ludvigsen, and O. Egeland, “On
λ2i Mxq
λ M
viT [λ2i M + G] = [0T2×1 , vqT ] 2i x global properties of passivity-based control of an inverted pendulum,”
λi Mqx λ2i Mqq + Gqq International Journal of Robust and Nonlinear Control, vol. 10, pp.
283–300, 2000.
= λi vq Mqx vqT (λ2i Mqq + Gqq )
2 T
[9] M. Spong, “Energy based control of a class of underactuated mechan-
ical systems,” in Proceedings of the IFAC World Congress, 1996, pp.
= 01×2 01×2n . (30)
431–435.
[10] A. Shiriaev, H. Ludvigsen, and O. Egeland, “Swinging up the spherical
When λi = 0, this yields vqT Gqq = 01×2n ⇒ vq = 02n×1 pendulum via stabilization of its first integrals,” Automatica, vol. 40,
as Gqq is invertible. This is not possible since it contradicts no. 1, pp. 73–85, January 2004.
the fact that vi = [02×1 ; vq ] 6= 02n+2×1 . Therefore, λi 6= 0. [11] K. Astrom and K. Furuta, “Swinging up a pendulum by energy
control,” Automatica, vol. 36, no. 2, pp. 287–295, February 2000.
Then, (30) implies [12] O. Gutiérrez F., C. Aguilar Ibéñez, and H. Sossa A., “Stabilization
of the inverted spherical pendulum via Lyapunov approach,” Asian
vqT (λ2i Mqq + Gqq ) = 01×2n , vqT Mqx = 01×2 , (31) Journal of Control, vol. 11, no. 6, pp. 587–594, 2009.
[13] A. Bloch, D. Chang, N. Leonard, and J. Marsden, “Controlled La-
which states that there exists a non-zero generalized left grangians and the stabilization of mechanical systems II: Potential
eigenvector of (20) that is orthogonal to Mqx . Therefore (21) shaping,” IEEE Transactions on Automatic Control, vol. 46, pp. 1556–
is false. 1571, 2001.
[14] J. Zhao and M. Spong, “Hybrid control for global stabilization of the
As a last step, we show (29) implies (21). If (21) is false, cart-pendulum system,” Automatica, vol. 37, no. 12, pp. 1941–1951,
there exists a non-zero eigenvector vq satisfying (31). Let 2001.
vi = [02×1 ; vq ]. Then, it is orthogonal to B as viT B = 01×2 . [15] T. Hoshino, H. Kawai, and K. Furuta, “Stabilization of the triple
spherical inverted pendulum-a simultaneous design approach,” Autom-
And vi is a generalized left eigenvector of (M, G) as it matisierungstechnik, vol. 48, pp. 577–587, 2000.
satisfies (30). In short, (21) is equivalent to (29). [16] K. Furuta, T. Ochiai, and N. Ono, “Attitude control of a triple inverted
pendulum,” International Journal of Control, vol. 39, pp. 1351–1365,
D. Proof of Proposition 4 1984.
[17] T. Lee, M. Leok, and N. H. McClamroch, “Lagrangian mechanics
Using (14), (27), the linearized control input is given by and variational integrators on two-spheres,” International Journal for
n Numerical Methods in Engineering, vol. 79, no. 9, pp. 1147–1174,
X 2009.
u = −Kx δx − Kẋ δ ẋ − {Kqi C T ξi + Kωi C T δωi }. [18] P. Hughes and R. Skelton, “Controllability and observability of linear
i=1 matrix-second-order systems,” ASME Journal of Applied Mechanics,
vol. 47, pp. 415–420, 1980.
From the definition of the state vector x = [19] A. Laub and W. Arnold, “Controllability and observabiilty criteria
[δx; C T ξ1 ; . . . ; C T ξn ] in (19), u can be written as for multivariable linear second-order models,” IEEE Transactions on
Automatic Control, vol. 29, no. 2, pp. 163–165, 1984.
u = −Kx x − Kẋ ẋ, [20] H. Khalil, Nonlinear Systems. Prentice Hall, 2002.