Aeee 2013
Aeee 2013
Aeee 2013
net/publication/275040194
CITATIONS READS
23 5,847
2 authors:
Some of the authors of this publication are also working on these related projects:
All content following this page was uploaded by Slavka Jadlovska on 17 April 2015.
1
Department of Cybernetics and Artificial Intelligence, Faculty of Electrical Engineering and Informatics,
Technical University of Kosice, Letna 9, 042 00 Kosice, Slovak Republic
[email protected], [email protected]
Abstract. The purpose of this paper is to present an developed by the authors of this paper and provides
in-depth survey of the rotary single inverted pendulum complex software support for the analysis and control
system from a control engineer’s point of view. The of both classical and rotary IPS [2]. Strong emphasis
scope of the survey includes modeling and open-loop is placed on the generalized approach to system model-
analysis of the system as well as design and verification ing [3], [4], allowing the library to handle systems which
of balancing and swing up controllers which ensure suc- differ by the number of pendulum links attached to the
cessful stabilization of the pendulum in the unstable up- base, such as single [2], [4], [5] and double [2], [4], [6]
right equilibrium. All relevant tasks and simulation ex- IPS.
periments are conducted using the appropriate function
As an underactuated, unstable and yet controllable
blocks, GUI applications and demonstration schemes
system, the rotary single inverted pendulum has been
from a Simulink block library developed by the authors
regarded as an attractive testbed system for linear and
of the paper. The library is called Inverted Pendula
nonlinear control law verification since Katsuhisa Fu-
Modeling and Control (IPMaC) and offers comprehen-
ruta, Professor at the Tokyo Institute of Technology,
sive program support for modeling, simulation and con-
introduced it to feedback control community in 1992
trol of classical (linear) and rotary inverted pendulum
[7]. The aim of this paper is to present a thorough
systems.
overview of this system that covers all topics signifi-
cant for control engineering. The paper is organized as
follows:
Keywords
• In Section 2, a mathematical model of the system
Automatic model generation, custom Simulink is obtained by automatic model generation, and
block library, energy-based swing-up methods, open-loop responses of the system are evaluated.
linear state-feedback stabilizing control, rotary
single inverted pendulum. • Design and verification of control algorithms that
stabilize the pendulum in the unstable upright
equilibrium is presented in Section 3 for a pair
of model situations which deal with stabilizing the
1. Introduction pendulum from around the upright and downward
position respectively. The latter situation also in-
Inverted pendulum systems (IPS) represent a signifi- volves the design of a swing-up controller.
cant class of nonlinear underactuated mechanical sys-
tems, well-suited for verification and practice of ideas • Finally, Section 4 concludes the paper with an
emerging in control theory and robotics [1]. Stabiliza- evaluation of achieved results and some final re-
tion of a pendulum rod in the unstable upright position marks.
is considered a benchmark control problem which has
been solved by attaching the pendulum to a base that
Suitable function blocks and GUI applications from
moves in a controlled linear manner (classical or lin-
the IPMaC are employed in every described step of the
ear IPS) or in a rotary manner in a horizontal plane
process of modeling and control design. All simulation
(rotary IPS).
experiments mentioned in the paper can be run from
The Inverted Pendula Modeling and Control (IP- the Demo Simulations section of the IPMaC which con-
MaC) is a structured Simulink block library which was tains links to corresponding simulation schemes.
c 2013 ADVANCES IN ELECTRICAL AND ELECTRONIC ENGINEERING 73
POWER ENGINEERING AND ELECTRICAL ENGINEERING VOLUME: 11 | NUMBER: 2 | 2013 | SPECIAL ISSUE
~ ~ ~ ~ ~
MI (θ(t))θ̈(t) + N(θ(t), θ̇(t))θ̇(t) +
~
+R(θ(t)) =V ~ (t), (1)
c 2013 ADVANCES IN ELECTRICAL AND ELECTRONIC ENGINEERING 74
POWER ENGINEERING AND ELECTRICAL ENGINEERING VOLUME: 11 | NUMBER: 2 | 2013 | SPECIAL ISSUE
1
Ji = mi li2 , i = 0, 1. (3)
3
c 2013 ADVANCES IN ELECTRICAL AND ELECTRONIC ENGINEERING 75
POWER ENGINEERING AND ELECTRICAL ENGINEERING VOLUME: 11 | NUMBER: 2 | 2013 | SPECIAL ISSUE
Fig. 5: Open-loop dynamical analysis of the rotary single inverted pendulum (voltage model) - simulation setup.
c 2013 ADVANCES IN ELECTRICAL AND ELECTRONIC ENGINEERING 76
POWER ENGINEERING AND ELECTRICAL ENGINEERING VOLUME: 11 | NUMBER: 2 | 2013 | SPECIAL ISSUE
back EMF constant, kg is the gear ratio, and Ra is State-feedback control was selected as a principal
the armature resistance. If the DC motor model is ap- control technique because simultaneous control of sev-
pended to the model of the rotary inverted pendulum eral degrees of freedom can only be ensured if they are
system (i.e. (4) is substituted into (2)), a voltage model all taken into consideration at once (Fig. 7). When
of the system is obtained (Fig. 5). In Fig. 6, the re- close to a chosen equilibrium point, detailed methods
sponse of the rotary inverted pendulum voltage model and control techniques designed for linear systems can
to an impulse signal of 1 V lasting 1 s is depicted. The be used to compute a linear state-feedback control law
numeric parameters of the DC motor simulation model which is subsequently applied to the original nonlinear
were borrowed from the motor featured in the series of system in the form of a stabilizing input signal uST (t).
popular laboratory models of inverted pendulum sys-
tems issued by Quanser Academic (SRV02-Series) and
are specified in [14].
c 2013 ADVANCES IN ELECTRICAL AND ELECTRONIC ENGINEERING 77
POWER ENGINEERING AND ELECTRICAL ENGINEERING VOLUME: 11 | NUMBER: 2 | 2013 | SPECIAL ISSUE
C ∈ <m×4 is the output matrix and d ∈ <m×1 is the and the following discrete-time state equation matri-
direct feedthrough matrix [16]. The linearized state- ces were obtained:
space model (6) was obtained from the Inverted Pen-
1 −0, 0007 0, 0098 0
dula Model Linearizator & Discretizer (Fig. 8), a MAT- 0 1, 0027 0, 004 0, 01
LAB GUI application which generates the continuous- F = 0 −0, 1402 0, 9652 0, 0017 ,
time state-space matrices by expanding (5) into the
0 0, 5456 0, 0624 0, 9935
Taylor series around a given equilibrium point with the
higher-order terms neglected (Fig. 8). In case the sam- 0, 000006
−0, 000011
pling period constant TS is provided, the application g = 0, 0013 .
also returns the matrices of the corresponding discrete-
time state-space representation: −0, 0023
~x(i + 1) = F~x(i) + gu(i), In both cases, the matrices of the output equation
~y (i) = C~x(i) + du(i), (7) are problem-dependent and are specified in later sec-
tions.
where F ∈ <4×4 is the discrete state matrix, g ∈ <4×1
is the discrete input matrix; C and d are the same as
in the continuous system. 2) State-Feedback Control with a State Es-
timator
c 2013 ADVANCES IN ELECTRICAL AND ELECTRONIC ENGINEERING 78
POWER ENGINEERING AND ELECTRICAL ENGINEERING VOLUME: 11 | NUMBER: 2 | 2013 | SPECIAL ISSUE
Fig. 9: State-feedback control of the rotary single inverted pendulum (voltage model) - general simulation setup.
for the continuous-time control law (8), or in the form: and the estimator gain matrix L has to be selected in
1 such a way that the approximated state vector ~x̂(i)
~kf f D = , (11) quickly converges to the actual system state ~x(i).
c1 (I − (F − g~kD ))−1 g
Figure 10 illustrates the results of applying the state-
for the discrete-time control law (9), given that feedback control law based on both the continuous-time
I = diag(1 1 1 1). The artificial output matrix and discrete-time LQR algorithms on the rotary single
c1 = (1 0 0 0) denotes the arm angle as the only inverted pendulum voltage model. RSIP, SFCFG and
state variable for which it makes sense to consider a LE blocks were employed in the corresponding simula-
nonzero reference command. Finally, the unmeasured tion scheme (Fig. 9). With the initial conditions set
disturbance input du (t)/du (i). is considered in both to θ (0) = θ (0) = 0, the control objective was to keep
0 1
the continuous-time and the discrete-time form of the the pendulum upright all the time while making the
control law. The dynamic block mask of the SFCFG arm rotate for a total of half a circle and stop every
block allows the user to select a preferred control law, quarter-turn to stabilize before returning to its initial
method to compute the feedback gain, and optional position. The weight matrices which occur in both the
constraints. To match a particular control requirement standard continuous-time LQ functional:
(initial pendulum deflection, compensation of distur-
bance signal, tracking a reference position of the arm
or a combination of the three), the block’s appearance Z∞
1
may be adjusted by optional enabling or disabling of JLQR (t) = (~xT (t)Q~x(t) + uTR (t)ruR (t))dt, (14)
2
the reference command input w(t)/w(i) and/or the dis- 0
turbance input du (t)/du (i).
and the discrete-time LQ functional:
Because of measurement limitations, it is often im-
N −1
possible to retrieve the full state-space vector at ev- X
JLQR (i) = ~xT (i)Q~x(i) + uTR (i)ruR (i), (15)
ery time instant [17]. The Luenberger Estimator (LE)
i=0
block implements a discrete-time linear state observer
that provides the controller block with a complete, re- were set to Q = diag(100 20 20 0) and r = 1. It
constructed state vector by evaluating a model of the was next assumed that the arm and pendulum angles
original discrete-time system in the structure: would be directly measurable while the velocities would
~x̂(i + 1) = F~x̂(i) + gu(i) need to be estimated. The state-space matrices of the
output equation therefore became
+ L(~y (i) − C~x̂(i)), (12)
1 0 0 0 0
which ensures that the time behavior of estimation er- C = , d = ,
0 1 0 0 0
~ ~
ror x̃(i) = ~x(i) − x̂(i) is independent of input/output
signals: while the vector of estimator poles was set to
~x̃(i + 1) = (F − LC)~x̃(i), (13) (0, 1 0, 2 + 0, 1i 0, 2 − 0, 1i 0, 3).
c 2013 ADVANCES IN ELECTRICAL AND ELECTRONIC ENGINEERING 79
POWER ENGINEERING AND ELECTRICAL ENGINEERING VOLUME: 11 | NUMBER: 2 | 2013 | SPECIAL ISSUE
It is obvious that the response of the discrete-time Applying state-feedback control with feedforward gain
LQR algorithm closely follows that of the continuous- on a system is insufficient if the steady-state effect of
time algorithm, and there is no steady-state error in a permanent disturbance input needs to be compen-
either case. The simulation results were also compared sated. The structure of the State-Feedback Controller
with those of the continuous-time pole-placement con- with Summator (SFCS) block implements a summator
term v(i) which sums up all past error values. This
troller: for this case, the vector of desired closed-loop
poles was set to (−2 − 3 + i − 3 − i − 10). ensures that the system output will track all changes
in the reference command and the influence of perma-
To enhance the performance of the designed LQR nent disturbances will be eliminated. The evaluated
controller, optimal weight matrices were sought. Af- control law, presented and derived by Modrlak in [17],
ter setting r = 1, the positive real diagonal elements is specified as:
of the Q weight matrix were modified and the influ-
ence of each candidate matrix on the overall perfor- u(i) = uR (i) + uf f (i) + uS (i) =
mance of the system was verified in the discrete-time − ~k1 ~x(i) + ~k2 w(i) + v(i), (16)
LQR simulation setup for the rotary inverted pen-
dulum voltage model. The results of two extreme where w(i) is the reference command and ~k1 , ~k2 are
cases of selecting Q : Q1 = diag(500 0 20 0) and gain matrices which are computed from the matrix
Q2 = diag(10 120 20 0), are depicted in Fig. 11. structure:
For Q1 , the arm quickly reaches the reference position
−~k1 −~k2 =
but the pendulum overshoot is quite far from desired.
If Q2 is selected, the pendulum swings are well within F − I g −1
the limits, however the rise time of the arm is unac- − ~kF −1 − ~
kg , (17)
c1 0
ceptably slow. It has therefore been concluded that
the optimal time behavior of the arm and the pen- assuming that ~k (alternatively ~kD )is a standard feed-
dulum are two conflicting requirements which cannot back gain vector equivalent to the one in Section 3.1.2.
be satisfied simultaneously. Any successful tuning of The layout of the block mask once again allows the user
weight matrices must therefore result in a reasonable to adjust the number of block input ports to match a
compromise between the quick rise time of the base specified control requirement and to compute ~k/~kD us-
and the low overshoot of the pendulum. ing a preferred method and state-space description [2].
c 2013 ADVANCES IN ELECTRICAL AND ELECTRONIC ENGINEERING 80
POWER ENGINEERING AND ELECTRICAL ENGINEERING VOLUME: 11 | NUMBER: 2 | 2013 | SPECIAL ISSUE
The control law (16) was verified for the rotary single
inverted pendulum voltage model and the weight ma-
trices of the standard discrete-time LQ functional (15) Fig. 13: Block diagram of swing-up and stabilizing control of
were set to Q = diag(500 0 20 0), r = 1. The ob- IPS.
tained results were compared to those of a conventional
discrete-time LQR controller using the same values of
weight matrices as in Section 3.1.2. A constant dis- 1) Energy-based Methods for Swing-up
turbance input (5 V for the first controller, 1 V for Control
the second) was present in both simulations. To com-
pensate for measurement limitations, the LE block was One of the earliest and most effective approaches to
included in both schemes, with the estimator poles set pendulum swing-up is the method based on energy con-
to the same values as before. As it can be seen in Fig. siderations, proposed and explained by Aström, Furuta
12, the conventional LQR controller fails to track the and Iwase in [19], [20]. The goal is to bring the total
reference trajectory without producing steady-state er- mechanical energy W of the pendulum to zero, which
ror, but the permanent disturbances are successfully corresponds to the upright position. The first deriva-
compensated by a LQR algorithm with a summator tive of W for the uncontrolled pendulum (2) in the
included in the control structure. simplified form is given as:
d 1 2 2 1
Ẇ = ( ml θ̇1 (t) + m1 gl1 (cosθ1 (t) − 1)) =
dt 2 2
1
3.2. Design of a Control Strategy = J1 θ̇1 (t)θ̈1 (t) − m1 gl1 θ̇1 (t)sinθ(t) =
2
for Swing-up and Stabilization of 1
= − m1 l0 l1 θ̈0 (t)θ̇1 (t)cosθ(t). (18)
the System 2
c 2013 ADVANCES IN ELECTRICAL AND ELECTRONIC ENGINEERING 81
POWER ENGINEERING AND ELECTRICAL ENGINEERING VOLUME: 11 | NUMBER: 2 | 2013 | SPECIAL ISSUE
c 2013 ADVANCES IN ELECTRICAL AND ELECTRONIC ENGINEERING 82
POWER ENGINEERING AND ELECTRICAL ENGINEERING VOLUME: 11 | NUMBER: 2 | 2013 | SPECIAL ISSUE
ception. An illustrative experiment which compares The IPMaC block library enhances the capabilities of
the effect of a varying um on the rotary single inverted the MATLAB/Simulink program environment by pro-
pendulum voltage model, is depicted in Fig. 15. viding effective means for analysis and control of an im-
portant class of nonlinear mechanical systems. More-
over, the readily available collection of mathematical
and simulation models of inverted pendulum systems
4. Conclusion can be viewed as a testbed model basis for explor-
ing the properties of underactuated nonlinear systems,
mechatronic systems, hybrid systems and other con-
The purpose of this paper was to present a compre- cepts. As a meaningful contribution to modeling and
hensive approach to the problem of modeling and con- control education, the library has been included into
trol of the rotary single inverted pendulum system. A the research and teaching activities of the Center of
custom-designed Simulink block library developed by Modern Control Techniques and Industrial Informatics
the authors of the paper, Inverted Pendula Modeling (http://kyb.fei.tuke.sk/laben/) at the Faculty of Elec-
and Control (IPMaC), was used as a software frame- trical Engineering and Informatics, Technical Univer-
work for all covered issues which included mathemati- sity of Kosice.
cal model derivation, open-loop analysis and linear ap-
proximation of the system, as well as followed by design
and verification of stabilizing state-feedback control al-
gorithms as well as energy-based swing-up control laws. Acknowledgment
The IPMaC block library provided suitable function
This contribution is the result of the Vega project im-
blocks to support every step of the process of analysis
plementation - Dynamic Hybrid Architectures of the
and control design (such as a pre-prepared simulation
Multiagent Network Control Systems (No. 1/0286/11),
model of the rotary single inverted pendulum system
supported by the Scientific Grant Agency of Slovak
or a detailed state-feedback controller block), together
Republic - 70 %, and of the KEGA project im-
with several original applications with graphical user
plementation - CyberLabTrainSystem - Demonstra-
interface. One such application was used to derive the
tor and Trainer of Information-Control Systems (No.
mathematical model for the selected inverted pendu-
021TUKE-4/2012) - 30 %.
lum system in the form of symbolic equations of mo-
tion; the other performed the automatic linear approx-
imation of the system in a chosen equilibrium point. In
these applications, great practical potential of symbolic References
mathematical software was demonstrated.
With the aid of developed program tools, the pa- [1] BAKER, G. J. and J. A. BLACKBURN. The
per has presented a set of coherent results together Pendulum: a Case Study in Physics. New
with thorough evaluations. The validity of the nonlin- York: Oxford University Press, 2005. ISBN 978-
ear model generated by the above application was ver- 0199557684.
ified by comparing the obtained results to those listed
[2] JADLOVSKA, S. and J. SARNOVSKY. An Ex-
in the resources, and by evaluating the open-loop re-
tended Simulink Library for Modeling and Con-
sponses of the simulation model. The outcome of both
trol of Inverted Pendula Systems. In: 19th Annual
approaches was highly acceptable: all deviations were
Conference Proceedings of the International Sci-
justified by the laws of mechanics and it was shown
entific Conference - Technical Computing Prague
that the dynamic behavior of both the torque and the
2011. Prague: 2011. ISBN 978-80-7080-794-1.
voltage model is in agreement with the empirically ob-
served facts on pendulum movement. The ability to [3] JADLOVSKA, S. Modeling and Optimal Con-
control the rotary inverted pendulum system with re- trol of Inverted Pendula Systems. Kosice, 2011.
spect to the principal control objective (stabilization in pp. 93. Diploma Thesis. Supervisor: prof. Ing. Jan
the inverted position) and a variety of secondary issues Sarnovsky, CSc. Faculty of Electrical Engineering
was demonstrated for all implemented state-feedback a Informatics, Technical University of Kosice.
control techniques which included pole-placement and
the LQR optimal control method; the simulation re- [4] JADLOVSKA, S. and A. JADLOVSKA. Inverted
sults also justified the use of the techniques based on a Pendula Simulation and Modeling-a Generalized
linearized model to control nonlinear systems. To deal Approach. In: Proceedings of the 9th Interna-
with the problem of swinging the pendulum upwards tional Scientific Technical Conference on Process
from the natural hanging position, several heuristic Control - RIP 2010. Kouty nad Desnou: Tribun
swing-up methods based on energy considerations were EU, 2010, pp. C134a-1–11. ISBN 978-80-7399-951-
proposed and compared from multiple viewpoints. 3.
c 2013 ADVANCES IN ELECTRICAL AND ELECTRONIC ENGINEERING 83
POWER ENGINEERING AND ELECTRICAL ENGINEERING VOLUME: 11 | NUMBER: 2 | 2013 | SPECIAL ISSUE
c 2013 ADVANCES IN ELECTRICAL AND ELECTRONIC ENGINEERING 84
POWER ENGINEERING AND ELECTRICAL ENGINEERING VOLUME: 11 | NUMBER: 2 | 2013 | SPECIAL ISSUE
Engineering and Informatics Technical University scale systems and multiagent systems in control of
in Kosice as a Associate Assistant, since 1980 as the large scale systems. He has authored a number of
Associate Professor and since 1993 as a Professor. scientific articles and contributions published in the
Since 1985 he has been working as a tutor at the journals and international conference proceedings. He
Department of Cybernetics and Artificial Intelli- is also an author of several monographs.
gence. His scientific research focuses on the large
c 2013 ADVANCES IN ELECTRICAL AND ELECTRONIC ENGINEERING 85