Sunteți pe pagina 1din 8

Journal of ELECTRICAL ENGINEERING, VOL. 64, NO.

1, 2013, 12–19

MODELLING OF CLASSICAL AND ROTARY INVERTED


PENDULUM SYSTEMS – A GENERALIZED APPROACH

Slávka Jadlovská – Ján Sarnovský

The purpose of this paper is to present the design and program implementation of a general procedure which yields
the mathematical model for a classical or rotary inverted pendulum system with an arbitrary number of pendulum links.
Lagrange equations of the second kind with an integrated Rayleigh dissipation function are employed in model design, and
the energetic balance relations, derived for the base and all pendulum links in a generalized (n-link) classical and rotary
inverted pendulum system, are implemented in form of symbolic MATLAB functions and a MATLAB GUI application.
The validity and accuracy of motion equations generated by the application are demonstrated by evaluating the open-loop
responses of simulation models of classical double and rotary single inverted pendulum.
K e y w o r d s: inverted pendulum systems, automated mathematical modelling, Lagrange mechanics, symbolic MATLAB
functions, classical double inverted pendulum, rotary single inverted pendulum

1 INTRODUCTION proached as an instance of a generalized system of in-


verted pendula (ie a system with n pendulum links), the
Inverted pendulum systems represent a significant
respective steps of mathematical model derivation can be
class of nonlinear underactuated mechanical systems
processed into an algorithm and implemented via sym-
which exhibit numerous problems present in industrial
applications, such as a variety of external disturbances bolic software tools. The final result of this technique is
or nonlinear behaviors under different operation condi- a systematic means for generating the equations of mo-
tions [1], and have therefore assumed a prominent po- tion, which provides a number of advantages over man-
sition among the test-bed systems for verification and ual mathematical modelling we obtain a particularly pre-
practice of ideas emerging in control theory and robotics. cise approximation of the real system’s dynamics and any
Stabilization of a pendulum rod in the unstable upright factual or numeric errors which could arise during man-
position is considered a benchmark control problem which ual modelling are eliminated. Moreover, generalizations
has been solved by attaching the pendulum to a base that of this kind can be further extended to control algorithm
moves in a controlled linear manner (classical inverted design, and applied in real-time control of laboratory sys-
pendulum systems) or in a rotary manner in a horizontal tems.
plane (rotary inverted pendulum systems) [2–4]. The goal of this paper is to enable automatic model
In order to understand, predict, simulate, or control generation for inverted pendulum systems by designing a
a physical system, a mathematical model of the system general procedure which determines the motion equations
is generally required, usually in form of differential equa- for a system with an arbitrary number of pendula. The
tions of motion [5]. It is only through complex mathe- paper is organized as follows. Section 2 presents the re-
matical and physical analysis that we can obtain motion spective steps of mathematical model derivation for gen-
equations which model the real system dynamics with eralized classical and rotary inverted pendulum systems,
sufficient accuracy [6]. For various examples of inverted which form the core of the general procedure. Section 3
pendulum systems, this analysis has been done ever since provides details of the program implementation of the
the system was introduced to feedback control commu- procedure and proceeds to demonstrate its validity and
nity and the derived equations of motion are included accuracy using two example systems: classical double and
in corresponding sources. Systems with a different num- rotary single inverted pendulum. In both cases, the sim-
ber of pendulum links are standardly treated as indepen- ulation setup is built out of suitable function blocks from
dent units (eg [7] provides the motion equations for a sin- the Inverted Pendula Modeling and Control (IPMaC), a
gle, double and triple pendulum system, derived indepen- structured Simulink block library which was developed
dently of each other), which only permits the laborious by the authors of this paper and provides complex soft-
and error-prone manual model derivation ware support for the analysis and control of classical and
For our research, we decided to focus on the obvious rotary inverted pendulum systems [2]. Finally, Section 4
mutual analogy of the systems, which led to an impor- concludes the paper with an evaluation of achieved results
tant consequence: if a system of inverted pendula is ap- and some final remarks.

∗ Department of Cybernetics and Artificial Intelligence, Faculty of Electrical Engineering and Informatics, Technical University of
Košice, Letná 9, 042 00 Košice, Slovakia, slavka.jadlovska@tuke.sk, jan.sarnovsky@tuke.sk

DOI: 10.2478/jee-2013-0002, c 2013 FEI STU


ISSN 1335-3632
Journal of ELECTRICAL ENGINEERING 64, NO. 1, 2013 13

2 MATHEMATICAL MODELLING where the Lagrange function (Lagrangian) L(t) is defined


OF GENERALIZED INVERTED as the difference between the kinetic EK and potential
PENDULUM SYSTEMS energy EP of the system
In this section, we will analyze the generalized (n-link) ˙ −Ep θ(t),
L(t) = EK θ(t), θ(t) (4)
classical and rotary inverted pendulum system using the the Rayleigh (dissipation) function D(t) describes the
Lagrangian formulation of mechanics [5]. This approach viscous friction (dissipative properties)
was chosen for several reasons: it is by definition suitable 
for generalizations, provides a more direct and less error- D(t) = D θ̇(t) , (5)
prone model design than eg force summation based on and Q∗ (t) is the vector of generalized external inputs
Newtons 2nd law; and the implementation of the method applied on the system.
is straightforward with aid of symbolic software tools [8]. Only the dynamical behavior of the base is directly
affected by the external input. The vector of generalized
2.1 Basic Preliminaries, Main Concepts and non-conservative external inputs is therefore defined as
Definitions ⊤
Q∗ = ( X(t) 0 . . . 0 ) (6)
Let us define the generalized system of classical in- where X(t) represents either the force F (t) applied on
verted pendula as a set of n ≥ 1 rigid, homogenous, the cart, or the torque M (t) applied on the rotary arm.
isothropic rods (pendulum rods or links) which are inter-
To be able to determine L(t) and D(t), the total
connected in joints and attached to a stable mechanism
energy of a multi-body system must be specified as the
which allows for movement alongside a single axis (often
sum of energies that correspond to the individual bodies
referred to as a cart, moving carriage or wagon). Analog-
it contains. Any system of n inverted pendula is therefore
ically, the generalized system of rotary inverted pendula
characterized by relations
is composed of n ≥ 1 interconnected homogenous rods n n
mounted on a rigid arm which rotates in a horizontal
X X
n
Ek (t) = Eki (t) , n Ep (t) = Epi (t) ,
plane, perpendicular to the pendula [2]. In both cases, i=0 i=0
the system is underactuated because the number of actu- n
(7)
X
ators is lower than the number of system links: the only n
D(t) = Di (t)
input (the force F (t) acting upon the cart or the torque i=0
M (t) applied on the rotary arm) is used to control the where EKi (t), EP i (t) and Di (t) respectively stand for
n + 1 outputs of the system: cart position (in meters) or the kinetic and potential energies, and the dissipative
arm angle (in radians) and pendula angles (in radians) properties of each body. The process of derivation of mo-
[3, 4]. tion equations that describe a selected system of inverted
Every system of n inverted pendula is a multi-body pendula has thus transformed into the determination of
composed of the base and the individual pendula, and kinetic, potential and dissipation energies which relate to
thus has n + 1 degrees of freedom. Any possible config- the base and all pendulum links and need to be expressed
uration of such a system can be uniquely defined by the through the generalized coordinates.
following vector of generalized coordinates In the following sections, we will derive the required
θ(t) = ( θ0 θ1 . . . θn )⊤ (1) physical relations and formulae that describe the ener-
getic balances of the base and i -th pendulum in a sys-
where θ0 (t) represents the position of the base (cart po- tem of n inverted pendula. Both classical and rotary in-
sition for the system of classical inverted pendula, or arm verted pendulum systems will be dealt with. Indexing of
angle for the system of rotary inverted pendula) and θ1 (t) all model parameters will obey the convention set by (1),
to θn (t) stand for the angles of pendulum links. where index 0 is assigned to the base and 1 to n rep-
According to the principle of virtual work , which was resent the individual pendulum links, starting with the
developed by Lagrange in 1788 and allows the transition link which is attached directly to the base. The nomen-
from Newtonian to Lagrangian mechanics, a mechanical clature of numerical model parameters will therefore be
system is balanced if and only if the net virtual work as follows
δW (t) due to all generalized forces is zero [5] sxi (t), syi (t), szi (t) – position (displacement) coordinates,
δW (t) = Q⊤ (t)δθ(t) = 0 . (2) vxi (t), vyi (t), vzi (t) – velocities in the directions of the
axes,
where Q(t) is a vector of generalized forces and δθ(t) is mi (kg) – mass of the base (i = 0) and the pendula (i = 1
a vector of virtual displacements along the corresponding to i = n),
generalized coordinates. li (m) – length of the arm (i = 0) or the i -th pendulum
From the principle of virtual work, Euler-Lagrange (i = 1 to i = n),
equations of second kind can be determined, one for each
g (ms−2 ) – acceleration due to gravity (g = 9.81 ms−2
generalized coordinate (ie degree of freedom of the sys-
will be used),
tem). The condensed vector form of the equations is [8]
δi (kgs−1 )/(kgm2 s−1 ) – friction coefficient of the base
d  ∂L(t)  ∂L(t) ∂D(t) against the surface (i = 0)/damping constant related
− + = Q∗ (t) (3)
dt ∂ θ̇(t) ∂θ(t) ∂ θ̇(t) to the pivot point of i -th pendulum (i = 1 to i = n).
14 S. Jadlovská – J. Sarnovský: MODELLING OF CLASSICAL AND ROTARY INVERTED . . .

2.2 Generalized System Of Classical Inverted Energetic balance of the i -t h


Pendula pendulum
The definition of a generalized classical inverted pen- Let us suppose that the whole mass of a pendulum
dulum system will now be expanded. Throughout the rod is concentrated in its center of gravity (CoG) which
derivation process, let us assume that (Fig. 1): is identical to the geometrical center of the rod in the
distance of li /2 from the pivot point. The coordinates of
the CoG of i -th pendulum rod are therefore expressed as
y (Fig. 1)
l n qn
Jn Pi !
  li
sxi (t) θ0 (t) + k=1 lk sin θk (t) − 2 sin θi (t)
=
syi (t)
Pi li
k=1 lk cos θk (t) − cos θi (t)
mng
2
q2 (11)
J2 and the velocity components in the directions of the axes
l2 equal
l1 q1 m2g
q0 J1
   
vxi (t) d sxi (t)
= =
m0 vyi (t) dt syi (t)
F !
Pn
m1g θ̇0 (t) + k=1 lk θ̇k (t) cos θk (t) − l2i θ̇i (t) cos θi (t)
.
− ik=1 lk θ̇k (t) sin θk (t) + l2i θ̇i (t) sin θi (t)
P
x (12)

Fig. 1. System of n classical inverted pendula - scheme and basic The potential energy of the i -th pendulum is determined
nomenclature
by the height of its CoG above the x-axis

(1) the modelling takes place in a planary (two-dimen- i


X li 
sional) coordinate system, ie all motion is bound to EP i (t) = mi gsyi (t) = mi g lk cos θk (t) − cos θi (t)
2
the xy -plane with the cart moving along a line iden- k=1

tical to the x-axis, which simultaneously represents (13)


the projection of the zero potential energy level into and the kinetic energy of each pendulum is given as a
the xy -plane; sum of two components that describe the pendulum’s
translational and rotary motion, [9]
(2) the value of every pendulum angle is determined
clockwise from the vertical upright position, which
is parallel to the y -axis; 1 1
EKi (t) = mi vi2 (t) + JT i θ̇i2 (t) (14)
(3) the only input of the system is the force applied on 2 2
the cart in the direction parallel to the x-axis and to
the cart itself. where Jn = mi L2i /12 represents the pendulum’s moment
of inertia with respect to the CoG and
Energetic balance of the cart q
vi (t) = 2 (t) + v 2 (t)
vxi (15)
yi
Since the cart is assumed to be moving in a linear
manner, we can provide its mathematical description us-
ing a single spatial dimension. If we identify it with the is the magnitude of the pendulum’s translational velocity.
x-axis, the only position coordinate will be denoted as The dissipative properties of the i -th pendulum are
sx0 (t) = θ0 (t), which means (see assumptions) that the quadratically dependent on the angular velocities of pen-
potential energy of the cart dulum links marked as i and i − 1

EP 0 (t) = 0 . (8) 1 2
Di (t) = δi θ̇i (t) − θ̇i−1 (t) (16)
2
The kinetic energy and the dissipation function both de-
pend on the cart velocity vx0 (t) = θ̇0 (t)
and
1 2 1
EK0 (t) = m0 vx0 (t) = m0 θ̇02 (t) , (9) 1 2
2 2 Di (t) = δi θ̇ (t) (17)
1 1 2 i
D0 (t) = δ0 vx0 (t) = δ0 θ̇02 (t) .
2
(10)
2 2
for n = 1 (single inverted pendulum system).
Journal of ELECTRICAL ENGINEERING 64, NO. 1, 2013 15

qn and the velocities in the directions of the axes respectively


equal
mng ln   ˙  cos θ (t) 
Jn z vx0 (t) l0 θ(t) 0 0
= (20)
vy0 (t) 2 − sin θ0 (t)

q2 The kinetic energy of the arm consists of a translational


and a rotary component
l2
1 1
m2g EK0 (t) = m0 v02 (t) + JT 0 θ̇02 (t) (21)
J2 2 2
m1g q1 where JT 0 = m0 l02 /12 is the arm’s moment of inertia
J1 l1 with respect to the center of gravity, and the arm’s trans-
y lational velocity has the magnitude of
J0 q0
l0
q
2 (t) + v 2 (t) .
v0 (t) = vx0 (22)
m0g y0
M
Inserting (20) into (22) and then into (21) yields
1
x EK0 (t) = J0 θ̇02 (t) (23)
2
where J0 = m0 l02 /3 is the moment of inertia with respect
to the rotary axis.
Fig. 2. System of n rotary inverted pendula - scheme and basic Finally, the dissipative properties of the arm are given
nomenclature
as
1
D0 (t) = δ0 θ̇02 (t) . (24)
2
2.3 Generalized System of Rotary Inverted Pen-
Energetic balance of i -t h p e n d u l u m
dula
To expand the definition of the generalized rotary in- Assuming that every pendulum rotates in a vertical
verted pendulum system (Fig. 2), the following was as- plane, the coordinates of the CoG for the i -th pendulum
sumed: are
 
(1) all modelling is bound to a standard right-handed sxi (t)
three-dimensional (Cartesian) coordinate system; the  syi (t)  =
arm rotates in a horizontal (parallel to xy ) plane szi (t)
which is identical to the zero potential energy level;
  i  
P li
(2) the rotary motion of each pendulum takes place in  l0 sin θ0 (t) + lk sin θk (t) − 2 sin θi (t) cos θ0 (t) 
 k=1 
a vertical plane that is always perpendicular to both  i
 
P li
 l0 cos θ0 (t) − lk sin θk (t) − 2 sin θi (t) sin θ0 (t) 
 
the horizontal arm plane and the arm itself; both the k=1
(25)
 
upright and downward (hanging) position are parallel

i
li
 P 
lk cos θk (t) − 2 cos θi (t)
with the z -axis and the value of every pendulum an- k=1
gle is determined clockwise from the upright position;
and the velocity components of the pendulum CoG in
(3) the input which actuates the system is the torque the directions of the x, y and z axes become
applied on the rotary arm.    
The balance relations for rotary inverted pendulum vxi (t) sxi (t)
 vyi (t)  = d  syi (t)  =
systems are analogical in many aspects with the relations dt
vzi (t) szi (t)
(8–17), derived in the previous section for classical in-  
verted pendulum systems. Pi
 l 0 θ̇ 0 (t) cos θ 0 (t) + l k θ̇ k (t) cos θ k (t) cos θ 0 (t) 
 k=1 
Energetic balance of the rotary arm  P i
li

lk θ̇0 (t) sin θk (t) sin θ0 (t) − 2 θ̇i (t) cos θi (t) cos θ0 (t) 
 
−
 k=1 
It was assumed at the beginning that the potential
 
li

 + 2 θ̇0 (t) sin θi (t) sin θ0 (t) 

energy of the rotary plane, and hence of the arm, would 



i
be zero 
 −l0 θ̇0 (t) sin θ0 (t) − P
lk θ̇k (t) cos θk (t) sin θ0 (t)


EP 0 (t) = 0 . (18) 
 k=1


 i 
 P li
lk θ̇0 (t) sin θk (t) cos θ0 (t) + 2 θ̇i (t) cos θi (t) sin θ0 (t) 

Two spatial coordinates are therefore sufficient to pro- −
 k=1 
vide a complete description of the arm dynamics. The 
li

 + 2 θ̇0 (t) sin θi (t) cos θ0 (t) 
coordinates of the arm’s CoG are specified as (Fig. 2) 



 n

lk θ̇k (t) sin θk (t) + l2i θ̇i (t) sin θi (t)
 P 

sx0 (t)

l0

sin θ0 (t)
 −
= (19) k=1
sy0 (t) 2 cos θ0 (t) (26)
16 S. Jadlovská – J. Sarnovský: MODELLING OF CLASSICAL AND ROTARY INVERTED . . .

results to those listed in the referenced works, and by


The potential energy of the i -th pendulum is deter- evaluating the open-loop responses of corresponding sim-
mined by the height of the pendulum CoG above the ulation models, it will next be assessed whether the gen-
rotational plane of the arm erated mathematical models can be considered as valid
and accurate for control design purposes.
i
X li 
EP i (t) = mi gszi (t) = mi g lk cos θk (t) − cos θi (t) 3.1 Case Study – Classical Double Inverted
2
k=1 Pendulum System
(27)
and the kinetic energy of the i -th pendulum is once again The classical double (two-link) inverted pendulum
determined as a sum of a translational and rotary compo- system is composed of a pair of rigid, homogenous pen-
nent (14). While the pendulum’s moment of inertia with dulum rods which are interconnected in a joint and one
respect to the CoG remains equal to JT i = mi li2 /12 , the of them is attached to the cart [3]. The force input F (t)
translational velocity of the pendulum has the magnitude acting upon the cart is used to control the three degrees
of q of freedom of the system: cart position θ0 (t) in m, lower
vi (t) = vxi2 (t) + v 2 (t) + v 2 (t) . (28) pendulum angle θ1 (t) in rad, and upper pendulum angle
yi zi
θ2 (t) in rad, (see Fig. 3).
The dissipative properties of the pendula are de-
scribed as (16); or (17), if n = 1 .
y
q2
3 GENERAL PROCEDURE – PROGRAM J2
IMPLEMENTATION AND APPLICATION
l2
l1
Based on the theoretical background presented in q1 m2g
2.1 as well as the physical formulae derived in 2.2 and q0 J1
2.3, we constructed a pair of general algorithmic proce- m0 F
dures which lead to the equations of motion for an arbi-
trary classical or rotary system of inverted pendula. With m1g
aid of the Symbolic Math Toolbox, we successfully imple-
x
mented both procedures as MATLAB functions (invpen-
deriv.m for classical, rotinvpenderiv.m. for rotary), Fig. 3. Classical double inverted pendulum system - scheme and
which produce the equations in the simplified and rear- basic nomenclature
ranged form, equivalent to the most likely form obtained
by manual derivation. In both cases, the number of pen-
dulum links needs to be specified as the function parame- Using the Derivator, the mathematical model of the
ter and the physically significant steps of derivation pro- system was generated in form of three second-order non-
cess can be tracked in the command window output of linear differential equations which describe the dynamic
the function. Finally, we developed a MATLAB applica- behavior of the cart, lower and upper pendulum respec-
tion with graphical user interface, the Inverted Pendula tively. After the rearrangement into (29), the model as-
Model Equation Derivator, which provides a comfort- sumed the form
able and user-friendly access to both functions: the user
is only required to select the desired type of system (clas-
 
1
m0 + m1 + m2 2 m1 l1 + m2 l1 cos θ1 (t)
sical/rotary) and the number of pendulum links. An ex-  1 
J1 + m2 l12
 2 m1 l1 + m2 l1 cos θ1 (t)
ample preview of the Derivator window is listed in [2] 1 1

together with generated motion equations for a specified 2 m2 l2 cos θ2 (t) 2 m2 l1 l2 cos θ1 (t) − θ2 (t)

inverted pendulum system. 1  


2 m2 l2 cos θ2 (t)
θ̈0 (t)
To demonstrate the functionality of presented gen- 1   θ̈1 (t)  +

2 m2 l1 l2 cos θ1 (t) − θ2 (t)
eral procedures, mathematical models of classical double J2 θ̈2 (t)
and rotary single inverted pendulum system were gen- 
1

erated by the Derivator and will be presented below, δ0 − 2 m1 l1 + m2 l1 θ̇1 (t) sin θ1 (t)
1
rearranged into the standard (minimal ODE-ordinary dif-  2 m1 l1 cos θ1 (t) δ1 + δ2
1 1

ferential equation) form [10] m
2 2 2l cos θ 2 (t) −δ 2 − 2 2 1 2 2 (t) sin θ1 (t) − θ2 (t)
m l l θ̇
1
2 m2 l2 cos θ2 (t)
 
   θ̇0 (t)
M θ(t) θ̈(t) + N θ(t), θ̇(t) θ̇(t) + P θ(t) = V(t) (29)
−δ2 − 12 m2 l1 l2 θ̇2 (t) sin θ1 (t) − θ2 (t)   θ̇1 (t)  +


where M(θ(t)) is the inertia matrix, N(θ(t), θ̇(t)) de- δ2 θ̇2 (t)
0
   
scribes the influence of centrifugal and Coriolis forces, F (t)
1
 − 2 m1 + m2 gl1 sin θ1 (t)  =  0  (30)
P(θ(t)) accounts for gravity forces and V(t) is the in-
put vector, equivalent to (6). By comparing the obtained − 21 m2 gl2 sin θ2 (t) 0
Journal of ELECTRICAL ENGINEERING 64, NO. 1, 2013 17

where m0 is the cart mass, m1 ,m2 are the masses of the Reasonable behavior of the open-loop response of the
lower and upper pendulum respectively, l1 , l2 are the CDIP simulation model (damped oscillatory transient
respective lengths of the pendula, δ0 is the friction coeffi- state, system reaching the stable equilibrium point with
cient of the cart against the rail, δ1 , δ2 are the damping all pendula pointing downward, visible backward impact
constants in the joints of the pendula, J1 = m1 l12 /3 = of the pendula on the base) means that the simulation
JT 1 + m1 (l1 /2)2 , J2 = m2 l22 /3 = JT 2 + m2 (l2 /2)2 are the model based on the generated motion equations can be
moments of inertia of the pendula with respect to their considered accurate enough to serve as a reliable testbed
pivot points and F (t) is the force induced on the cart. system for the verification of linear and nonlinear control
algorithms.
It was discovered that in most cases, the generated
motion equations of the system (30) are identical to 3.2 Case Study – Rotary Single Inverted Pendu-
manually derived equations in referenced works, pro- lum System
vided the latter were derived correctly (compare (30)
to the classical double inverted pendulum model in The rotary single inverted pendulum system is com-
[7, 10, 11]). Apart from the neglected friction, the only posed of a homogenous pendulum rod attached to an arm
significant difference noticed was the plus sign at the which is free to rotate in a horizontal plane [4]. The torque
potential energy terms (eg m2 gl2 sin θ2 (t)/2 instead of M (t) applied on the arm is used to control the two de-
−m2 gl2 sin θ2 (t)/2 ), which corresponds to an initial as- grees of freedom of the system: arm angle θ0 (t) in rad,
and pendulum angle θ1 (t) in rad (see Fig. 5). The system
sumption that the pendulum angle is determined against
was introduced to feedback control community in 1992
the downward position.
by Katsuhisa Furuta, Professor at the Tokyo Institute of
The IPMaC block library contains a library block Technology, and hence it is often referred to as the Furuta
Classical Double Inverted Pendulum (CDIP) which im- pendulum [12].
plements the motion equations (30) derived above. The
open-loop dynamic behavior of the system was verified as
a response of the CDIP block to a force impulse with an z
amplitude of 0.4 N and duration of 1 s, starting with all
pendula in the upright position. The numeric parameters q1
of the simulation were chosen as follows: m0 = 0.3 kg,
m1 = m2 = 0.275 kg, l1 = l2 = 0.5 m, δ0 = 0.3 kgs−1 , m1g l1
δ1 = 0.1 kgm2 s−1 , δ2 = 0.1 kgm2 s−1 . The time behavior J1
of the cart position and the freefall and stabilization of y
both pendula is depicted in Fig. 4. J0
l0 q0
m0g
Cart position (m) M

1.2
x

0.8

Fig. 5. Rotary single inverted pendulum system scheme and basic


0.4 nomenclature

The mathematical model of the system is composed


0 2 4 6 8 10 12 14 16 18 20 of two second-order nonlinear differential motion equa-
tions which respectively describe the rotary arm and the
Simulation time (s)
pendulum. The standard minimal form of the model gen-
Pendulum angle (deg) erated by the Derivator is
50
0 ! !
Pendulum angle (upper) J0 + m1 l02 + 14 m1 l12 sin2 θ1 (t) 1
2
m 1 l0 l1 cos θ1 (t) θ̈0 (t)
1
-100 Pendulum angle (lower) 2
m1 l0 l1 cos θ1 (t) J1 θ̈1 (t)
!
δ0 + 41 m1 l12 θ̇1 (t) sin 2θ1 (t) − 21 m1 l0 l1 θ̇1 (t) sin θ1 (t)
-200 +
− 81 m1 l12 θ̇0 (t) sin 2θ1 (t) δ1
!    
-300 θ̇0 (t) 0 M (t)
× + 1 = (31)
θ̇1 (t) − 2 m1 gl1 sin θ1 (t) 0
0 2 4 6 8 10 12 14 16 18 20
Simulation time (s)
Fig. 4. Classical double inverted pendulum system time behavior where m0 , m1 stand for the masses of the arm and
- cart position and pendula angles the pendulum, l0 , l1 are their respective lengths, δ0 ,
18 S. Jadlovská – J. Sarnovský: MODELLING OF CLASSICAL AND ROTARY INVERTED . . .

Arm angle (deg)


The similarity between Fig. 4 and Fig. 6 points out
90 that the dynamical behavior of classical and rotary in-
verted pendulum systems is closely related. The open-
70 loop response of the RSIP simulation model was shown
to be correct compared to generally known empirical ob-
50 servations of pendula behavior, and sufficient accuracy of
the simulation model was confirmed.
30

10 4 CONCLUSION

0 2 4 6 8 10 12 14 16 18 20 The purpose of this paper was to introduce a unifying


Simulation time (s) approach to the problem of mathematical model deriva-
Pendulum angle (deg)
tion for classical or rotary inverted pendulum systems
0 with an arbitrary number of pendulum links. By means
of extensive physical analysis, general algorithmic proce-
dures were designed which determine the Euler-Lagrange
-100 equations for the base and every pendulum in a gener-
alized system of n classical or rotary inverted pendula.
The procedures were subsequently implemented as MAT-
-200 LAB functions which generate the motion equations for a
user-chosen classical or rotary inverted pendulum system.
Practical importance of symbolic mathematical software,
represented in MATLAB by Symbolic Math Toolbox, was
0 2 4 6 8 10 12 14 16 18 20
demonstrated during the implementation. A GUI appli-
Simulation time (s)
cation was also developed to provide a user-friendly, in-
tuitive interface to both procedures.
Fig. 6. Rotary single inverted pendulum system time behavior –
cart position and pendulum angle Classical double and rotary single inverted pendu-
lum system were selected as example systems to test the
proposed modelling method. The validity and accuracy
of mathematical models generated by the above appli-
δ1 are the damping constants in the joints of the arm cation was verified by comparing the obtained results
and pendulum, J0 = m0 l02 /3 = JT 0 + m0 (l0 /2)2 , and to those listed in the resources, and by evaluating the
J1 = m1 l12 /3 = JT 1 + m1 (l1 /2)2 are the moments of open-loop responses of corresponding simulation models.
inertia of the arm and pendulum with respect to their
Pre-prepared function blocks from the custom-designed
pivot points and M (t) is the input torque applied upon
Simulink block library, Inverted Pendula Modeling and
the rotary arm.
Control, were used in the simulation experiments. The
Contrary to the previous case, a number of differ- outcome of both approaches was highly satisfactory: all
ences were noticed between the generated mathematical possible deviations were justified by the laws of mechanics
model (31) and the models in referenced works. Most of
and it was shown that the dynamic behavior of all models
these can be attributed to the choice of coordinate sys-
is in agreement with the empirically observed facts about
tem (right- or left-handed) and the orientation of the an-
the pendula movement.
gles (clockwise/anticlockwise). Also, authors often sim-
plify the design by assuming that the pendulum is ro- The results of this paper allow the control engineer to
tating in a constant plane [13, 14] or neglect the rotary effortlessly obtain a highly accurate, error-free mathemat-
motion of the arm altogether [15]. In this paper, it was ical model of a selected inverted pendulum system, which
assumed that the actual plane the pendulum is rotating simplifies the process of model-based design and verifica-
in is different in every instant, which brings additional tion of linear and nonlinear control methods for nonlinear
complexity and high accuracy to the generated model. mechanical systems. Moreover, the readily available col-
The generated motion equations were implemented lection of mathematical and simulation models of inverted
into the IPMaC in form of the Rotary Single Inverted pendulum systems provides the testbed model basis to ex-
Pendulum (RSIP) library block, and the open-loop dy- plore the properties of underactuated nonlinear systems,
namic behavior of the system was verified in a simulation mechatronic systems, hybrid automata and other con-
experiment in which the RSIP block was actuated from cepts. Finally, the developed application can be viewed
an initial upright position of the pendulum by a torque as a contribution to modelling and control education in
impulse of 0.4 Nm lasting 1 s. The numeric parameters several ways: students improve their modelling skills by
of the simulated system were chosen to be: m0 = 0.5 kg, testing their step-by-step results against a valid model,
m1 = 0.275 kg, l0 = 0.6 m, l1 = 0.5 m, δ0 = 0.3 kgs−1 , and estimate the effect of different control approaches in
δ1 = 0.011458 kgm2 s−1 . simulation before moving on to a laboratory model.
Journal of ELECTRICAL ENGINEERING 64, NO. 1, 2013 19

Acknowledgements [12] FURUTA, K.—YAMAKITA, M.—KOBAYASHI, S. : Swing


up Control of Inverted Pendulum, Proc. of the Int. Conf. on In-
This work has been supported by the Scientific Grant dustrial Electronics, Control and Instrumentation (IECON91),
Agency of Slovak Republic under project No 1/0286/11 Oct 28–Nov 1, 1991, Kobe, Japan.
Dynamic Hybrid Architectures of the Multiagent Net- [13] ERNEST, P.—HORÁČEK, P. : Algorithms for Control of a Ro-
work Control Systems. tating Pendulum, Proc. of the 19th IEEE Mediterranean Conf.
on Control and Aut (MED’11), Corfu, Greece, 2011.
[14] KATS, C. J. A. : Nonlinear Control of a Furuta Rotary Inverted
References Pendulum, DCT Report, No. 2004:69, 2004.
[15] REX Controls s r.o., Rotary Inverted Pendulum FPM-210/211.
[1] BAKER, G. J.—BLACKBURN, J. A. : The Pendulum: a Case User Manual (Rotačnı́ inverznı́ kyvadlo FPM-210/211. Užı́vatel-
Study in Physics, Oxford University Press, New York, 2005. ská přı́ručka), 2010. (in Czech)
[2] JADLOVSKÁ, S.—SARNOVSKÝ, J. : An Extended Simulink
Library for Modeling and Control of Inverted Pendula Sys- Received 13 July 2012
tems, Proc. of the Int. Conf. Technical Computing Prague 2011,
November 8, 2011, Prague, Czech Republic. Slávka Jadlovská born in 1988 in Košice, Slovakia, grad-
[3] JADLOVSKÁ, S.—SARNOVSKÝ, J. : Classical Double In- uated in 2011 (MSc) with distinction at the Department of
verted Pendulum – a Complex Overview of a System, Proc. of Cybernetics and Artificial Intelligence of the Faculty of Elec-
the IEEE 10th Int. Symposium on Applied Machine Intelligence trical Engineering and Informatics at Technical University in
and Informatics - SAMI 2012, January 26-28, 2012 Herl’any, Slo-
Košice. She is currently continuing her studies at the same
vakia.
department as a PhD student. Her dissertation research is fo-
[4] JADLOVSKÁ, S.—SARNOVSKÝ, J. : A Complex Overview of
cused on the hybrid methods of control for dynamic systems.
the Rotary Single Inverted Pendulum System, Proc. of the 9th
In addition, she investigates issues related with modelling of
Int. Conf. – ELEKTRO 2012, May 21-22, 2012, Žilina - Rajecké
Teplice, Slovakia, pp. 305–310.
under-actuated mechatronic systems, optimal and predictive
control design for hybrid systems, and the advanced applica-
[5] NOSKIEVIČ, J. : Modeling and Identification of Systems (Mod-
tion of MATLAB toolboxes in modelling and control. So far,
elovánı́ a identifikace systémů), Montanex, Ostrava. (in Czech)
she has authored several scientific articles published in inter-
[6] ROUBAL, J.—HUŠEK, P. et al : Control Technology in Ex-
national conference proceedings.
amples (Regulačnı́ technika v přı́kladech), BEN technická liter-
atura, Brno. (in Czech) Ján Sarnovský born in 1945, obtained his MSc degree
in Technical Cybernetics on the Faculty of Electrical Engi-
[7] SCHLEGEL, M.—MEŠŤÁNEK, J. : Limitations on the In-
verted Pendula Stabilizability According to Sensor Placement,
neering of the Slovak Technical University Bratislava, in 1968.
Proc. of the 16th Int. Conf. on Process Control, June 11-14, He defended his dissertation thesis in the field of Automa-
2007, Štrbské Pleso, Slovakia. tion and Control in 1980 at the same University; his thesis
[8] HALLIDAY, D.—RESNICK, R.—WALKER, J. : Fundamen- title was Control of Large Scale Systems Using Hybrid Com-
tals of Physics, Extended 7th edition, Wiley, June 16, 2004. puter Systems. Since 1969 he has been working at Faculty of
Electrical Engineering and Informatics Technical University in
[9] HAJKO, V.—DANIEL-SZABÓ, J. : Fundamentals of physics
(Základy fyziky), VEDA Slovak Academy of Sciences, Bratisla- Koice as a Associate Assistant, since 1980 as Associate Pro-
va, 1980. (in Slovak) fessor and since 1993 as a full Professor. Since 1985 he has
[10] BOGDANOV, A. : Optimal Control of a Double Inverted Pen- been working as a tutor with the Department of Cybernetics
dulum on a Cart, Technical Report CSE-04-006, OGI School of and Artificial Intelligence. His scientific research focuses on
Science and Engineering, OHSU, 2004. the large scale systems and multiagent systems in control of
[11] DEMIRCI, M. : Design of Feedback Controllers for a Linear the large scale systems. He has authored a number of scien-
System with Applications to Control of a Double Inverted Pen- tific articles and contributions published in the journals and
dulum, Int. Journal of Computational Cognition 2 No. 1 (2004), international conference proceedings. He is also an author of
65–84. several monographs.

S-ar putea să vă placă și