Modelling and Control of A Spherical Inverted Pendulum On A Five-Bar Mechanism
Modelling and Control of A Spherical Inverted Pendulum On A Five-Bar Mechanism
ARTICLE
1 Institute of Engineering and Technology, Universidad Autónoma de Ciudad Juárez, Ciudad Juárez, Chihuahua, Mexico
2 Division of Graduate Studies and Research, Instituto Tecnológico de la Laguna, Torreón, Coahuila, Mexico
*Corresponding author(s) E-mail: [email protected]
DOI: 10.5772/60027
Licensee InTech. This is an open access article distributed under the terms of the Creative Commons Attribution License (http://
creativecommons.org/licenses/by/3.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work
is properly cited.
The problem of balancing an inverted pendulum has The SIP has been studied by numerous researchers (see [7
attracted the attention of control researchers in recent - 11]). The interest in studying the SIP is due to its mathe‐
3. A robotic arm [8, 14]. Consider a CCM with m joints but with only n (n < m) dof;
In this document, it is considered that the motion of the base then, there should exist p = m − n holonomic constraints
of the SIP is controlled by means of a five-bar mechanism which allow the reduction of the order of the system from
(FBM), which is a well-known closed-chain mechanism. m to n ; in others words, if we choose n independent joint
Such a system has become common, due to the existence of variables there must exist p dependent joint variables.
a commercial prototype for academic and research purpos‐
es (see [15]). The complexity of the mathematical model and Let ρ = q T β T T ∈ ℝm be the vector of generalized joint
control of this system (SIP+FBM) is due in great measure to variables (q ∈ ℝn be the vector of independent variables and
the kinematic constraints imposed by the closed-loop of the β ∈ ℝ p be the vector of dependent, or constrained, varia‐
FBM. bles). The holonomic constraints can then be grouped in a
vector of the form
To the best of the authors' knowledge, the only work
dealing with the modelling and control of a similar SIP
+FBM mechanism is [12]. In that work, the authors consider g ( r ) = 0 Î ¡p
the system as a linear parameter variable (LPV) system with
structured additive perturbation. This paper uses a
so that, as a result, it should be possible to express β as a
different approach to obtain the complete non-reduced
function of q, , i.e.,
dynamics model of the same system.
(
x = f q, b ( q ) . ) such that the system of equations (3) allows us to extract,
by algebraic̣ manipulations, an explicit ordinary differen‐
In addition, by taking the time derivative of the previous tial system u = φ (u ) (which is called the 'underlying' ODE)
equation we get the so-called differential kinematics According to [16], if the differential index is 1 or 2, it is
equation usually possible to differentiate the constraint equation
with respect to time once (index 1) or twice (index 2) to
x& = J ( r ) q& (1) produce an equivalent ODE (a process sometimes called
index reduction) and to achieve satisfactory results using
∂ f (q, β (q )) standard numerical methods for ODEs. If the differential
where J (ρ ) = ∂q
. index is greater than 2, standard numerical methods
frequently fail to converge, and sometimes converge to
On the other hand, the inverse kinematics problem consists
incorrect solutions.
in establishing the value of the actuated joint coordinates
that correspond to a given pose of the element of interest, These DAEs resulting from the dynamical analysis of
and can be expressed as CCMs have a differential index of 3. Several methods have
been proposed in the literature in order to transform them
into a set of ODEs with fewer generalized coordinates so
q = f -1 ( x ) .
that they can be solved analytically or numerically.
The most important of such methods are [20]:
The inverse kinematics problem can be solved in general
form by geometric or analytic approaches, such as those 1. Direct elimination, where the surplus variables are
mentioned in [19]. eliminated directly, using the algebraic constraints
given by the kinematics, to explicitly reduce index-3
2.2 Dynamics model DAEs to ODEs in a minimal set of generalized coordi‐
nates (see [22]).
As mentioned in [20], the dynamics model of CCMs using
2. Explicit Lagrange-multiplier computation, using the
either the Newton-Euler or the Euler-Lagrange methodol‐
unknown accelerations computed from the index-1
ogy is traditionally obtained by cutting the closed loops to
DAEs formed by appending the acceleration con‐
obtain systems with open chains and/or tree-type struc‐
straints (computed by differentiating the original
tures, so that it is possible to write a set of ODEs for such
constraint) to the system equations (see [23] and [24]).
chains in their corresponding generalized coordinates. The
solution to these equations requires satisfying additional 3. Projection of the dynamics onto the tangent space of the
algebraic equations guaranteeing the closure of the cut- constraint manifold, where the constraint-reaction
open loops. To this end, some Lagrange multipliers (which dynamics equations are taken into the orthogonal and
physically represent the forces due to the constraints) are tangent subspaces of the vector space of the system
employed. The resulting formulation, often referred to as a generalized velocities. A family of choices exist for the
descriptor form, yields a system of DAEs which, in general, projection, as surveyed by [25] and [26].
cannot be solved employing conventional ODE techniques. The dynamics model of a mechanism of n dof, with m
The most general form of a differential-algebraic system of generalized variables (m > n ), and subject to p = m − n
n equations is that of an implicit differential equation [21] holonomic constraints, can be represented by means of the
following index-3 DAEs
é h1 ( u , u& , t ) ù
ê ú
ê h2 ( u , u& , t ) ú
T
d ì ¶L( r , r& ) ü ¶L( r , r& ) æ ¶g ( r ) ö
h ( u, u,t ) = ê
& ú = 0Ρ
n
(2) í ý- =tr + ç ÷ l (4)
M dt î ¶r& þ ¶r è ¶r ø
ê ú
ê hn ( u , u& , t ) ú
ë û
g ( r ) = 0, (5)
where u ∈ ℝn is the vector of generalized coordinates, t is
̣ du ̣
the time variable, and u = dt . where the Lagrangian L(ρ,ρ ) can be defined as
1 é ¶M kj ( r ) ¶M ki ( r ) ¶Mij ( r ) ù
cijk ( r ) = ê + - ú, (10)
2 êë ¶ri ¶rj ¶rk úû
The angles θ and ϕ indicate the orientation of the extreme where the notations S( ⋅ ) and C( ⋅ ) are used for sin( ⋅ ) y
of the pendulum with respect to the frame Σb ; θ is the angle cos( ⋅ ), respectively. Using a software tool such as MAT‐
that rotates with respect to the axis yb and ϕ is the angle that LAB, it is possible to find the following two solutions for xb
rotates with respect to the axis xb. and yb
The problem of direct kinematics is reduced to find the 3.1.2 Inverse kinematics model
coordinates of the intersection points of a circle of radius L
with C1 and C2 as centres, as shown in Figure 3(a), the From Figure 3 (a), the following expressions can be defined
equations of which are
xb = LC ( q1 ) + LC ( q1 + b1 ) (16)
(x - LC ( q1 ) ) + (y )
2
- LS ( q1 )
2
= L2 ,
yb = LS ( q1 ) + LS ( q1 + b1 )
b b
(17)
( x - ( 2 L + LC ( q ))) + ( y )
2
- LS ( q2 )
2
b 2 b
= L2 , xb = 2 L + LC ( q2 ) + LC ( q2 + b 2 ) (18)
and on the other hand, from Figure 3 (b) it is observed that and by taking i = 1,2 in (25), we find
̣ the matrix
̣ equation that
relates the operational velocities x b and y b with the actuated
̣ ̣
xb = rC (a ) and yb = rS (a ) (20) joint velocities q 1 and q 2
æ x2 + y 2 ö ( ) (
-S ( q1 ) q&1 - S ( q1 + b1 ) q&1 + b&1 = -S ( q2 ) q& 2 - S ( q2 + b 2 ) q& 2 + b&2 )
b1 = ±2cos ç b ÷.
( ) (
C ( q1 ) q&1 + C ( q1 + b1 ) q&1 + b&1 = C ( q2 ) q& 2 + C ( q2 + b 2 ) q& 2 + b&2 . )
-1 b
ç 2L ÷
è ø
which leads to
Following a similar procedure, but starting from equations
(18) and (19), we get
é b&1 ù é q&1 ù
(
ê & ú = Jb q, b ( q ) ) êq& ú (26)
æ ö ëb2 û ë 2û
( xb - 2 L )
2 2
æ yb ö -1 ç
+y ÷
b
q2 = tan -1 çç ÷÷ m cos ç ÷
è xb - 2 L ø ç 2L ÷ where
è ø
S(q1 − q2 − β2) S (β2)
− −1 −
S(q1 − q2 + β1 − β2) S(q1 − q2 + β1 − β2)
æ ö
( xb - 2 L )
2
+ yb2 ÷ J β (q,β (q )) = .
ç S(β1) S(q1 − q2 + β1)
b 2 = m2cos -1 ç ÷ − −1
ç 2L ÷ S (q1 − q2 + β1 − β2) S(q1 − q2 + β1 − β2)
è ø
Equation (26) establishes the relation between the actuated
3.1.3 Differential kinematics model and passive joint velocities of the FBM.
Taking the time derivative of (16)-(19) for i = 1,2, we obtain 3.2 Dynamics modelling
Ki =
1 1
m p& T p& + w T I w (28) éC ( q1 + b1 ) -S ( q1 + b1 ) 0 ù
2 i i i 2 i i i ê ú
0
b
R = ê S ( q1 + b1 ) C ( q1 + b1 ) 0 ú
ê ú
ë 0 0 1û
1 1
Kp = m p& T p& + w T I w (29)
2 p p p 2 p p p As the FBM is located in the XY plane, the angular velocities
for each link can be defined as
̣
where p i and ωi represent the linear and angular velocities
of the centre of mass of the link i , respectively, mi and I i are w1 = éë0 0 q&1 ùû
T
w 2 = éë0 0 q&1 + b&1 ùû
T
m44 = I pz + lcp2 mp
Moreover, in equation (28) we require the mass of each link
of the FBM as well as the matrix of inertia moments with m55 = m4lc42 + m3 L 2
+ lc32 + 2L lc3C (β2) + I 4 + I 3
respect to a coordinate frame that passes through the centre
m56 = m3 lc32 + L lc3C (β2) + I 3
of mass. Again, taking into consideration that the FBM
moves in the horizontal plane, only the inertia moments m66 = m3lc32 + I 3
along the z0 axis are of interest for the links, namely I 1,I 2,I 3
and I 4. For the SIP, the matrix of the inertia moments is Using expressions (10) and (11), we can compute
given by
é c11 c12 c13 c14 0 0 ù
ê ú
é I px 0 0ù êc21 c22 c23 c24 0 0 ú
ê ú êc c c33 c34 0 0 ú
C ( r , r& ) = ê 31 32
0 0
Ip = R ê 0
b
I px 0 ú 0b RT ú
ê ú êc41 c42 c43 c44 0 0 ú
êë 0 0 I pz úû ê0 0 0 0 c55 c56 ú
ê ú
êë 0 0 0 0 c65 c66 úû
It is possible to use software for symbolic computing to
obtain the matrices of the dynamics model (7). In order to
̣ where each element of the matrix is given by
obtain the matrix M (ρ ), the total kinetic energy K(ρ,ρ ) is ̣ ̣ ̣
calculated and (8) is used, yielding c11 = a1β 1 + a2ϕ + a3θ
̣ ̣ ̣ ̣
c12 = a1(q 1 + β 1) + a2ϕ + a3θ
é m11 m12 m13 m14 0 0 ù ̣ ̣ ̣ ̣
ê ú c13 = a2(q 1 + β 1) + a4ϕ + a5θ
ê m12 m22 m23 m24 0 0 ú ̣ ̣ ̣ ̣
êm m23 m33 m34 0 0 ú c14 = a3(q 1 + β 1) + a5ϕ + a6θ
M ( r ) = ê 13 ú
ê m14 m24 m43 m44 0 0 ú ̣ ̣ ̣
ê 0 c21 = − a1q 1 + a7ϕ + a8θ
0 0 0 m55 m56 ú
ê ú ̣ ̣
êë 0 0 0 0 m55 m66 úû c22 = a7ϕ + a8θ
̣ ̣ ̣ ̣
c23 = a7(q 1 + β 1) + a9ϕ + a10θ
where ̣ ̣ ̣ ̣
c24 = a8(q 1 + β 1) + a10ϕ + a11θ
m11 = I 1 + I 2 + I px + L 2m2 + 2L 2mp + lc12m1 + lc22m2 ̣ ̣ ̣
c31 = − a2q 1 − a7β 1 + a12θ
+ lcp2 mp − I px C (ϕ )2C (θ )2 + I pz C (ϕ )2C (θ )2 ̣ ̣ ̣
c32 = − a7(q 1 + β 1) + a12θ
+ 2L 2mp c (β1) − lcp2 C (ϕ )2C (θ )2 + 2L lc2m2C (β1) ̣
+ 4L lcp mp C (β1 / 2)2S (θ ) + 2L lcp mp S (β1)C (θ )S (ϕ ) c33 = a13θ
̣ ̣ ̣
c34 = a12(q 1 + β 1) + a13ϕ = − c43
m12 = I 2 + I px + L 2mp + lc22m2 + lcp2 mp + L 2mp C (β1)
̣ ̣ ̣
+ I pz C (ϕ )2C (θ )2 − I px C (ϕ )2C (θ )2 − lcp2 C (ϕ )2C (θ )2 c41 = − a3q 1 − a8β 1 − a12ϕ
̣ ̣ ̣
+ L lc2m2C (β1) + 2L lcp mp S (θ ) + L lcp mp C (β1)S (θ ) c42 = − a8(q 1 + β 1) − a12ϕ
+ L lcp mp S (β1)C (θ )S (ϕ )
c44 = 0
m13 = − C (ϕ )C (θ ) L lcp mp 1 + C (β1) ̣
c55 = − m3 L lc3S (β2)β 2
− C (ϕ )C (θ )(I px − I pz + lcp2 mp )S (θ ) ̣ ̣
c56 = − m3 L lc3S (β2)(q 2 + β 2)
m14 = lcp2 mp S (ϕ ) + 2L lcp mp S (ϕ )S (θ )C (β1 / 2)2 ̣
c65 = m3 L lc3S (β2)q 2
+ I px S (ϕ ) + L lcp mp S (β1)C (θ )
c66 = 0
Finally, for the vector of gravitational forces, the total The matrices of the reduced model of the system (7) are
potential energy (which only depends of the potential defined as
energy of the SIP) is obtained using
é mr 11 mr 12 mr 13 mr 14 ù
ê ú
U ( r ) = - mp g o
T
m mr 22 mr 23 mr 24 ú
p
M ( r ) = ê r 12
ê mr 13 mr 23 mr 33 mr 34 ú
ê ú
where go is a vector that indicates the gravitational accel‐ ëê mr 14 mr 24 mr 34 mr 44 ûú
hence
where the components of each one are given by
g ( r ) = - mglcp éë0 0 S (f ) C (q ) C (f ) S (q ) 0 0 ùû .
T
mr 11 = m66 J β221 + m22 J β211 + 2m12 J β11 + m11
mr 12 = m13 + J β11m23
The constraints of the system are given by
mr 13 = m14 + J β11m24
̣
cr 11 = c66 J β221 + J β21m66 J β21 + c11 + c21 J β11
̣
+ J β11(c12 + c22 J β11) + J β11(m12 + J β11m22) 4. Model validation via real-time control
é0 0ù
ê ú
ê0 0ú
ê0 0ú
ê ú
¶f ( z ,t ) ê 0 0ú
B= =ê
¶t b 0ú
z = z ,t =t
e e
ê 51 ú
ê 0 b62 ú
Figure 5. Photograph of the experimental prototype ê ú
ê b71 0 ú
êë 0 b82 úû
4.2 Controller design
Considering that the matrices Q and G of (34) are defined I px inertia moment of 0.0017 kgm2
by pendulum
4.3.2 Experiments
Computation of matrix R (ρ )
Consider a closed-chain mechanism which is described by ¶g ( r )
R ( r ) = 0 p´ n
means of the vector ρ ∈ ℝm of generalized coordinates, from ¶r
which we can extract the vector q ∈ ℝn of independent
coordinates using the function
¶a ( r )
R ( r ) = I n´ n
¶r
q = a (r )
g (q) = 0 é 0 p´ n ù
Y ( r ) R( r ) = ê ú
êë I n´n úû
be the vector of holonomic constraints of the system.
The matrix R (ρ ) ∈ ℝm×n , which allows the transformation of where
the system dynamics from an index-3 DAE to an index-1
DAE, as described in Section 2, can be computed using the é ¶g ( r ) ù
following expression ê ú
¶r ú
Y(r ) = ê Î ¡ m´ m
ê ¶a ( r ) ú
T
ê ú
æ ¶a ( r ) ö êë ¶r úû
R ( r ) = éë I m´ m - G ùû ç ÷ S (35)
è ¶r ø
and as Ψ(ρ ) is full-rank, then it is possible to also write
where
-1 é 0 p´ n ù
R( r ) = Y ( r ) ê ú
-1 êë I n´n úû
æ æ ¶a r ö
( ) ÷ é I - G ù æç ¶a ( r ) ö÷ ö÷ Î ¡n´n
T
S = çç ë m´ m û ç ¶r ÷ ÷
çç çè ¶r ÷ø è ø ÷ø
è which agrees with the definition of R (ρ ) found in [18].
-1
¶g ( r ) æ ¶g ( r ) ¶g ( r ) ö ¶g ( r )
T T
G= ç ÷ Î ¡ m´ m
¶r ç ¶r ¶r ÷ ¶r
è ø