You are on page 1of 16

Linear Controllers for the NXT Ballbot with Parameter Variations

Using Linear Matrix Inequalities

Rafael A. García-García and Manuel Arias-Montiel

F
or years, one of the main challeng- the trend is to base laboratory ses- of RAM and 256 KB of flash memory.
es for teachers of the automatic sions in the automatic control courses The brick also contains an Atmel 8-b
control courses at both the under- in experimental platforms that are AVR processor running at 8 MHz to
graduate and postgraduate levels has affordable, portable, and reconfigu- operate the servomotors and rotation
been breaking the barrier between the rable to allow the students to develop sensors [14], [15]. In addition, LEGO
strong mathematical content of these practical activities, including outside Mindstorms NXT can be programmed
courses and the practice of applying the laboratory setting [1], [2], [9]. in different programming languages
such knowledge to real systems. Some In this context, LEGO Mindstorms and environments such as RobotC [14],
students envision automatic control is a reprogrammable, low-cost robot- Java [15], Matlab [16], and Labview [17].
courses as a set of abstract mathemat- ics kit widely used in education and The ballbot is a skinny, agile, and
ics, and even when they understand research activities. These features omnidirectional robot that balances on,
how to solve textbook problems, few allow the kit to be applied in various and is propelled by, a single spherical
students assimilate how to apply this fields of engineering, mainly in the wheel. The ballbot dynamics are based
knowledge to real systems or grasp automatic control and robotics areas on the spherical inverted pendulum,
the true importance of such courses in [2], [10]–[14]. The LEGO Mindstorms and it is an interesting object of study
various branches of engineering [1], NXT kit includes structural elements, for students, engineers, and researchers
[2]. To try to address these issues, some servomotors, sensors for different in automatic control. The NXT ballbot
researchers have exerted considerable physical variables, and the NXT brick, [18] is a version designed for the LEGO
effort to make the understanding of which contains an Atmel 32-b ARM Mindstorms NXT kit based on the orig-
some advanced automatic control con- processor running at 48 MHz. This inal ballbot [19]. The NXT ballbot (see
cepts more accessible from the math- processor has direct access to 64 KB Figure 1) is built using standard parts
ematical point of view using graphical
or tabular concepts that can be handled
NXT Brick
in any basic control course [3]–[5].
Recently, with advances in computer
technology, numerical simulation tools
have also been widely used to facilitate
the teaching-learning process in the au-
tomatic control area [6]–[8].
Laboratory practices and design
projects have been the most widely
used tools by the community for Gyroscopic
Sensors dc Motors and
teaching automatic control to ensure
Rotary Encoders
that the students relate the theory
learned in the classroom with its
implementation in real systems. How- Rubber Wheels
ever, the equipment required in an y
automatic control laboratory is often Plastic Ball
expensive and difficult to maintain, z x
leading to too few workstations for the
number of students. For these reasons, Figure 1  A three-dimensional view of the ballbot structure. The plastic ball is supported
by three wheels and the LEGO structural parts attached diagonally. The wheels include
two rubber tires attached to servomotors and one freely spinning wheel. The NXT ballbot
Digital Object Identifier 10.1109/MCS.2016.2535915 can be moved and kept in equilibrium controlling independently the servomotors, which
Date of publication: 18 May 2016 provide rotational movement in xy and zy planes.

1066-033X/16©2016ieee JUNE 2016  «  IEEE CONTROL SYSTEMS MAGAZINE  121

Authorized licensed use limited to: American University of Beirut. Downloaded on April 30,2023 at 13:46:50 UTC from IEEE Xplore. Restrictions apply.
included in the LEGO Mindstorms deep mathematical background. In are investigated in the closed-loop
NXT kit and two gyroscopic sensors particular, in the formulation of robust system. A polytopic model consider-
used to measure the inclination rates control problems as LMIs, a reduced ing variations within a bounded set
and angles about the two axes needed number of elementary technical results, for the inertial and friction parameters
to balance the ballbot. in the context of linear algebra, are for system actuators is defined. The
The balancing problem of the NXT required. These technical results can eigenvalue-placement and LQR con-
ballbot has been dealt with using be introduced by motivating examples trollers are redesigned by LMIs using
model-based control such as the linear- dealing with basic concepts such as sta- the polytopic model. Some simulation
quadratic regulator (LQR) [14], [18] and bility and state feedback (see [3] and [26, results show that controllers designed
the eigenvalue-placement approach [20]. Chaps. 2 and 7]). by LMIs are robust against parameter
However, in any mathematic model, The results presented in this article variation. Finally, some experimental
there are often parametric uncertain- are intended to help meet the goal of results are presented to demonstrate
ties. In the particular case of the NXT bridging the gap between the theory of the robust behavior of the controllers
ballbot, uncertainties appear when the automatic control and its application including some external disturbances.
actuator dynamics are included in the to real systems, with emphasis on the To emphasize the possible use
model due to the servomotor param- use of commonly accessible tools such of the obtained results in control
eters that cannot be measured. In this as commercial software for numerical courses, an introduction paragraph
context, some authors have reported simulation and for solving the LMIs has been included in some sections
different values for physical param- and low-cost hardware for the practical with suggested activities for students.
eters for NXT servomotors based on implementation. In the opinion of the The authors hope that the concepts
experimental tests [14], [18], [21]–[23]. authors, the results presented in this and results presented in this article
The parametric uncertainties can nega- article may be used in control courses will be able to help students realize
tively impact the control algorithm per- for graduate and senior undergraduate that the theory learned in the class-
formance, so other control approaches, students because they would have the room can be applied to real systems
such as robust ­control techniques, must prerequisite background knowledge in and, in this way, to break the barrier
be ­considered. linear algebra, calculus, linear system between control theory and control
The robust control approach pre- theory, and numerical methods. More- application, even for relatively new
sented here is based on linear matrix over, the LEGO Mindstorms NXT is an control algorithms, such as those
inequalities (LMIs), which is an affordable test rig used for the experi- based on LMIs.
approach to deal with the problem of mental implementation.
parametric uncertainty and to pro- The NXT can be programmed in Dynamic Modeling
vide robustness to control algorithms Matlab, which makes it possible to Dynamical models are a necessary
developed based on dynamical mod- take advantage of specific toolboxes tool in control systems analysis and
els. In spite of LMI theory going back to solve LMI problems [28], [29]. This design. This section presents the
more than 100 years, their importance article follows directly from the results dynamical model of the NXT ballbot
in control systems was only recently presented in [11], where the LMI based on [18]. The authors propose,
recognized (in the early 1960s), and, approach was used to provide robust- as a classroom activity, that students
due to the lack of powerful comput- ness to classical LQR control to solve the obtain the NXT ballbot dynamics by
ers and efficient algorithms to solve balancing problem of the NXT ballbot. the Euler–Lagrange formalism and
them, they did not receive a great However, the results were presented after that, they linearize the nonlin-
deal of consideration from control only for one vertex of the polytopic ear obtained system. In this way, stu-
researchers until the late 1980s [3], model, and the comparison of the clas- dents will be able to apply a part of
[24]–[26]. In recent years, LMIs have sical LQR performance and the robust the knowledge acquired in previous
become in a powerful tool in the field case is not covered in the experimental courses such as system dynamics.
of control systems, mainly because results. Moreover, neither classical nor
of the development of efficient and robust eigenvalue-placement control- NXT Ballbot Dynamics
reliable solution algorithms. Today, lers were considered. In this article, Assuming that the motion in xy plane
many theoretical and practical control the NXT ballbot dynamics based on and zy plane are decoupled and that
applications can be efficiently solved [18] are considered. The nonlinear the equations of motion in these two
by the LMI approach using commer- model is linearized around an equilib- planes are identical, the NXT ballbot
cial software, such as Matlab, Yalmip, rium point, and this linearized model can be considered as two separate, and
or CVX [26], [27]. These computational is used to synthesize classical eigen- identical, spherical wheeled inverted-
tools have made the use of LMIs more value-placement and LQR control pendulum models for each plane [14],
accessible for students, engineers, and schemes. By numerical simulation, the [18]. Under this assumption, two iden-
researchers without the need for a effects of some parameter variations tical motion equations are obtained

122  IEEE CONTROL SYSTEMS MAGAZINE  »  JUNE 2016

Authorized licensed use limited to: American University of Beirut. Downloaded on April 30,2023 at 13:46:50 UTC from IEEE Xplore. Restrictions apply.
and only one plane of motion is ana-
y ψ
lyzed. In Figure 2, a simplified repre-
sentation for the NXT ballbot in the xy
plane is shown. Motion in the xy plane
yb
from Figure 2 is described by the body
Mb, Jψ
inclination angle in relation to vertical
axis }, the plastic ball angle in rela-
L
tion to vertical axis i, the plastic ball
angle due to the contact with the drive
wheel i s, and the drive wheel angle θ θs
given by the actuator i m .
Assuming no slippage between the
drive wheel and the plastic ball, and θm
considering i and } as the generalized Rs
ys Rw
coordinates within the Euler–Lagrange
formalism, the dynamic model for NXT Ms, Js Mw, Jw
ballbot is [18]
xs xb x

;(M s + M b) R s2 + ( J m + J ~) + J sE ip +
2
R s
R~ 2 Figure 2  A spherical wheeled inverted pendulum model for the xy plane. The NXT ball-
bot body is considered an inverted pendulum with mass center coordinates xb, yb; mass
;M b R s L cos } - 2s (J m + J ~)E }p -
R2
Mb; and mass moment of inertia J } . Ms, Js, and Rs are the mass, moment of inertia, and
R~ radius of the plastic ball and Mw, Jw, and Rw are the mass, moment of inertia, and radius

M b R s L}o 2 sin } = Fi, of drive wheels attached to servomotor.
(1)

;M b R s L cos } - (J m + J ~)E ip +
R s2 where ea is the input voltage, kb is the
;M b R s L - (J m + J ~)E ip +
R 2s
R ~2 R 2~ back electromotive force constant, and
;M b L2 + J } + 2s ( J m + J ~)E }p -
R2
;M b L2 + J } + 2s (J m + J ~)E }p -
R2 Ra is the armature resistance. Substi-

R~ R~ tuting (8) into (5) and (6), the gener-
 
M b gL sin } = F} . M b gL} = F} . alized forces as functions of input
(2) (4) voltage are
Actuators Fi = ae a - b (io - }o ), (9)
Model Linearization The generalized forces Fi and F} in
The mathematical model expressed F} = - ae a + b (io - }o ), (10)
the ballbot model (3) and (4) represent
by (1) and (2) is nonlinear. To be able the servomotor torques
to control the NXT ballbot by linear with a = k p /R a and b = k ((k p k b /R a)
control schemes, the dynamic model Fi = k p i a - b e io m, (5) + b e).
can be linearized around an equilib-
F} = - k p i a + b e io m, (6)
rium point using the algebraic method
State-Space Ballbot Model
[30]. The control objective is to keep where kp is the torque constant, be is the
the NXT ballbot in a vertical position, friction coefficient inside the motor, ia is The linearized model expressed by (3)
so the dynamic model is linearized the armature current, and io m is the angu- and (4) can be rewritten in matrix form as
around } = 0. lar speed. With k = R s /R w, the motor
E = G + F = G + G ; E = He a, (11)
ip io i
Accounting for the limit } " 0 angular speed can be expressed as [18]
}p }o }
(sin } . }, cos } . 1) and neglecting
io m = k (io - }o ) . (7)
the higher-order terms for } (assuming where E is the inertia matrix, F is the
small oscillations), (1) and (2) are linear- To be able to control the servomotor Coriolis and centrifugal forces matrix,
ized around the equilibrium point [14], from a voltage input, using the electri- G is the potential energy matrix, and H
[18] to yield cal dynamics of the servomotor and is the input matrix. These matrices are
neglecting the armature inductance, defined as
the armature current can be expressed
(J m + J ~) + J sE ip +
;(M s + M b) R 2s +
R 2s
E=; E, F = ; E,
R 2~ in terms of the input voltage as E 11 E 12 F11 F12
E 21 E 22 F21 F22
;M b R s L - 2s (J m + J ~)E }p = Fi,
R2 
G=; E, H = ; E,
R~ e a - k b k (io - }o ) G 11 G 12 H1
ia = , (8)
(3) Ra G 21 G 22 H2

JUNE 2016  «  IEEE CONTROL SYSTEMS MAGAZINE  123

Authorized licensed use limited to: American University of Beirut. Downloaded on April 30,2023 at 13:46:50 UTC from IEEE Xplore. Restrictions apply.
with theory that can be solved with the The requirement P 2 0, A T P + PA 1 0
LMI approach include the construc- is the Lyapunov inequality on P, which
E 11 = (M s + M b) R s2 + k 2 (J m + J ~) + J s, tion of quadratic Lyapunov functions is a special form of an LMI. This mile-
E 12 = M b R s L - k 2 (J m + J ~), for stability and performance analy- stone was followed by other relevant
E 21 = LM b R s - k 2 (J m + J ~), sis of linear differential inclusions, advances in the 20th century about the
E 22 = M b L2 + J } + k 2 (J m + J ~), the joint synthesis of state-feedback application of Lyapunov’s methods to
F11 = b, F12 = - b, F21 = - b, F 22 = b, and quadratic Lyapunov functions for some practical problems in control engi-
G 11 = 0, G 12 = 0, G 21 = 0, G 22 =- M b gL, linear differential inclusions, and the neering, the development of graphical
optimization over an affine family of techniques for solving some families of
H 1 = a, H 2 = - a .
transfer function matrices including LMIs, the recognition that various LMIs
Choosing the state vector x = synthesis of multipliers for analysis of can be solved by computer using convex
6i } io }o @T and the input vector u = linear systems with unknown param- programming, and the development of
ea, the ballbot model in state space can eters and multicriterion linear qua- efficient algorithms for LMIs [24]. The
be represented by dratic Gaussian (LQG) or LQR [24]. An importance of LMIs in automatic control
LMI is a constraint of the form is reflected by the fact that nearly half of
xo = Ax + Bu,
 papers published about LMIs are related
y = Cx, (12) m
F (z) _ F0 + / z i Fi 2 0, (13) to control and systems applications.
with the definitions of A, B, and C i=1

shown in the box at the bottom of Polytopic Models


the page. where z = (z 1, f, z m) T ! R m is the vec- In general terms, a dynamic model of
tor of m variables, Fi = F iT ! R n # n, a linear system expressed in state vari-
Linear Matrix Inequalities i = 0, f, m are given symmetric mat­­ ables, as (12), can be considered a linear
and Polytopic Models rices, the symbol > means that the differential inclusion (LDI). An LDI is
This section is a brief introduction to matrix F (z) is positive definite, which called a polytopic LDI, or PLDI, when
LMIs and polytopic models, which means u T F (z) u 2 0 for all non- model matrices include terms with a
are central topics in this article. Basic zero u ! R n [24]–[26]. The LMI (13) linear dependence on uncertain param-
concepts about LMIs are discussed is a convex constraint on z, that is, eters that vary within some bounded
in [3] and the introduction chapters {z F (z) 2 0} is convex. Although the set [24]. PLDIs are expressed as
of [24] and [26]. See [27], [31], and [34] LMI (13) may seem to have a special-
xo = A (t) x + B (t) u, x (0) = x 0,
for further applications in engineering ized form, it can represent a wide vari-   
y = C (t) x + D (t) u, (14)
systems of polytopic models. ety of convex constraints on z.
The history of LMIs begins with where t = (t 1, f, t n p) is the vector
Linear Matrix Inequalities the Lyapunov theory in about 1890. of np uncertain parameters. Each
A wide variety of problems in sys- He showed that the differential uncertain parameter t i is bounded
tems and control theory can be equation by a minimum and maximum value
reduced to a few standard convex or [t imin, t imax] . The possible combinations
xo (t) = Ax (t), 
quasi-convex optimization problems of minimum and maximum values of
involving LMIs. These optimization is stable (all trajectories converge to the vector t define a convex polytope
problems can be solved numerically zero) if and only if there exists a posi- with 2 n p vertices " v 1, f, v L , . Convex
and efficiently using commercial and tive-definite matrix P such that polytopes can be represented by the
accessible software tools. The types convex combination
of problems in control and systems A T P + PA 1 0. 
t ! C 0 " v 1, f, v L ,
L L
R0 V = ) / j i v i, j i 2 0, / j i = 1 3,
S 0 1 0 W i=1 i=1
S0 0 0 1 W
S E 12 G 22 E 12 F21 - E 22 F11 E 12 F22 - E 22 F12 W where C 0 ! R n p is the convex hull of
A = S0 ,
2
S E 11 E 22 - E 12 E 11 E 22 - E 12
2
E 11 E 22 - E 212 WW the set of vertices.
SS0 - E 11 G 22 2 E 21 F11 - E 11 2F21 E 21 F12 - E 11 F22 W When dependency on t is linear,
E 11 E 22 - E 12 E 11 E 22 - E 12 E 11 E 22 - E 212 W the matrix system X (t) can be repre-
RT 0 V X
S W R1 0 V sented by the convex polytope
S 0 W S 0 0W
S E 22 H 11 - E 12 H 21 W S0 1 0 0W
B=S W , C=S .
1 0W
2
S E 11 E 22 - E 12 W SS
0 0
WW X (t) ! C 0 " g 1, f, g L ,
SS E 11 H 21 - E 21 2H 11 WW T0 0 0 1X L L
T
E 11 E 22 - E 12
X = ) / j i g i, j i 2 0, / j i = 1 3,
i=1 i=1

124  IEEE CONTROL SYSTEMS MAGAZINE  »  JUNE 2016

Authorized licensed use limited to: American University of Beirut. Downloaded on April 30,2023 at 13:46:50 UTC from IEEE Xplore. Restrictions apply.
Table 1  Physical parameters for servomotors obtained experimentally by some authors. The moment of inertia and the
friction coefficient are the parameters with more variation in their values.

Parameter Reference [14] Reference [21] Reference [22] Reference [18] Reference [23]
R a [X] 4.6 6.85 5.0012 6.69 4.6

L a [H] 3.7 # 10 - 3 Neglected 1 # 10 - 3 neglected 5.7 # 10 - 3

J m 6kg·m 2@ 45 # 10 - 9 Neglected 2.4589 # 10 - 6 10 # 10 - 6 2.96 # 10 - 3

b e [N·m·s] 1.85 # 10 - 3 1.1278 # 10 - 3 38.745 # 10 - 6 2.2 # 10 - 3 0.914 # 10 - 3

K p ; N·m E 0.48 0.3179 0.5246 0.317 0.49


A

K b ; V·s E 0.48 0.46389 0.5246 0.468 0.49


rad

with The approach taken is to include these the matrices A and B depend on ele-
parameter variations in a polytopic ments of matrices E and F, the mini-
  X (t) ! C 0 = '; E, f, ; E1,
A1 B1 AL BL
model, so for the NXT ballbot, the mum and maximum values for these
C1 D1 CL DL
polytopic model is obtained in terms matrices are presented to simplify
(15)
of these two parameters. The uncer- the notation as shown in (18), at the
where the vertices g i correspond tain parameter vector is bottom of the page. In terms of the
to images v i, that is, g i = X (v i) . See matrix elements of (18), the four ver-
t = ^b e J mh, (16)
[24]–[26] for more details on LMIs and tices of polytopic model for matrices
polytopic models of uncertainty. with the resultant polytope having L = A and B are shown in the box at the
4 vertices, bounded by the minimum top of the next page. To ensure that
NXT Ballbot and maximum values the steady-state error converges to
Polytopic Model zero, another state variable p, corre-
This section develops the polytopic b e ! 6b e min b e max@, J m ! 6J m min J m max@ . sponding to the integral of position
model of the NXT ballbot. Students  (17) error [18], is added to the polytopic
are encouraged to read some refer- model. The extended polytopic model
ences about polytopic models, apply These uncertain parameters are is expressed by
the concepts learned to the NXT ball- present in matrices A and B of (12),
bot, and then validate the presented and these matrices depend on the xo a = A a x + B a u, (19)
polytopic model. Moreover, students uncertain parameters in a linear
can explore the possibility of includ- form, so it is possible to define a poly- where
ing uncertainties in other parameters tope with four vertices that contains
in the polytopic model. all the possible values for the uncer- x a = 6x p@T,

Aa = ; E, B a = ; E, i = 1, f, L.
As mentioned above, different tain parameters between their mini- Ai 0 Bi
values for the NXT ballbot actua- mum and maximum values. Because -C 0 0
tors (NXT servomotors) have been
reported in the literature. Accord-
ing to data presented in Table 1, the
E min = = G,
(M s + M b) R 2s + k 2 (J m min + J ~) + J s M b R s L - k 2 (J m min + J ~)
moment of inertia Jm and friction coef- LM b R s - k 2 (J m min + J ~) M b L2 + J } + k 2 (J m min + J ~)
ficient be are the parameters with the
E max = = G,
2 2 2
(M s + M b) R s + k (J m max + J ~) + J s M b R s L - k (J m max + J ~)
most variation. These parameters are LM b R s - k 2 (J m max + J ~) M b L2 + J } + k 2 (J m max + J ~)
difficult to measure, and, in particu- R V
S k c b e min + (K b K p) m - k c b e min + (K b K p) mW
lar for the friction, complex to model S Ra Ra W
Fmin = S b e min + (K b K p) b e min + (K b K p) W,
with accuracy because different phe- SS- k c m kc m WW
nomena can cause energy dissipation Ra Ra
RT XV
(viscous damping, Coulomb friction). S k c b e max + (K b K p) m - k c b e max + (K b K p) mW
S Ra Ra W
These parameters appear in a linear Fmax = S b e max + (K b K p) b e max + (K b K p) W .
form in the system model [(3) and (4)] SS- k c m kc m WW (18)
Ra Ra
that considers the actuator dynamics. T X

JUNE 2016  «  IEEE CONTROL SYSTEMS MAGAZINE  125

Authorized licensed use limited to: American University of Beirut. Downloaded on April 30,2023 at 13:46:50 UTC from IEEE Xplore. Restrictions apply.
R0 0 1 0 V
S W
S0 0 0 1 W
S E min 12 G 22 E min 12 Fmin 21 - E min 22 Fmin 11 E min 12 Fmin 22 - E min 22 Fmin 12 W
A1 = 0
S E min 11 E min 22 - E min 212 ,
S E min 11 E min 22 - E min 212 E min 11 E min 22 - E min 212 WW
SS0 - E min 11 G 22 E min 21 Fmin 11 - E min 11 Fmin 21 E min 21 Fmin 12 - E min 11 Fmin 22 W
E min 11 E min 22 - E min 212 E min 11 E min 22 - E min 212 E min 11 E min 22 - E min 212 W
T X
R 0 V
S W
S 0 W
S E min 22 H 11 - E min 12 H 21 W
B1 = S 2 W,
S E min 11 E min 22 - E min 12 W
SS E min 11 H 21 - E min 21 H211 WW
E E - E min 12
TR min 11 min 22 X V
S 0 0 1 0 W
S0 0 0 1 W
S E min 12 G 22 E min 12 Fmax 21 - E min 22 Fmax 11 E min 12 Fmax 22 - E min 22 Fmax 12 W
A 2 = S0 ,
S E min 11 E min 22 - E min 12
2
E min 11 E min 22 - E min 212 E min 11 E min 22 - E min 212 WW
SS0 - E min 11 G 22 E min 21 Fmax 11 - E min 11 Fmax 21 E min 21 Fmax 12 - E min 11 Fmax 22 W
E min 11 E min 22 - E min 212 E min 11 E min 22 - E min 212 E min 11 E min 22 - E min 212 W
T X
B 2 = B 1,
R0 0 1 0 V
S W
S0 0 0 1 W
S E max 12 G 22 E max 12 Fmin 21 - E max 22 Fmin 11 E max 12 Fmin 22 - E max 22 Fmin 12 W
A 3 = S0 ,
S E max 11 E max 22 - E max 12
2 2
E max 11 E max 22 - E max 12 E max 11 E max 22 - E max 12 WW
2

SS0 - E max 11 G 22 E max 21 Fmin 11 - E max 11 Fmin 21 E max 21 Fmin 12 - E max 11 Fmin 22 W
E max 11 E max 22 - E max 212 E max 11 E max 22 - E max 212 E max 11 E max 22 - E max 212 W
T X
R 0 V
S W
S 0 W
S E max 22 H 11 - E max 12 H 21 W
B3 = S 2 W,
S E max 11 E max 22 - E max 12 W
SS E max 11 H 21 - E max 21 H211 WW
E E - E max 12
TR max 11 max 22 X V
S0 0 1 0 W
S0 0 0 1 W
S E max 12 G 22 E max 12 Fmax 21 - E max 22 Fmax 11 E max 12 Fmax 22 - E max 22 Fmax 12 W
A 4 = S0 ,
S E max 11 E max 22 - E max 12
2
E max 11 E max 22 - E max 212 E max 11 E max 22 - E max 212 WW
SS0 - E max 11 G 22 E max 21 Fmax 11 - E max 11 Fmax 21 E max 21 Fmax 12 - E max 11 Fmax 22 W
E max 11 E max 22 - E max 212 E max 11 E max 22 - E max 212 E max 11 E max 22 - E max 212 W
T X
B4 = B3 .

Robust Controller the effort in the control input, ensure the stability [26]. The majority of the
Design Using LMIs a fast enough response time, yield a work done on the stability behavior
Students should follow the tutorial well-damped system response, and of dynamical systems is based on a
in “Linear Matrix Inequalities with are robust to uncertainties in the sys- formal definition of stability given by
Matlab’s Robust Control Toolbox” to tem model. Such requirements can be Lyapunov [32]. The Lyapunov stability
use the concepts developed in this formulated as convex optimization criterion can be expressed in the LMI
section and to try to reproduce the problems using LMIs [24]–[26]. This context as follows.
obtained results. Moreover, [28] and section presents some relevant results Given a linear time-invariant (LTI)
[29] provide insights on using Matlab to show how some typical problems in system
to numerically solve some common control theory can be solved with the xo = Ax + Bu,
LMIs in control systems. LMI approach. 
y = Cx, (20)
During the development of con-
trollers, a minimum requirement is to Quadratic Stability of an Uncertain a necessary and sufficient c­ondition
stabilize the system; however, it is often Plant Based on Lyapunov Function for all trajectories converge to the ori-
desirable that these controllers improve The most important feature of the gin (zero), (which means the system
performance in terms of optimizing behavior of a dynamical system is is stable) when t " 3, is the existence

126  IEEE CONTROL SYSTEMS MAGAZINE  »  JUNE 2016

Authorized licensed use limited to: American University of Beirut. Downloaded on April 30,2023 at 13:46:50 UTC from IEEE Xplore. Restrictions apply.
of a quadratic function (V (x) = x T P x, Q ! R n # n and a matrix Y ! R m # n hold, where Q 2 0 and Y satisfy the
P 2 0, for all x ! 0) decreasing along such that stability conditions [24].
any nontrivial trajectory. If such P
exists, the system LTI is quadratically AQ + QA T + BY + Y T B T 1 0, (24) Robustness
stable and function V is called a qua- The basic idea behind the robust sta-
dratic Lyapunov function [24]–[26]. where Y = KQ .  4 bility concept is to try to measure
Since Once this LMI has a feasible solu- how stable a system is in the pres-
tion for Q 2 0 and Y, then the qua- ence of some uncertainty or pertur-
d V (x) = x T (A (t) T P + PA (t)) x, dratic function V (x) = x T Q -1 x proves bation in the closed-loop system. If
dt
quadratic stability of system (20) with this same concept is applied in terms
a necessary and sufficient condition for linear state feedback u = - YQ -1 x. of a given level of acceptability of a
quadratic stability of an LTI system is The case with PLDI systems is specific performance criterion, such
a direct extension that is solved by as overshoot or settling time, this is
P 2 0, A T P + PA 1 0, for all A ! X, computing (24) at all the vertices of called robust performance [32]. When
(21) the convex polytope (14). This exten- the closed-loop system is robustly
sion ensures the quadratic stability of stable, the quadratic stabilization for
which represents the necessary condi- a uncertain parameter system if there the polytopic model can be guaran-
tion for the existence of the Lyapunov exists Q 2 0 and Y such that teed. This condition can be achieved
function in LMI form [24]–[26]. It is by considering the corresponding
often convenient to express (21) in an A i Q + QA Ti + B i Y + Y T B Ti 1 0, restrictions in the LMI formulation.

alternative way [24], [26]. Multiplying i = 1, f, L. (25) On the other hand, the closed-loop sys-
the second inequality in (21) left and tem with eigenvalue-placement con-
right by P -1, and defining a new vari- The quadratic stability condition can trol has robust performance because
able Q = P -1, (21) can be rewritten as also be interpreted as an invariant solving the corresponding LMIs for
ellipsoid. The ellipsoid this controller ensures the closed-
Q 2 0, QA T + AQ 1 0, for all A ! X. loop eigenvalues are within an LMI
 (22) f = "p ! R
n
p Q
T -1
p # 1 ,,  region (see the next section), and this
is equivalent to imposing a certain
This double inequality is equivalent to is invariant for the system (20) if, for performance criterion on the system.
the quadratic stability condition [24]– every trajectory x of the LDI, x (t 0) ! f Finally, LQR control minimizes a cost
[26]. For LTI and PLDI systems implies x (t) ! f for all t $ t 0 . This function that can be translated as a
»» LTI systems: P 2 0, A T P + statement is true if and only if (24), or minimization of the quadratic state
PA 1 0, or analogously Q 2 0, alternatively (25), is satisfied [24]. error considering constraints on the
AQ + QA T 1 0, control effort available. This con-
»» PLDI polytopic systems: P2 0, Constraints on the Variables trol scheme can be extended to poly-
A Ti P + PA i 1 0, i = 0, f, L, or When the initial condition is known, topic models using LMIs, and, in this
analogously an upper bound on the norm of the sense, the control presents a robust
control input u = - Kx can be found performance because it continues
as follows. Once the Q 2 0 and Y that complying with the performance cri-
  Q 2 0, QA Ti + A i Q 1 0, i = 0, f, L. satisfy the quadratic stability condi- terion even if there are variations in
(23) tion have been found, an additional system parameters.
constraint x (0) T Q -1 x (0) # 1, implies
Quadratic Stabilization that x (t) belongs to f for all t $ 0, and, Eigenvalue Placement
by Linear State Feedback consequently, Before stating the requirements for eigen-
The following theorem adapts the value placement in certain regions of the
quad­ ratic stability inequality (23) for max
t$0
u (t) = max
t$0
YQ -1 x (t) , complex plane, the LMI region concept is
a closed-loop system (20) with a linear # max YQ -1 x , defined [34].
x!
state feedback u = - Kx [24], [26]. The
f

1 1
proof of the theorem is given in [33] or = m max ` Q - 2 Y T YQ - 2 j . Definition 1
[25, Chap. 6]. A subset D of the complex plane is
Therefore, the constraint u (t) # n is called an LMI region if there exists
Theorem 1 guaranteed at all times t $ 0, if the LMIs a symmetric matrix L ! R m # m and a
System (20) can be stabilized by linear matrix M ! R m # m such that

 = G $ 0, = G $ 0, (26)
state feedback u = - Kx if and only 1 x (0) T Q YT
if there exists a symmetric matrix x (0) Q Y n2 I D = " z ! C: L + zM + zr M T 1 0 ,,

JUNE 2016  «  IEEE CONTROL SYSTEMS MAGAZINE  127

Authorized licensed use limited to: American University of Beirut. Downloaded on April 30,2023 at 13:46:50 UTC from IEEE Xplore. Restrictions apply.
Linear Matrix Inequalities with Matlab’s Robust Control Toolbox

R eference [29] presents the LMI Toolbox, which is included in ­structures) and by an additional structure matrix that con-
the Robust Control Toolbox in the latest versions of Matlab. tains specific information about the structure and corre-
This LMI toolbox has been designed to assist control engineers sponds to the second argument of lmivar syntax. Note that
and researchers with a user-friendly interac-
tive environment. Through this environment,
it is possible to specify and solve various
LMIs often found in engineering problems
[26]. The specification of an LMI system in-
volves two steps: declaring the dimensions
and structure of each matrix variable and de-
scribing the content of each term in the LMIs.
Matlab offers two ways of generating the in-
ternal description of a given LMI system:
• a command-based description by a se-
quence of lmivar/lmiterm commands
that build the LMI incrementally
• an LMI editor description by the lmiedit
command, where the LMIs can be speci-
fied directly as symbolic matrix expres- Figure S1  Description of matrix variables and linear matrix inequalities (LMI) as
sions by a graphical user interface (GUI). Matlab expressions in the graphical user interface of LMI editor description.
The first step is to evaluate the quadratic sta-
bility of the polytopic system using (23). An
infeasible solution is obtained due to the fact
that the open-loop system is unstable. After
that, a control law u = - Kx that stabilizes
the system is found from the LMI equations
for the eigenvalue-placement and LQR ap-
proaches. The initial conditions and upper
bound of the control input u = 9V in (26) can
also be satisfied.
The following steps show how to find con-
troller gains when using eigenvalue place-
ment in LMI regions.
1) Typing lmiedit in the command window of
Matlab and give a name to the LMI system
in the worksheet, in this case EigenLMIs.
2) Declare each matrix variable (name and
structure) in the upper half of the work-
sheet. The structure is characterized by
its type (S for symmetric block diago- Figure S2  Description of the linear matrix inequality system generated by lmivar/
nal, R for unstructured, and G for other lmiterm commands.

where the function a result, LMI regions are convex and Confining the closed-loop eigenval-
symmetric with respect to the real ues to this region ensures a mini-
fD (z) = L + zM + zr M T, axis of the complex plane. mum decay rate a, a minimum
An interesting region for control damping ratio g = cos i, and a maxi-
is the characteristic function of D. purposes is the set S (a, r, i) of complex mum undamped natural frequency
An LMI region is a subset of the numbers x + yj such that w d = r sin i [34]. The next theorem
complex plane that is representable provides a condition that restricts the
by an LMI in z y zr or, equivalently, an x 1 - a 1 0, x + yj 1 r, tan ix 1 - y . closed-loop eigenvalue to the region
LMI in x = Re (z) and y = Im (z) . As (27) S (a, r, i) [25], [26], [34].

128  IEEE CONTROL SYSTEMS MAGAZINE  »  JUNE 2016

Authorized licensed use limited to: American University of Beirut. Downloaded on April 30,2023 at 13:46:50 UTC from IEEE Xplore. Restrictions apply.
it is necessary to use one line for each array variable in the Y = dec2mat (PolesLMIs, xfeas, Y),
areas of text editing. K_poloslmi = Y/W.
3) Specify the LMIs as Matlab expressions in the lower half of
the worksheet. For instance, the LMI (28) is entered by ­typing This yields the equations W and Y found in the box at the bot-
tom of this sidebar, where W 2 0 is positive definite and the gain
W 2 0;
matrix K = YW - 1 is
A_i * W + W * A_il - B_i * Y – Yl * B_il + 2 * alfa * W 1 0;
K = 6- 0.0026 - 1.5075 - 0.0175 - 0.2326 0.0005@ .
and (26), (29), and (30) are entered, as shown in Figure S1.
Once the LMI system is fully specified, clicking the view For the case of LQR with LMIs constraints, the numerical
commands button shows the sequence of lmivar/lmiterm problem described by (26) and (36) is solved analogously using
commands needed to describe this LMI system, as shown the mincx command and the trace operator with the results of
in Figure S2. P and Y, found in the box at the bottom of the sidebar, where
Recall that Figures S1 and S2 only show LMI descriptions P 2 0 is positive definite and the gain matrix K = YQ - 1 is
for a single vertex of the polytopic system, but the polytopic
system has four vertices. Once the complete LMI system is K = 6- 0.0072 - 1.3851 - 0.0181 - 0.2298 0.0025@ .
described, three types of basic LMI problems can be solved
using the ­c ommands feasp, mincx, and gevp. In the case Thus, the gain matrix satisfies the LMI constraints while qua-
of pole placement in LMI regions, it is intended to solve a dratically stabilizing the closed-loop system. The gain matrix
feasibility problem, so the feasp syntax, which solves the reported in the literature for the simple LQR [18] is
feasibility problem defined by the system EigenLMIs can be
used. When the problem is feasible, the output xfeas is a K = 6- 0.0150 - 1.5698 - 0.0270 - 0.2325 0.0071@,
feasible value of the vector of (­s calar) decision variables.
These steps are and for the eigenvalue placement without integral term [17] is
[tmin, xfeas] = feasp (PolesLMIs);
W = dec2mat (PolesLMIs, xfeas, W), K = 6- 0.0075 - 1.4776 - 0.0226 - 0.1324@ .

R 823713.4328 56327.7536 - 680251.1018 - 326112.4245 1250408.7591VW


S
S 56327.7536 28511.4011 - 261122.3580 - 164956.8002 15520.9531W
W = SS- 680251.1018 - 261122.3580 2847006.3138 1487889.0651 3213.4952WW,
S- 326112.4245 - 164956.8002 1487889.0651 956379.5931 - 91658.1082W
S 1250408.7591 15520.9531 3213.4952 - 91658.1082 7416331.4479W
T X
Y = 61377.8228 - 164.0709 - 672.3299 885.3352 - 1673.3221@,

R 55640.1008 - 499.0107 - 29731.4429 2213.1898 3502.6265VW


S
S - 499.0107 78.3463 408.7464 - 411.7397 - 103.3359W
P = SS- 29731.4429 408.7464 383279.2671 - 23452.4578 47392.2934WW,
S 2213.1898 - 411.7397 - 23452.4578 4037.0795 73.5334W
S 3502.6265 - 103.3359 47392.2934 73.5334 99087.6544W
T X
Y = 6326.3348 - 17.9351 - 1772.9123 50.8749 - 503.7193@,

Theorem 2 and see (30), in the box at the bottom of


= G 1 0,
- rW WA Ti - Y T B Ti
The closed-loop eigenvalues of a sys- the page, where K = YW -1 is the state
Ai W - Bi Y - rW
tem (14) with state feedback u = - Kx  (29) feedback gain. 4
are within the region S (a, r, i) if there
exist matrices W = W T ! R n # n 2 0
and Y ! R m # n such that
= G1 0,   (30)
sin i (A i W + WA Ti - B i Y - Y T B Ti ) cos i (A i W - WA Ti - B i Y + Y T B Ti )
T T
A i W + WA - B i Y - Y T B + 2aW 1 0,
i i cos i (- A i W + WA Ti + B i Y - Y T B Ti ) sin i (A i W + WA Ti - B i Y - Y T B Ti )
(28)

JUNE 2016  «  IEEE CONTROL SYSTEMS MAGAZINE  129

Authorized licensed use limited to: American University of Beirut. Downloaded on April 30,2023 at 13:46:50 UTC from IEEE Xplore. Restrictions apply.
Therefore, the complete LMI for-
The ballbot is a skinny, agile, and omnidirectional mulation of the LQR problem is

robot that balances on, and is propelled by, min


P, K, X
Tr ^QP h + Tr ^X h,
subject to
a single spherical wheel. P 2 0,
A i P + PA Ti - B i Y - Y T B Ti + I 1 0,
i = 1, f, L
1

 = TX 1 R 2 YG 2 0. (36)
Linear Quadratic Regulator where the subscript i represents each Y R2 P
The LQR problem can be extended to vertex of the polytope.
polytopic systems through LMI restric- The optimal feedback gain K can Once this constrainted minimization
tions, allowing a solution for systems be found by solving is solved, the optimal LQR control-
with uncertain parameters. Consider- ler can be recovered by K = YP -1 .
ing a linear system with parametric 1 1 For details of the numerical solution
min Tr ^QP h + Tr ^R 2 KPK T R 2 h,
uncertainties P, K for the LMIs in controller design, see
subject to ^A i - B i K h P +  “Linear Matrix Inequalities with Mat-
xo = A (t) x + B (t) u, x (0) = x 0, (31)
P ^A i - B i K hT + I 1 0. (33) lab’s Robust Control Toolbox.”
the problem is finding a control law
by state feedback u = - Kx so that the Note that (33) is not linear because the Numerical and
cost function objective function involves the mul- Experimental Results
tiplication of variables P and K. So, a This section reports the numerical and
J= #0 3 ^x T Qx + u T Ruhdt  new variable is introduced Y = KP experimental results for the designed
and (33) is rewritten as controllers and robustness against
can be minimized. The cost function parametric uncertainties is proved.
1 1
in closed loop is min Tr ^QP h + Tr ^R 2 YP -1 Y T R 2 h, The authors hope that readers carry
P, K
out the experiments and simulations
subject to A i P + PA Ti - B i Y -
J= #0 3 ^x T ^Q + K T RKhxhdt.  to reproduce these results and see
Y T B Ti + I 1 0. them applied to a real system.
By using the trace operator Tr ($), (34) The general scheme for the pre-
which satisfies Tr (x T (Q + K T RK) x) = sented controllers is based on state
1 1
Tr ((Q + K T RK) xx T) [24], [26], the per- The nonlinear term ^R 2 YP -1 Y T R 2 h feedback plus an integral term of
formance index is equivalent to can be replaced by a second auxiliary state x1 as is shown in Figure 3. One of
1 1
variable X such that X 2 R 2 YP -1 Y T R 2 , the purposes of this article is to com-
J= #0 3 Tr ^^Q + K T RK h xx T h dt, which can be decomposed by the pare the controller’s performance

= Tr ^^Q + K T RK h P h, Schur complement [24] with variation in some parameter
values. To do this, parameter values
1 1
where P = # ^xx T h dt is a positive-
3
X - ^R 2 YP -1 Y T R 2 h 2 0 ,  for the NXT ballbot (see Table 2) and
0
definite symmetric matrix that satisfies gain values for classical LQR and
which is equivalent to eigenvalue-placement controllers
1
^ A i - B i K h P + P ^ A i - B i K hT + I = 0,
= TX 1 R YG 2 0. 
2 were taken from [18] and [20]. After
  (35)
i = 1, f, L, (32) Y R2 P that, moment of inertia Jm and friction

coefficient be of the servo motors are
changed from a minimum to a maxi-
mum value according to Table 1 to
verify the effect of these variations in
xref yref + + u x y the behavior of the closed-loop sys-
C ki x = Ax + Bu C
– tem. Finally, the LQR and eigenvalue-
+
placement controllers are tuned by
+
kf LMIs considering the NXT ballbot

polytopic model to add robustness
against parametric uncertainties to
the controllers.
Figure 3 The servo controller scheme. The control law is state feedback plus an integral The design of the controllers is
of the error of state x1, which represents the angular position with respect to the vertical. carried out using Matlab functions

130  IEEE CONTROL SYSTEMS MAGAZINE  »  JUNE 2016

Authorized licensed use limited to: American University of Beirut. Downloaded on April 30,2023 at 13:46:50 UTC from IEEE Xplore. Restrictions apply.
lqr and place. Numerical results were
obtained using Matlab, Simulink, and Table 2 NXT ballbot parameters used to synthesize the controllers and for
numerical simulations.
a supplement called Support Package for
LEGO MINDSTORMS NXT Hardware.
Parameter Value Parameter Value
The block diagram used for simula-
tion (and for experimental) purposes R a [X] 6.69 M s [kg] 0.013
is presented in Figure 4. L a [H] neglected R s [m] 0.026

Simulation Results for J m [kg·m 2] 10 # 10 - 6 J s [kg·m 2] 5.858 # 10 - 6


Classical Controllers b e [N·m·s] 2.2 # 10 - 3 M w [kg] 0.015
For all simulations, an initial value
of 2° was induced to the inclina- K p ; N·m E 0.317 R w [m] 0.021
A
tion angle } and the voltage input
for the servomotors was limited to 9 K b ; V·s E 0.468 L w [m] 0.022
rad
V because the NXT brick is supplied M b [kg] 0.682 J w 6kg·m 2@ 3.63 # 10 - 6
from six AA batteries. In Figure 5,
the numerical results for the closed- L [m] 0.17 J p 6kg·m 2@ 6.569 # 10 - 3
loop system with classical LQR are

pwm_z

pwm_x

Sim

NXT Ballbot Model Out

Coder
pwm_z
Environment
Controller of NXT Ballbot System Controller

pwm_x

NXT Ballbot Hardware


pwm_z pwm_z
0 Thetadot_ref_z
pwm_x pwm_x
1
Voltage Voltage
0 Thetadot_ref_x
Battery Battery
Reference Signal
Theta_Reference Theta_Reference
Sensor Signal
State_x State_x
Controller Monitor Real-Time Variables

Figure 4  A Simulink block diagram used to implement the control of the NXT ballbot in both numerical simulations and experimentally.
In simulation mode, the environment controller selects the NXT ballbot model, which contains the equations of the dynamical model of
the NXT ballbot, and receives the control signal (converted to pulse-width modulation) from the controller block; the output (the state
vector) is fed back to the controller. In experimental mode, the environment controller selects the NXT ballbot hardware, and the pro-
gram is run in external model. This NXT hardware block receives the control signal from controller block for the servomotors, and its
output is the gyrosensors signal of the real NXT ballbot.

JUNE 2016  «  IEEE CONTROL SYSTEMS MAGAZINE  131

Authorized licensed use limited to: American University of Beirut. Downloaded on April 30,2023 at 13:46:50 UTC from IEEE Xplore. Restrictions apply.
presented. This controller shows an
400
acceptable performance stabilizing
300 Nominal Vertex 1 Vertex 2
200 Vertex 3 Vertex 4 the NXT ballbot, but only for the nom-
θ (°)

100 inal model (with nominal parameters)


0 and at vertices 1 and 2 of the polytopic
−100 model given by (19). However, at ver-
0 5 10 15 20 25 30
tices 3 and 4, the controller is not able
10
to stabilize the system with the avail-
5
able control effort, that is, the con-
ψ (°)

0
troller is not robust to these changes
−5 in parameters.
−10 For the classical eigenvalue-place-
0 5 10 15 20 25 30
Time (s) ment controller, the same param-
eter variation cases as for LQR are
Figure 5 A closed-loop system response with a classical linear quadratic regulator
considered. In Figure 6, simulation
(LQR). The nominal model corresponds to parameters given in Table 2, and each vertex
corresponds to a combination of minimum and maximum values for the inertial and fric- results are shown. In the same way
tion parameters of the servomotors (Table 1). The control scheme is not able to stabilize as for LQR, the eigenvalue-placement
the system for all the possible values of the inertial and friction parameters of the servo- controller is not robust to parameter
motors. This means that classical LQR is not robust to parameter uncertainties. uncertainties. Moreover, the system
is not able to reach the zero reference
400 in the i state with the nominal model,
Nominal Vertex 1 Vertex 2 even for vertices 1 and 2.
200 Vertex 3 Vertex 4 These classical controllers are
θ (°)

0 tuned with the nominal model par­


ameters, and the numerical results
−100
0 5 10 15 20 25 30 show that their performance is highly
10 affected by variations in parameter
5 values. In the next section, the meth-
odology previously described to pro-
ψ (°)

0
−5
vide robustness to these controllers
against bounded parameter uncer-
−10
0 5 10 15 20 25 30 tainties is explored.
Time (s)

Figure 6  A closed-loop system response with classical eigenvalue-placement control. Simulation Results for
The control scheme is not able to stabilize the system for all possible values of the inertial LMI-Tuned Controllers
and friction parameters of the servomotors. This means that classical eigenvalue place- The LQR formulation can be extended
ment is not robust to parameter uncertainties. to polytopic systems by LMI constraints
to add robustness against parametric
200 uncertainties. The numerical problem
100 Nominal Vertex 1 Vertex 2 described by the constraints in (36) is
Vertex 3 Vertex 4 obtained by LMI solvers included in
θ (°)

0
the Robust Control Toolbox of Matlab
−100
[28], [29]. The first step is to evaluate
−200
0 5 10 15 20 25 30 the quadratic stability of the polytopic
10 system using (23). An infeasible solu-
5 tion is obtained due to the fact that
the open-loop system is unstable.
ψ (°)

0
−5
Next, a control law u = - Kx that sta-
bilizes the system is found from the
−10
0 5 10 15 20 25 30 LMI equations in the LQR approach
Time (s) with the additional constraint that the
upper bound of the control input is
Figure 7  A closed-loop system response with a linear quadratic regulator (LQR) tuned
by linear matrix inequalities. The control scheme is able to stabilize the system for all pos-
u = 9 V in (26). For details about the
sible values of the inertial and friction parameters of the servomotors. This means that use of Matlab’s Robust Control Tool-
tuning by linear matric inequalities provided robustness to uncertainties for LQR control. box to numerically solve this problem,

132  IEEE CONTROL SYSTEMS MAGAZINE  »  JUNE 2016

Authorized licensed use limited to: American University of Beirut. Downloaded on April 30,2023 at 13:46:50 UTC from IEEE Xplore. Restrictions apply.
see “Linear Matrix Inequalities with
­Matlab’s Robust ­Control Toolbox.” 800
600
In Figure 7, the simulation of the 400
200

θ (°)
LQR controller tuned with the LMI 0
method is presented. Unlike classical −200
−400
LQR, the controller tuned with LMIs −600
is able to stabilize the system even 0 5 10 15 20 25 30
when the inertial and friction param- 10
5 Nominal Vertex 1 Vertex 2 Vertex 3 Vertex 4
eters of the servomotors change from

ψ (°)
the minimum to maximum values 0
given in Table 1. −5
For the case of eigenvalue place- −10
0 5 10 15 20 25 30
ment, LMI equations (28)–(30) with
Time (s)
a = 0.01, r = 2000, i = 85c, and the
constraint for the control input (26) Figure 8  A closed-loop system response with eigenvalue placement tuned by linear ma-
with u = 9 V was formulated and trix inequality regions. The control scheme improves the classical eigenvalue-placement
solved with Matlab’s Robust Control controller by adding robustness to changes in servomotor parameters. This controller
Toolbox [28], [29] (for details refer to is able to stabilize the system for all values for the inertial and friction parameters of the
servomotors.
“Linear Matrix Inequalities with Mat-
lab’s Robust Control Toolbox”). So,
this gain matrix guarantees the LMI 200
constraints while quadratically stabi- 100 XY Plane ZY Plane
lizing the closed-loop system. 0
θ (°)

−100
The numerical results for eigenvalue −200
placement within LMI regions are pre- −300
−400
sented in Figure 8. Again, the use of 0 5 10 15 20 25 30
LMIs provides robustness to parametric 50
uncertainty to the classical eigenvalue- 25
0
placement controller. The controller tuned
ψ (°)

–25
using LMI regions is able to stabilize the −50
system even when inertial and friction −75
−100
parameters of the servomotors change 0 5 10 15 20 25 30
from the minimum to maximum values Time (s)
given in Table 1.
Figure 9  An experimental closed-loop system response with the classical linear qua-
dratic regulator. The controller is tuned at one vertex of the polytopic model and, as a
Experimental Results result, is not able to keep the NXT ballbot in balance.
Some experiments were carried out to
experimentally validate the obtained
numerical results. The block diagram 2000
used for experiments is depicted in 1500 XY Plane ZY Plane
1000
Figure 4. One advantage of Simulink
θ (°)

500
is the possibility of interacting in real 0
time with the sensors and actuators −500
−1000
from LEGO Mindstorms NXT via 0 5 10 15 20 25 30
Bluetooth communication between 50
the NXT brick and a PC. Once the con- 25
0
figuration is done, the Simulink pro-
ψ (°)

–25
gram is executed in external mode. −50
The classical LQR and eigenvalue- −75
−100
placement controllers were tuned on 0 5 10 15 20 25 30
vertex 1 of the NXT ballbot polytopic Time (s)
model. In Figures 9 and 10, the experi-
Figure 10 An experimental closed-loop system response with classical eigenvalue-
mental responses for both planes of placement control. The controller is tuned at one vertex of the polytopic model and, in the
motion are presented. In both cases, the same way as the classical linear quadratic regulator, is not able to keep the NXT ballbot
controllers are not able to stabilize in balance.

JUNE 2016  «  IEEE CONTROL SYSTEMS MAGAZINE  133

Authorized licensed use limited to: American University of Beirut. Downloaded on April 30,2023 at 13:46:50 UTC from IEEE Xplore. Restrictions apply.
with less oscillations in } than the LQR-
The NXT can be programmed in Matlab, which LMI though it still has some movement
in XZ plane.
makes it possible to take advantage of specific
Comparing Numerical and
toolboxes to solve LMI problems. Experimental Results
Figures 13 and 14 compare numeri-
cal and experimental results for the
closed-loop system in a plane. Some
differences in both figures can be
500
appreciated. It is necessary to take
0 into account that a mathematical
θ (°)

model is only an approximation of


−500
XY Plane ZY Plane the real system, so unmodeled effects
−1000 are always present and the control
0 5 10 15 20 25 30
system must be able to guarantee the
10
desired system performance even
5
with this kind of unknown dynam-
ψ (°)

0
ics. The differences between numeri-
−5 cal and experimental results may be
−10 caused by unmodeled dynamics such
0 5 10 15 20 25 30
Time (s) as the elasticity of the plastic ball and
the drive wheels, the possible slip-
Figure 11  An experimental closed-loop system response in both planes of motion for the page between the drive wheel and the
linear quadratic regulator tuned by linear matrix inequalities. Oscillations in i represent plastic ball, and even the uncertainty
the displacements in xz plane needed to keep the vertical equilibrium of the NXT ballbot. in other parameters not considered in
the polytopic model.

500 Conclusions
Control-systems design based on
dy­namic models is a common approach
θ (°)

0
in robotics and mechatronics, and the
controller performance can be affected
−500
0 5 10 15 20 25 30 by uncertainty in model parameters.
10 On the other hand, parametric uncer-
5 XY Plane XZ Plane tainty is always present in any model,
so it is necessary that the controller be
ψ (°)

0
able to deal with this problem.
−5
In this article, the tuning of lin-
−10
0 5 10 15 20 25 30 ear controllers by LMIs is presented
Time (s) to provide robustness against some
parametric uncertainties in the sys-
Figure 12 An experimental closed-loop system response in both planes of motion for tem model. One of the main limita-
eigenvalue-placement control tuned with linear matrix inequality regions. Oscillations in tions for LMIs is that the uncertain
i represent the displacements in xz plane needed to keep the vertical equilibrium of the
NXT ballbot.
parameters must appear linearly in
the system model. The NXT ballbot
was used as a case study. It is a version
the system and the NXT ballbot in the response. However, the control- of the original ballbot and represents
falls down. ler is able to keep the NXT ballbot in an interesting system for engineers
The robust control schemes were balance with the control effort avail- and researchers in mechatronics and
experimentally tested in similar condi- able. In a similar way, the eigenvalue- robotics areas because of its poten-
tions to the classical controllers. The placement controller tuned using LMI tial applications. Both numerical
closed-loop system response with LQR regions is experimentally validated by and experimental results show an
tuned by LMIs is depicted in Fig­u re the response presented in Figure 12. This improvement in the robustness of
11. Some oscillations can be observed controller stabilizes the NXT ballbot classical controllers. The LMI control

134  IEEE CONTROL SYSTEMS MAGAZINE  »  JUNE 2016

Authorized licensed use limited to: American University of Beirut. Downloaded on April 30,2023 at 13:46:50 UTC from IEEE Xplore. Restrictions apply.
scheme presented in this article can
be extended to include uncertainties The design of the controllers is carried out using
in other system parameters, to con-
sider state observers, and even to take Matlab functions lqr and place.
into account the disturbance rejection
problem. A video for the NXT ballbot
in closed loop with robust controllers,
including a test under external distur-
bances, is available [35].
600
In the opinion of the authors, LMIs Experimental Response Simulation Response
300
represent an accessible tool to solve

θ (°)
problems in robust control. The devel- 0
opment and results presented in this –300
article may be used to present this −600
0 5 10 15 20 25 30
LMI technique in control courses at
10
graduate and undergraduate levels
5
because, with the use of computa-
ψ (°)

0
tional tools (such as Matlab), the back-
ground in mathematics and numerical −5
methods needed to solve the LMI −10
0 5 10 15 20 25 30
constraints is not excessive. Moreover, Time (s)
the use of LEGO Mindstorms NXT in
practice and laboratory demonstra- Figure 13  A comparison of experimental and simulation results for the closed-loop sys-
tions is useful to motivate students to tem using linear quadratic regulator control with linear matrix inequalities.
implement the theoretical knowledge
acquired in the classroom on a real
system that can be easily reconfig-
ured and reprogrammed. In addition, 900
the NXT ballbot has been exhibited 600
at events such vocational guidance 300
θ (°)

fairs for high school students, confer- 0


ences, and at local robotics events. The –300
−600
NXT ballbot has had high acceptance 0 5 10 15 20 25 30
from both students and teachers. In 10
these demonstrations the authors 5 Experimental Response Simulation Response
explain the importance of studying
ψ (°)

0
mathematics, physics, and program-
−5
ming to raise the interest of students in
−10
automatic control. Moreover, with the 0 5 10 15 20 25 30
same LEGO Mindstorm NXT, another Time (s)
configuration of pendulum problem,
a wheeled, inverted-pendulum, Seg- Figure 14  A comparison of experimental and simulation results for the closed-loop sys-
tem using eigenvalue-placement control tuned with linear matrix inequality regions.
way-like robot, has been developed
and used to implement some control
techniques. Some preliminary results
are shown in [36]. ing from the Universidad Tecnológica gree in mechanical engineering from
de la Mixteca in Huajupan de León, the Universidad Autónoma Metro-
Acknowledgments Oaxaca, México. He is currently pur- politana, México, and the M.Sc. and
The authors would like to thank to suing the master’s degree in robotics Ph.D degrees in electrical engineer-
Kent Von Vlarblerghe for his support at the same university. His research ing (mechatronics) from CINVESTAV
in the manuscript’s revision. interests are in the design and con- (IPN), México. He is currently a titular
trol of mechatronic systems and mo- researcher in the Institute of Electron-
Author Information bile robots. ics and Mechatronics of the Univer-
Rafael A. García-García received the Manuel Arias-Montiel (mam@ sidad Tecnológica de la Mixteca in
B.S. degree in mechatronic engineer- mixteco.utm.mx) received the B.S. de- Oaxaca, México. He is an IEEE and

JUNE 2016  «  IEEE CONTROL SYSTEMS MAGAZINE  135

Authorized licensed use limited to: American University of Beirut. Downloaded on April 30,2023 at 13:46:50 UTC from IEEE Xplore. Restrictions apply.
[22] M. L. Pinto-Salamanca and G. R. Bermúdez-
Bohórquez, “Parameters determination of a
Control-systems design based on dynamic mobil robot of LEGO Mindstorms (in Spanish),”
Ingeniería Investigación y Desarrollo, vol. 5, no. 2,
models is a common approach in robotics pp. 7–13, 2007.

[23] R. A. García-García. (2014). Development


and mechatronics. of a robot ballbot-like for control applications
(in Spanish). [Online]. Bachelor thesis, Uni-
versidad Tecnológica de la Mixteca, México.
Ava i lable: ht t p://jupiter.ut m.m x/~te si s _
dig/12495.pdf
ASME member, and he is the author IFAC World Congr., Milano, Italy, Sept. 2011, pp.
[24] S. Boyd, L. El Ghaoui, E. Feron, and V. Bal-
of articles published in international 9818–9823.
akrishnan, Linear Matrix Inequalities in System
journals and conferences. His research [11] R. A. García-García and M. Arias-Montiel, and Control Theory. Philadelphia, PA: SIAM, 1994.

interests are in analysis and control of “A robust control scheme against some paramet-
[25] E. Ostertag, Mono and Multivariable Control
ric uncertainties for the NXT ballbot,” in Multi-
mechanical vibrations, mobile robots, body Mechatronic Systems, M. Ceccarelli and E. E.
and Estimation—Linear, Quadratic and LMI Meth-
ods. Berlin, Germany: Springer Verlag, 2011.
and rehabilitation robotics. Hernández Martínez, Eds. Switzerland: Springer
International, 2015, pp. 249–260. [26] D. Guang-Ren and Y. Hai-Hua, LMIs in Con-
trol Systems—Analysis, Design and Applications.
References [12] B. S. Heck, N. S. Clements, and A. A. Ferri, “A
Boca Raton, FL: CRC Press, 2013.
[1] J. L. Newcomer, “A design project based ap- LEGO experiment for embedded control system
proach to teaching automatic control theory to design,” IEEE Control Syst. Mag., vol. 24, no. 5, pp. [27] H. Hoang and M. Wongsaisuwan, “Robust
mechanical engineers,” in Proc. 28th Annu. Fron- 61–64, 2004. controller design for a rotary double inverted
tiers in Education Conf., Tempe, AZ, Nov. 1998, pp. pendulum using linear matrix inequalities,” in
[13] M. Pinto, A. P. Moreira, and A. Matos, “Lo-
1242–1245. Proc. SICE Annual Conf., Kagawa, Japan, Sept.
calization of mobile robots using an extended
2007, pp. 515–520.
[2] Y. Kim, “Control systems lab using a LEGO Kalman filter in a LEGO NXT,” IEEE Trans. Educ.,
Mindstorms NXT motor system,” IEEE Trans. vol. 55, no. 1, pp. 135–144, 2012. [28] Mathworks. Matlab Robust Control Toolbox.
Educ., vol. 54, no. 3, pp. 452–461, 2011. [Online]. Available: http://www.mathworks.com/
[14] S. Sánchez-Prieto, T. Arribas-Navarro,
help/robust/index.html (accessed Nov. 19. 2015)
[3] T. Alamo, J. E. Normey-Rico, M. R. Arahal, D. M. Gómez-Plaza, and O. Rodríguez-Polo, “A
Limon, and E. F. Camacho, “Introducing linear monoball robot based on LEGO Mindstorms,” [29] P. Gahinet, A. Nemirovski, A. J. Laub, and M.
matrix inequalities in a control course,” in Proc. IEEE Control Syst. Mag., vol. 32, no. 2, pp. 71–83, Chilali, LMI Control Toolbox: For Use with Matlab.
7th IFAC Symp. Advances in Control Education, Ma- 2012. Natick, MA: The Mathworks, Inc., 1995.
drid, Spain, June 2006, pp. 1–6.
[15] B. Bagnall, Maximum LEGO Nxt: Building Ro- [30] Z. Vukic, L. Kuljaca, D. Donlagic, and S. Tes-
[4] D. Qian, J. Yi, and S. Tong, “Understanding bots with Java Brains, 3rd ed. Winnipeg, Canada: njak, Nonlinear Control Systems. New York: Mar-
neighborhood of linearization in undergraduate Variant Press, 2013. cel Dekker, 2003.
control education,” IEEE Control Syst. Mag., vol.
[16] A. Behrens, L. Atorf, R. Schwann, B. Neu- [31] C. Olalla, A. R. Leyva, A. El Aroudi, and I.
33, no. 4, pp. 54–60, 2013.
man, R. Schnitzler, T. Herold, A. Telle, T. G. Noll, Queinnec, “Robust LQR control for PWM con-
[5] L. Qiu and K. Zhou, “Preclassical tools for K. Hameyer, and T. Aach, “MATLAB meets verters: An LMI approach,” IEEE Trans. Ind. Elec-
postmodern control,” IEEE Control Syst. Mag., LEGO Mindstorms—A freshman introduction tron., vol. 56, no. 7, pp. 2548–2558, 2009.
vol. 33, no. 4, pp. 26–38, 2013. course into practical engineering,” IEEE Trans.
Educ., vol. 53, no. 2, pp. 310–317, 2010. [32] D. Inman, Vibration with Control. West Sus-
[6] J. Figueiredo, V. Carvalho, J. Machado, and F. sex, U.K.: Wiley, 2006.
Soares, “Modelica modeling language as a tool [17] J. M. Gómez-de-Gabriel, A. Mandow, J.
on control engineering education: Simulation of Fernández-Lozano, and A. J. García-Cerezo, “Us- [33] C. Olalla, A. El Aroudi, R. Leyva, and I.
a two-tank system,” in Proc. 2014 Int. Conf. Teach- ing LEGO NXT mobile robots with labview for Queinnec, “LMI Robust of PWM converters: An
ing, Assessment and Learning, Wellington, Dec. undergraduate courses in mechatronics,” IEEE output-feedback approach,” in Recent Advances
2014, pp. 6–11. Trans. Educ, vol. 54, no. 1, pp. 41–47, 2011. in Robust Control—Theory and Applications in Ro-
botics and Electromechanics, A. Muller, Ed. Rijeka,
[7] X. Wang, X. Zhao, S. Wu, and H. Chen, “Edu- [18] Y. Yamamoto, NXT Ballbot Model-Based De- Croatia: InTech, 2011, pp. 317–342.
cation of computer simulation for control systems sign-Control of Self-balancing Robot on a Ball, Built
in Internet,” in Proc. Fifth Int. Conf. Power Electron- with LEGO Mindstorm NXT, 1st ed. Japan: Cyber- [34] M. Chilali and P. Gahinet, “H 3 design with
ics and Drive Systems, Nov. 2003, pp. 1050–1053. net Systems, 2009. pole placement constraints: an LMI approach,”
IEEE Trans. Autom. Control, vol. 41, no. 3, pp.
[8] Y. Zhang, M. T. Munir, W. Yu, and B. R. Young, [19] R. Hollis, “Ballbots,” Sci. Am., vol. 295, no. 4, 358–367, 1996.
“A real-time approach to process control educa- pp. 72–77, 2006.
tion with an open-ended simulation tool,” Educ. [35] R. A. García-García, M. Arias-Montiel. NXT
[20] P. T. Hernández-Cruz. (2010) Control of mo- ballbot control. [Online]. Available: http://www.
Chem. Eng., vol. 8, no. 3, pp. 105–112, 2013.
bile robots: The ballbot case (in Spanish). [Online]. youtube.com/watch?v=OIuE_GAn2Ww (ac-
[9] M. K. Jouaneh and W. J. Palm III, “Control sys- Bachelor thesis, Universidad Nacional Autónoma cessed Nov. 19. 2015)
tems take-home experiments,” IEEE Control Syst. de México, México. Available: http://132.248.9.195/
Mag., vol. 33, no. 4, pp. 44–53, 2013. ptb2010/noviembre/0664627/0664627_A1.pdf (ac- [36] R. A. García-García. Wheeled invert-
cessed Nov. 19. 2015) ed pendulum system (Segway NXT). [On-
[10] A. Bobstov, A. Pyrkin, S. Kolyubin, S. Che- line]. Available: https://www.youtube.com/
pinskiy, S. Shavetov, Y. Kapitanyuk, A. Titov, [21] P. Hurbain. LEGO 9V Technic Motors com- watch?v=DLzuwzrkJoE (accessed Nov. 19. 2015)
M. Surov, and V. Bardov, “Using of LEGO pared characteristics. [Online]. Available: http://
Mindstorms NXT technology for teaching of www.philohome.com/motors/motorcomp.htm
basics of adaptive control theory,” in Proc. 18th (accessed Nov. 19. 2015) 

136  IEEE CONTROL SYSTEMS MAGAZINE  »  JUNE 2016

Authorized licensed use limited to: American University of Beirut. Downloaded on April 30,2023 at 13:46:50 UTC from IEEE Xplore. Restrictions apply.

You might also like