Professional Documents
Culture Documents
Energy Shaping Inertia Wheel Pendulum
Energy Shaping Inertia Wheel Pendulum
Nonholonomic systems violate one of the necessary condi- The constraints have been adjoined to the system using
tions for asymptotic stabilization by smooth state feedback Lagrange multipliers λ ∈ Rk that represent the magnitude
formulated by Brockett [1983]. Thus, for the asymptotic of the constraint forces which oblige the system to satisfy
stabilization of a desired configuration q ∈ Q̃, a discontinu- the constraints. The work done by these forces vanishes as
ous or time-varying control law is required (Astolfi [1996]). can be seen by looking at the corresponding power
In this paper, to avoid this issue, instead of working in the Pconstr = q̇ T Aλ = λT AT q̇ = 0. (4)
WIPs six-dimensional configuration space Q̃, we restrict The approach, as explained in the following, is also used,
our analysis to the three dimensional space Q with local e. g., by Pathak et al. [2005] for the modeling of the WIP:
coordinates consisting of the path length, the pitch, and Due to the nonholonomic constraints (2), the admissible
the yawing angle: ξ = [s α θ]T ∈ Q. The pitch angle is phys-
velocities at q ∈ Q̃ must be of the form
ically restricted to −π/2 < α < π/2. We design a passivity-
based controller for the stabilization of an equilibrium q̇ = S(q)ν, (5)
ξ ∗ ∈ Q. The controller is thereafter parametrized apply- with a smooth full rank matrix S satisfying AT S = 0 for
ing local linear dynamics assignment (LLDA), a method all q ∈ Q̃, and local coordinates of the constrained tangent
used to fix design parameters in nonlinear passivity based space ν ∈ Dq . The admissible velocities at q lie in the
control by making use of the linearized model (Kotyczka subspace of Tq Q̃ spanned by the columns of S, which is
[2013]). Using this approach, prescribed local dynamics (in nothing but the (n−k)-dimensional space Dq . Now, replace
terms of the closed-loop eigenvalues) can be achieved.
q̇ = Sν and q̈ = S ν̇ + Ṡν in (3), and eliminate the
The passivity-based controller presented in this note can constraints by pre-multiplying it by S T
be systematically computed and leads to an asymptotically
stable equilibrium ξ ∗ ∈ Q with a large domain of attrac- S T M̃ S ν̇ + S T M̃ Ṡ + C̃S ν + S T ∇q V = S T τ̃ . (6)
tion. Since the closed-loop mechanical energy is used as The dynamical system represented by (6) can also be
Lyapunov function, the framework is remarkably intuitive written in the form
for it is physically motivated. Moreover, LLDA allows
ˆ
M̂ ν̇ + Ĉν + S T ∇q V = τ̂ + Jν, (7)
for transparency concerning parameter tuning. The ap-
plicability, performance, and robustness of the developed where M̂ = S T M̃ S, and τ̂ = S T τ̃ . Since the matrix
controller is shown with a series of simulations. Ĉ is solely defined by the Christoffel symbols of M̂ , the
Notation: For compactness of notation, the operator matching of the systems (6) and (7) requires, in general,
∇x f (x) is used to denote the transposed Jacobian of a additional gyroscopic forces Jˆν, where Jˆ = −JˆT , which
vector-valued function f (x). Additionally, we will use the are mistakently missing in Muralidharan et al. [2009] for
notation s(α) = sin α, and c(α) = cos α. When obvious imposing the constraints before taking variations in the
from the context, arguments are omitted for simplicity. derivation of the equations of motion (see Bloch [2003]).
In a mechanical system with nonholonomic constraints, Different modeling approaches for WIPs can be found,
the n-dimensional manifold Q̃ is the configuration space, e. g., in Pathak et al. [2005], Delgado et al. [2015], Nas-
its tangent bundle T Q̃ is the velocity phase space and a rallah et al. [2007]. The dynamic parameters needed for
smooth (nonintegrable) distribution D ⊂ T Q̃ represents the modeling of the WIP are listed below in Table 1
the constraints. The Lagrangian L is a map L : T Q̃ → R with the values used for the simulations. Figure 1 shows
and is defined as the kinetic energy minus the potential mB body mass 1 kg
energy L = T − V . A curve q(t) is said to satisfy the mW wheel mass 0.5 kg
constraints if q̇(t) ∈ Dq , for all q ∈ Q̃ and all times t. r wheel radius 0.05 m
For k nonholonomic constraints, the admissible velocities b distance from the wheel axis to
in a point q are thus restricted to a (n−k)-dimensional the body’s center of mass 0.08 m
d half of the wheel distance 0.05 m
subset (Dq ∼ = Rn−k ) of the tangent space Tq Q̃. The IB body’s moment of inertia
constraint distribution D is assumed to be regular, i. e., IBxx around x-axis 1e-5 kg m2
of constant rank. The widely used Lagrange-d’Alembert IByy around y-axis 9e-4 kg m2
equations (see, e. g., Bloch [2003]) IBzz around z-axis 4e-4 kg m2
d IW wheel’s moment of inertia
(∇q̇ L) − ∇q L = A(q)λ + Fext (1) IWyy around y-axis 1e-8 kg m2
dt IWzz around z-axis 1e-6 kg m2
describe the dynamics of systems subject to k nonholo- g gravity constant 10 m/s2
nomic (Pfaffian) constraints of the form
Table 1. System parameters
AT (q)q̇ = 0. (2)
Assuming there are no external forces other than the input
torques τ̃ , (1) results in a simple scheme of the wheeled inverted pendulum. Let
Q̃ = R2 × S1 × S1 × S1 × S1 be the configuration space and
M̃ (q)q̈ + C̃(q, q̇)q̇ + ∇q V (q) = τ̃ + A(q)λ, (3)
define local coordinates q = (x, y, θ, α, ϕl , ϕr ) ∈ Q̃. The
T
where M̃ = M̃ is the positive definite mass matrix, and coordinates ϕl and ϕr represent the absolute rotation of
the term C̃ q̇ represents the Coriolis and centripetal forces. the left and right wheel, respectively. The equations
94
IFAC LHMNC 2015
July 4-7, 2015. Lyon, France Sergio Delgado et al. / IFAC-PapersOnLine 48-13 (2015) 093–098 95
yaw angle
u1 = τr + τl
α
d
u2 = (τr − τl ), (11)
α mB , IB , b r
such that the new inputs u1 and u2 represent the resulting
z
r, mw , IW torque for the forward and the turning motion, respec-
body
tively. The input vector can then be written as
/r 0 � �
�1 �
wheels u1
x y τ̂ = Gu = −1 0 . (12)
θ u2
plane 0 1
2d In order to obtain a model of the WIP suitable for energy-
based control it is helpful to feedback linearize the yawing
Fig. 1. The wheeled inverted pendulum dynamics, for the terms involved in the computation get
simpler. Choose
− s(θ) c(θ) 0 0 0 0
� �
T
u1 = w1 ,
A q̇ = c(θ) s(θ) d 0 −r 0 q̇ = 0 (8)
c(θ) s(θ) −d 0 0 −r u2 = Iθ (α)w2 + 2c4 α̇θ̇ s(α) c(α) + c2 v θ̇ s(α)
represent the rolling-without-slipping constraints of the to get finally the simplified model
wheels. The velocities in a specific configuration q ∈ Q̃ M ν̇ + (C − J)ν + ∇ξ V = Gw, (13)
are thus restricted to used for controller design. Here, the corresponding matri-
c(θ) 0 0
ces and vectors are
c1 c2 c(α) 0 0
� � � �
s(θ) 0 0
v M = c2 c(α) c3 0 , ∇ξ V = −c2 g s(α) ,
0 0 1 α̇
q̇ = Sν = , (9) 0 0 1 0
0 1 0 θ̇
1/r 0 d/r
/r 0 0 −c2 α̇ s(α) −c2 θ̇ s(α)
�1 �
1/r 0 −d/r
G = −1 0 , C − J = 0 0 −c4 θ̇ s(α) c(α) .
where v is the forward velocity of the WIP. With this 0 1 0 0 0
matrix S, the equations of motion are of the form (7) with (14)
�
c1 c2 c(α) 0
� �
0
� Note that the yawing dynamics is not completely decou-
M̂ = c2 c(α) c3 0 T
, S ∇q V = −c2 g s(α) , pled, since a turning motion still affects the pitch and
0 0 Iθ (α) 0 forward motion.
3. ENERGY-BASED CONTROLLER DESIGN
/r(τr + τl ) 0 0 c2 θ̇ s(α)
�1 �
τ̂ = −τr − τl , Jˆ = 0 0 0 , (10)
d/r (τr − τl ) This section presents the methodology for the design of the
−c2 θ̇ s(α) 0 0
energy-based controller. Since the procedures IDA-PBC
where and Controlled Lagrangians are equivalent (see Blanken-
Iθ (α) = c4 s2 (α) + c5 , stein et al. [2002], Chang et al. [2002]), the following con-
and troller design can be done in both frameworks analogously.
IW We will put the focus on the Lagrangian case, for velocities
c1 = mB + 2mW + 2 2yy , c2 = mB b, are more intuitive than momenta.
r
c3 = mB b2 + IByy , c4 = IBxx + mB b2 − IBzz , As stated in the introduction, the objective is to design
IW d2 in a systematical way a controller which stabilizes an
c5 = IBzz + 2 yy2 + 2mW d2 + 2IWzz . admissible equilibrium ξ ∗ ∈ Q in the reduced space 2 . An
r
equilibrium is called admissible if G⊥ ∇ξ V |ξ∗ = 0, where
The n−k equations of motion (7) together with the recon-
struction equation (9) describe the motion of the WIP in V is the potential energy of the uncontrolled system. We
the space (q, ν). For a simpler analysis and control synthe- formulate the conditions for the desired closed-loop equi-
librium ξ ∗ to be (asymptotically) stable. The closed-loop
sis, define reduced local coordinates ξ = [s α θ]T ∈ Q ⊂ Q̃, system is parametrized using LLDA to achieve prescribed
such that 1 ξ˙ = ν. In the remaining of the paper we will local dynamics in terms of the closed-loop eigenvalues.
restrict the analysis to the configuration space Q. This is
possible, since S T ∇q V = ∇ξ V , for the potential forces act 3.1 Matching equations
directly on the admissible space D.
The goal of the Controlled Lagrangians procedure is to
2.2 Input and feedback transformation transform (13) by static state feedback w = w(ξ, ν) into a
Lagrangian closed-loop system. Let
1
The control inputs are the motor torques on the right and Lc (ξ, ν) = ν T Mc (ξ)ν − Vc (ξ) (15)
on the left wheel, τr and τl , respectively. These inputs 2
can, however, be transformed into more natural quantities 2 A given configuration q ∗ ∈ Q̃ in the original configuration space
for the control of the WIP. Apply the following input cannot be asymptotically stabilized using the energy-based controller
transformation since Brockett’s necessary condition for asymptotic stabilization is
not met, in which case only convergence to a (non-intuitive) invariant
1 The variable s defines the path length. set can be shown.
95
IFAC LHMNC 2015
96
July 4-7, 2015. Lyon, France Sergio Delgado et al. / IFAC-PapersOnLine 48-13 (2015) 093–098
be the desired closed-loop Lagrangian with mass matrix how to solve the three matching equations independently,
Mc (ξ) = McT (ξ) and potential energy Vc (ξ), and let us which is sufficient to satisfy (22).
consider the Euler-Lagrange equations of motion for the
target system with dissipation (and additional gyroscopic 3.2 Shaping the kinetic energy
forces 3 Chang et al. [2002])
d One can show that the upward equilibrium of the WIP
(∇ν Lc ) − ∇ξ Lc = (Jc − Rc )ν. (16)
dt cannot be stabilized simply by shaping the potential
The target system dynamics evolving on Q can be rewrit- energy, i. e., solving (23b) for an appropriate potential
ten as energy Vc (ξ) and keeping Mc = M . It is thus necessary to
Mc ν̇ + Cc ν + ∇ξ Vc = (Jc − Rc )ν, (17) also shape the kinetic energy by solving (23a) for a positive
or equivalently definite closed-loop matrix Mc �= M . The skew-symmetric
ν̇ = −Mc−1 Cc ν − Mc−1 ∇Vc + Mc−1 (Jc − Rc )ν, (18) matrix Jc is free, and thus, a further design parameter.
Assuming that Jc and Cc are linear in the velocities, and
where the matrix Jc = Jc (ξ, ν) (linear in ν) is skew that the kinetic shaping input is of the form
symmetric, and the closed-loop damping matrix Rc (ξ) is
symmetric. wke = F T (ξ, ν)ν, (25)
3×2
Proposition 1. The equilibrium (ξ ∗ , 0) of the system (17) with F (ξ, ν) ∈ R also linear in the velocities, more
is stable if Mc (ξ) > 0 in a neighborhood Ω of ξ ∗ , modest sufficient conditions for matching are obtained. We
Vc (ξ) has a strict minimum at ξ ∗ , and Rc ≥ 0 in Ω. require
−M Mc−1 (Cc − Jc ) + C − J − GF T ν = 0,
� �
The equilibrium is asymptotically stable if the system is (26)
pervasively damped.
or equivalently, since (26) has to be satisfied for all ν ∈ R3 :
Proof. Consider the closed-loop mechanical-type energy Jc = Cc + Mc M −1 (J − C + GF T ). (27)
as Lyapunov function
Recalling that Ṁc = CcT
+ Cc , the skew symmetry of (27),
1
Ec = ν T Mc ν + Vc . (19) Jc + JcT = 0, can be rewritten as
2
The time derivative of Ec along the trajectories of (17) is Mc M −1 (J −C +GF T )+(J −C +GF T )T M −1 Mc + Ṁc = 0.
(28)
Ėc = −ν T Rc ν, (20) The matrix F in (28) is the velocity feedback matrix in
where it has been used the fact that Ṁc = Cc + CcT . the kinetic energy shaping control law. To extract the
Stability of the equilibrium is shown for Rc ≥ 0. If the conditions that have to be satisfied independently from
damping is pervasive, the largest invariant set under the control, we pre-multiply (28) by G⊥ M Mc−1 and post-
closed-loop dynamics (17) contained in multiply it by Mc−1 M GT⊥ , where G⊥ = [r 1 0] is a full rank
� � left annihilator of G, i. e., G⊥ G = 0. Note that the matrix
(ξ, ν) ∈ Q×R3 | Ėc = 0 (21) equation (28) is symmetric, so is the projected equation
equals the equilibrium (ξ ∗ , 0). Asymptotic stability follows G (J − C)M̄ M + M M̄ (J − C)T GT = G M M̄˙ M GT .
� �
⊥ c c ⊥ ⊥ c ⊥
from La Salle’s invariance principle. An estimate of the (29)
domain of attraction is given by the largest bounded level
set of Ec in Ω. Thus, shaping the kinetic energy only requires the solution
M̄c of this differential equation for M̄c = Mc−1 . One
In order to formulate conditions, under which it is possible possible solution for (29) is
to match both, the system (13) and the desired Euler-
Lagrange system (17), first replace the target dynamics γk3 φ1 (α) + g
k1 − 0
(18) in the systems equations of motion (13) to get
γφ2 (α)
−1
2
Mc = − γk3 φ1 (α) + g k3 φ1 (α) , (30)
−M Mc−1 Cc ν − M Mc−1 ∇ξ Vc + M Mc−1 (Jc − Rc )ν 0
γφ2 (α) φ22 (α)
+ (C − J)ν + ∇ξ V = Gw. (22) 0 0 k2
We require to find an input w, which solves (22), for
the closed-loop system to take the desired form (17). with φ1 (α) = c1 r + c2 c(α), φ2 (α) = c3 + c2 r c(α), and
Splitting the equations in terms of the dependency on constant positive parameters k1 , k2 , k3 , and γ, which are
the velocities ν leads to the matching equations of the chosen such that Mc > 0 in −π/2 < α < π/2. The kinetic
potential (independent from ν) and kinetic (quadratic in energy shaping control (25) can be now derived by pre-
ν) energy, and of the dissipation, which consists of the multiplying (27) by GT M Mc−1
wke = (GT G)−1 GT M Mc−1 (Jc − Cc ) + (C − J) ν. (31)
� �
terms linear in ν. The resulting set of equations
−M Mc−1 (Cc − Jc )ν + (C − J)ν = Gwke , (23a) The matrices Cc and Jc can be easily calculated from
−1
−M Mc ∇ξ Vc + ∇ξ V = Gwpe , (23b) the matrix Mc , and premultiplying (27) by G⊥ M Mc−1 ,
−1 respectively. The matrix Jc takes the form
−M Mc Rc ν = Gwdi , (23c)
0 −f2 v − f3 α̇ 0
determines the components of the control law
Jc = f2 v + f3 α̇ 0 −f1 θ̇ (32)
w = wke + wpe + wdi (24)
0 f1 θ̇ 0
related to the shaping of the kinetic and potential energy,
and to damping injection. In the following we demonstrate for some functions 4 fi (ξ).
3 The matrix Jc serves as additional design parameter. 4 The explicit form of the functions fi (ξ) is omitted for brevity.
96
IFAC LHMNC 2015
July 4-7, 2015. Lyon, France Sergio Delgado et al. / IFAC-PapersOnLine 48-13 (2015) 093–098 97
3.3 Shaping the potential energy to (29). The control law (24) composed of the parts cor-
responding to the potential and kinetic energy shaping,
With the new mass matrix of the closed-loop system Mc , and the damping injection, renders (13) the closed-loop
we can proceed to shape the potential energy by solving Lagrangian system (17). Stability of the desired equilib-
(23b). The corresponding projected matching equation is rium (ξ ∗ , 0) follows from Proposition 1, since Mc (ξ) > 0,
ξ ∗ = arg minVc , and Rc ≥ 0. Asymptotic stability can be
G⊥ (∇ξ V − M Mc−1 ∇ξ Vc ) = 0, (33)
shown invoking La Salle’s invariance principle.
which represents a set of linear first order PDEs and can be
easily solved using a computer algebra system. The closed- 3.5 Some remarks on the parameter choice
loop potential energy takes the form
Vc (ξ) = γ ln(φ1 (α))(r2 c1 − c3 ) − rc2 c(α)
Since the yawing dynamics of the closed-loop system (17)
+ Π1 (Φ(s, α)) + Π2 (θ), (34) is fully actuated, it can be parametrized independently and
arbitrarily. Choose, e. g., the function
where Π1 (Φ(s, α)) is a free function of the homogeneous
solution 1
Π2 (θ) = kp (θ − θ∗ )2 , kp > 0. (40)
γ 2
Φ(s, α) = s − rα + (k1 − k3 )(c3 α + c2 r s(α))
g The resulting closed-loop yawing dynamics are of the form
c 3 − c1 r 2
(c2 − c1 r)(1− c(α)) k2 θ̈ = −kp (θ − θ∗ ) − kd,2 θ̇ + f1 (ξ)θ̇ α̇, (41)
+ 2 2 arctan ,
where the term quadratic in the velocities arises from
c1 r2 − c22 c21 r2 − c22 s(α)
(35) (32). The closed-loop yawing dynamics (41) can be
parametrized similar to a PD-controller by the choice of
and Π2 (θ) is a free function of θ. Both, Π1 and Π2 , need k2 , kp , and kd,2 to achieve desired local behavior. For
to be chosen such that Vc (ξ) has an isolated minimum at the parametrization of the remaining dynamics we apply
ξ = ξ ∗ . The potential energy shaping control is LLDA: The 4 free parameters k1 , k3 , γ, and kd,1 , and the
wpe = (GT G)−1 GT (∇ξ V − M Mc−1 ∇ξ Vc ). (36) free function Π1 (s, α) are chosen such that the linearized
closed-loop system has desired eigenvalues at the equilib-
3.4 Damping injection and control law rium (ξ ∗ , 0). The procedure results in an asymptotically
stable closed-loop system with desired local dynamics and
a large domain of attraction.
To achieve asymptotic stability of the equilibrium (ξ, ν) =
(ξ ∗ , 0), it is necessary to add (pervasive) damping accord-
ing to Proposition 1, for which we need the solution of 3.6 Robustness
(23c) for a dissipation matrix Rc ≥ 0, such that any
possible system motions elicit energy dissipation. First, In order to check the robustness of the controller, let us
define Rc = Mc M −1 R̆M −1 Mc , such that (23c) becomes consider the plant
(M + ∆M )ν̇ + (C − J + ∆C − ∆J)ν + ∇ξ (V + ∆V ) = Gw,
−R̆M −1 Mc ν = Gwdi . (37) (42)
T where the model uncertainties are denoted by ∆. Using
Choose the damping matrix as R̆ = GKdi G , for Kdi =
diag(kd,1 , kd,2 ) > 0. We add damping by choosing the controller (24) results in a closed-loop system
wdi = −Kdi GT M −1 Mc ν. (38) (Mc +∆M )ν̇+(Cc −Jc +∆C−∆J)ν+∇ξ (Vc +∆V ) = −Rc ν.
(43)
Proposition 2. Consider the equations of motion (13). Since the real system is of mechanical nature, the matrix
Assume there is a matrix Mc (ξ) > 0 and a scalar function ˙ ) = ∆C + ∆C T holds.
Vc (ξ) which verify (29) and (33), where the function Vc is ∆J is skew symmetric, and (∆M
such that ξ ∗ = arg min Vc . Then, the closed-loop system According to Proposition 1, the closed-loop system has an
(13) with input w according to (24), with (31), (36), and (asymptotically) stable equilibrium (ξ ∗ , 0) if Mc +∆M > 0
(38), has an (asymptotically) stable equilibrium (ξ, ν) = and Vc + ∆V has a strict minimum at ξ ∗ .
(ξ ∗ , 0) for Kdi > 0.
4. SIMULATIONS
Proof. The solution of (23) is sufficient to meet the
requirement for matching (22). Since G is not an invertible The yawing dynamics has been parametrized by the choice
matrix, the equations (23) cannot be trivially solved. Pre- of k2 , kp , and kd,2 , such that, locally, it has closed-loop
multiplying (23) by the full rank matrix eigenvalues {−1, −6.2}. The remaining parameters k1 , k3 ,
G⊥
γ, and kd,1 , and the function
(39) 1
GT Π1 (Φ(s, α)) = µ (Φ(s − s∗ , α))
2
97
IFAC LHMNC 2015
98
July 4-7, 2015. Lyon, France Sergio Delgado et al. / IFAC-PapersOnLine 48-13 (2015) 093–098
0.116
0. 7
11 · 1 −
Bloch, A.M. (2003). Nonholonomic mechanics and control.
6 0 2 Springer.
−1 −2
10 Brockett, R.W. (1983). Asymptotic stability and feedback
7·
−π/2 0.116 stabilization. In Differential Geometric Control Theory.
−3 −2 −1 0 1 2 3
Chan, R.P.M., Stol, K.A., and Halkyard, C.R. (2013).
s in m Review of modelling and control of two-wheeled robots.
Fig. 2. Level sets of Ec for θ = 0, ν = 0. Annual Reviews in Control, 37(1), 89–103.
Chang, D.E., Bloch, A.M., Leonard, N.E., Marsden, J.E.,
θ̇0 = 0, and for s∗ = 1 m. For the disturbed model we and Woolsey, C.A. (2002). The equivalence of controlled
have chosen matrices M̂ and Ĉ in (10) to be 1.5 times the lagrangian and controlled hamiltonian systems. ESAIM:
nominal value. The simulation results are shown below in Control, Opt. and Calculus of Variations, 8, 393–422.
Figure 3 and Figure 4. Delgado, S., Gajbhiye, S., and Banavar, R.N. (2015).
Reduced equations of motion for a wheeled inverted
Position in plane Path length pendulum. In Proc. of the 8th Vienna Int. Conf. on
1.5 Mathematical Modelling, 328–333.
Grasser, F., D’Arrigo, A., Colombi, S., and Rufer, A.C.
1 1 (2002). Joe: a mobile, inverted pendulum. IEEE Trans.
y in m
s in m
θ in rad
98