You are on page 1of 12

International Journal of Control

Vol. 83, No. 6, June 2010, 11551166


Trajectory tracking for the magnetic ball levitation system via exact
feedforward linearisation and GPI control
R. Morales
a
*
and H. Sira-Ram rez
b
a
Department of Electric, Electronics and Automation, School of Industrial Engineering, University of Castilla-La Mancha,
02071 Albacete, Spain;
b
Mechatronics Department, Centro de Investigacion y Estudios Avanzados del Instituto
Politecnico Nacional, 07300, Mexico City, DF, Mexico
(Received 18 May 2009; final version received 21 January 2010)
The output feedback control of the popular magnetic ball levitation system is addressed from a suitable
combination of several complementary viewpoints. We use: first, recent developments on exact feedforward
linearisation controllers for nonlinear flat systems to substantially reduce the linear feedback controller efforts
through pre-compensation. Second, an on-line ball velocity estimation strategy is proposed by using a model-
based integral reconstructor, which is a linear combination of iterated integrals of the input and the output of the
system, thus avoiding the use of traditional observers or noisy derivative estimations. Finally, we use a
generalised proportional integral (GPI) controller which compensates the errors in the integral reconstructor and
further bestows the enhanced robustness on the closed-loop system via output tracking error iterated integration
feedback. This methodology only requires the measurements of the position of the levitated ball and of the
control input voltage. The proposed feedback regulation scheme is shown to locally guarantee an asymptotically
exponentially stable behaviour of the controlled ball position and, definitely, allows for the possibilities of safely
carrying out the rest-to-rest trajectory tracking tasks on the ball position. The proposed output feedback
controller is actually implemented on a laboratory prototype with excellent experimental results for, both,
stabilisation and trajectory tracking tasks.
Keywords: magnetic levitation systems; GPI control; exact feedforward linearisation
1. Introduction
The feedback control of the magnetically suspended
ball has received a great deal of attention from a
number of controller design approaches. The magnetic
suspension system has become rather popular demon-
strative item in elementary, linear and advanced
nonlinear control courses and academic control engi-
neering laboratories around the world (Lilienkamp
2004; Lundberg, Lilienkamp, and Marsden 2004). The
popularity of this nonlinear system is due to the
relative ease with which the actual system is built and
handled. The magnetic suspension system is a typically
nonlinear, unstable, system with a controllable tangent
linearisation. Typically, PID or PD controllers are
proposed for the effective regulation of the system,
under the assumption of a perfectly known gain
parameter as in Golob and Tovornika (2003).
Strangely enough, not many articles are devoted to
the issue of output trajectory tracking tasks for the
suspended metallic ball producing controlled motions
of the ball such as rest-to-rest, or sinusoidal, position
reference trajectories. Clearly, the prevailing
nonlinearities and the inherent instability of the
system preclude the classical PID controllers to be
used for these more complex tasks. Typically, in a
trajectory tracking task, the gain of the system is no
longer constant and it is a function of the changing
distance to the magnet.
Integral reconstructors for state variables determi-
nation in linear, and some nonlinear systems, consti-
tute an easy to implement alternative over traditional
observers and derivative estimators through sampling.
Integral reconstructors were introduced by Fliess,
Ma rquez, Delaleau, and Sira-Ram rez (2002) in the
context of the generalised proportional integral (GPI)
control and have been used elsewhere in a number of
applications (see, for instance, Sira-Ram rez and Silva-
Navarro (2002), Sira-Ram rez (2003) and the recent
article by Becedas, Trapero, Feliu, and Sira-Ram rez
(2009)). Integral reconstructors are regarded as model-
based structural state estimators using only linear
combinations of iterated integrals of inputs and
outputs (i.e. they are iterated integral inputoutput
parameterisations of the states modulo initial
*Corresponding author. Email: Rafael.Morales@uclm.es
ISSN 00207179 print/ISSN 13665820 online
2010 Taylor & Francis
DOI: 10.1080/00207171003642196
http://www.informaworld.com
conditions and other perturbation effects). The use of
state reconstructors requires the enhancement of the
controller time polynomial perturbation rejection
properties through iterated integrations of the output
tracking error signal.
In this article, we undertake the problems of
regulation and output trajectory tracking for ball
position in the magnetic levitation system. We use an
exact feedforward linearisation controller based on
differential flatness combined with a structural deriv-
ative estimate (or integral reconstructor) of the ball
velocity based on the direct integration of the system
dynamics and, finally, the use of a GPI control
enhancement strategy. The proposed approach exploits
the traditional linear state feedback, but uses no state
measurements and no asymptotic state observers. The
effect of the neglected initial conditions and of classical
perturbation inputs is later compensated, using super-
position principle, via sufficient number of iterated
integrations of the output tracking error. The dynamic
feedback control scheme is found to be internally
exponentially asymptotically stable via a suitable and
natural nesting of the open-loop integrations. These
controllers exhibit a robust closed-loop system behav-
iour in, both, the tracking or in the stabilisation tasks
for the corresponding, externally perturbed, output
error dynamics.
This article is organised as follows. Section 2
presents the model of the magnetic levitation system
and the problem formulation. Section 3 is devoted to
derive the exact feedforward linearisation controller
based on differential flatness to be used in the control
of the suspended ball, under the assumption of perfect
knowledge of the system gain parameter. The ball
velocity estimation is carried by means of a model-
based integral reconstructor complemented with a GPI
controller. In this section, it is proved that the
proposed controller produces an asymptotically expo-
nentially convergent tracking error behaviour towards
the origin of coordinates in the error space. In
Section 4, simulations of the proposed control system
were carried out, showing an excellent behaviour of the
system response (even in the case of high level of noise
in the input control signal) in both stabilisation and
tracking trajectory tasks. Section 5 describes the
experimental setup in the laboratory and presents the
experimental results obtained with the proposed con-
trol algorithm. Finally, Section 6 is devoted to the
conclusions of this article as well as proposals for
future work.
2. The magnetic ball levitation system and problem
formulation
2.1 The system dynamics
Consider the following well-known dynamic model of
the magnetic levitation system (Figure 1):
m y mg
Ki
2
y
2
1
i Cu 2
where m is the mass of the levitated ball, g denotes the
acceleration due to the gravity, y is the distance of the
ball from the electromagnet, u is the control input
voltage, C is the constant related to the input voltage
and the current through the coil and K is a constant
related to the mutual inductance of the ball and
coupling coefficients. Substituting (2) into (1) and
carrying out a normalisation procedure, the previous
equation yields:
y g
KC
2
m
u
2
y
2
3
Define the parameter [
KC
2
m
. Substituting this
expression into (3), we obtain
y g [
u
2
y
2
4
Figure 1. Magnetic levitation system diagram.
1156 R. Morales and H. Sira-Ramrez
2.2 Problem formulation
Consider the previously described nonlinear magnetic
levitation system (3). Given a desired smooth trajec-
tory, y

(t), for the ball position, y, and given the,


possibly noisy, measurements of the input signal, u,
and of the output signal, y, devise an output feedback
controller, for the specification of the control input u,
which guarantees the asymptotic tracking of y

(t) by
means of the system output y.
3. Controller design
A new class of nonlinear controllers for nonlinear
systems was proposed by Hagenmeyer and Delaleau
(2003a) (with further interesting developments found
in Hagenmeyer and Delaleau (2003b) and Hagenmeyer
and Delaleau (2008)) for the special, but widespread,
case of differentially flat systems. Differential flatness
was introduced by Fliess, Le vine, Martin, and
Rouchon (1995), as a natural generalisation, to the
nonlinear setting, of the concept of linear controll-
ability (see also Sira-Ram rez and Agrawal 2004). For
the most common case of affine in the control systems,
the controllers provided by the concept of flatness turn
out to be linear, time-varying, controllers which may
be used in combination with some complementary
feedback methods designed for controlling perturbed
chains of integrations of the same order as the original
nonlinear system. The developments are based on the
following ideas which, we show, bring about a rather
popular control method for controlling nonlinear
systems; namely, the approximate linearisation
method, but with an enhancement twist.
The GPI controllers provide a nice class of linear
output feedback controllers for linear systems.
However, they are also effective and applicable in a
special class of nonlinear systems, as it is, very
particularly, the case of the ball levitation system.
They are based on the defective integral reconstruction
of the state which, a priori, neglects the effects of
unknown initial conditions and the effect of possible
classical perturbation inputs (constant and low-order
time polynomial errors, such as ramps and parabolic
signals). They are based on the key observation that
the states of observable linear systems may be
integrally parameterised in terms of inputs and outputs
alone (i.e. linear combinations of inputs, outputs and
of a finite number of iterated integrals of signals). The
errors of integral reconstruction are to be compen-
sated, later, by a suitable linear controller containing a
sufficient number of iterated integrals of the tracking
error, or of the input error (see Fliess et al. (2002)
for details).
3.1 Exact feedforward linearisation of flat systems
Suppose a given SISO nonlinear system of the form
_ x f x, u, x(t) 2R
n
, u(t) 2R, is differentially flat, with
flat output given by the scalar output variable y(t) 2R
(the results extend, quite directly, to the MIMO case as
well). The output y is a flat output if it is a function of
the states, say y h(x), which allows for the following
differential parameterisation of the states, x, and of the
control input u, in terms of a differential function of y
(i.e. a function of y and of a finite number of its time
derivatives),
x A y, _ y, y, . . . , y
n1
, u B y, _ y, y, . . . , y
n
_ _
5
In Hagenmeyer and Delaleau (2003a), the authors
propose the following control scheme for tracking any
smooth trajectory y

(t), with corresponding nominal


control input given by
u

t B y

, _ y

, y

, . . . , y

n
_ _
6
Set the control input u as
u B y

, _ y

, y

, . . . , y

n1
, v
_ _
7
with v being a flatness controller that renders the origin
of the tracking error space e y y

(t) into an
exponentially asymptotically stable equilibrium point
for the n-th order integrator system
y
n
v 8
Using the results about the exact feedforward
linearisation based on the differential flatness, pro-
posed by Hagenmeyer and Delaleau, the approach
yields the following feedback control scheme for the
system, _ x f x, u, y hx:
ut B y

, _ y

, y

, . . . , y

n1
, v
_ _
9
v y

t
n
k
n1
_
y
n1
y

t
n1
t
_
k
n2
_
y
n2
y

t
n2
t
_
k
2
y y

t k
1
_ y _ y

t
k
0
y y

t 10
In particular, for the most common case of systems
which are affine in the control input, i.e. of the form
_ x f x gxu, it is easy to show that the control
input differential parameterisation, provided by the
flatness property, is also affine in the highest order
time derivative of the flat output. We have
u y

, _ y

, y

, . . . , y

n1
_ _
j y

, _ y

, y

, . . . , y

n1
_ _ _ _
y
n
11
For these systems, the HagenmeyerDelaleau
output feedback controller is clearly linear and time
International Journal of Control 1157
varying. Indeed, we have
u y

, _ y

, y

, . . . , y

n1
_ _
j y

, _ y

, y

, . . . , y

n1
_ _ _ _
v
,
1
t ,
2
tv 12
v y

t
n
k
n1
s
n1
k
n2
s
n2
. . . k
0
_ _
y y

t
13
It is rigorously shown in Hagenmeyer and Delaleau
(2003a) that such an output feedback controller locally
stabilises the controlled flat output trajectory towards
the desired given reference trajectory y

(t). Indeed, if
we substitute the control signal v given by (13) into
(12), we readily obtain
u u

t ,
2
t k
n1
s
n1
k
n2
s
n2
k
0
_ _
yy

t
14
i.e. we are controlling the nonlinear system with a
variant of the classical approximate linearisation phi-
losophy which injects the nominal control input u

(t)
and complements it with the output of a classical
compensation network controller acting on the incre-
mental output tracking error. The only difference with
the classical feedback control scheme of the approxi-
mate linearisation-based control is the presence of the
time-varying modulation factor ,
2
(t) affecting the
incremental classical controller.
This result, which might have been intuitively
known for several decades and used extensively in the
control of industrial processes in various forms, is at
the heart of the possibilities of designing linear,
time-varying, output feedback controllers whose
models are, formally, differentially flat.
3.2 An exact feedforward linearisation controller for
the magnetic levitation system
Considering the normalised dynamical model of the
magnetic levitation system presented in (4), we observe
that the system is flat, with the flat output given by the
distance of the ball from the electromagnet, y, i.e. given
by the ball position (except at y 0 that the system is
singular). The differential parameterisation of the
control input is clearly given by
u y

g y
[
_
, or u
2
y
2
g y
[
_ _
15
Suppose it is desired to transfer the system from an
initial equilibrium, " y
i
, to a final equilibrium, " y
f
. We
then prescribe a nominal trajectory y

(t) smoothly
taking the flat output, during a finite interval of the
form [t
i
, t
f
], from the given initial value y

t
i
" y
i
towards the desired final value y

t
f
" y
f
. We set, for
instance,
y

t " y
i
" y
f
" y
i
_ _
t, t
f
, t
i
16
with (t, t
f
, t
i
) being a Be zier polynomial smoothly
interpolating between 0 and 1 in the prescribed time
interval [t
i
, t
f
]. We choose, here, a 16th-order Be zier
polynomial:
t, t
i
, t
f

0 for t 5t
i
t t
i
t
f
t
i
_ _
8
r
1
r
2
t t
i
t
f
t
i
_ _
r
3
t t
i
t
f
t
i
_ _
2
r
9
t t
i
t
f
t
i
_ _
8
_ _
for t
i
t t
f
1 for t 4t
f
_

_
17
where:
r
1
12870 r
2
91520 r
3
288288
r
4
524160 r
5
600600 r
6
443520
r
7
205920 r
8
54912 r
9
6435
18
The HagenmeyerDelaleau feedforward controller
design technique for this system results is the following
time-varying controller:
ut y

gv
[
_
, or, u
2
t y

t
2
gv
[
_ _
19
where the auxiliary control signal v, which evidently
satisfies v

t y

t and v g, is synthesised as a
flatness-based controller for trajectory tracking. The
final expression for the auxiliary input variable v is
presented now:
v y

t k
3
_ y _ y

t k
2
y y

t 20
Upon appropriate choice of the design parameters
k
3
and k
2
, the preceding controller imposes the
following exponentially asymptotically stable closed-
loop dynamics on the tracking error e(t) y y

(t):
et k
3
_ et k
2
et 0 21
We conclude this section by stating the following
proposition, proved in the above developments.
Proposition 3.1: Given the nonlinear dynamics of the
magnetic levitation system (4), where it is assumed that
the ball velocity, _ y, is perfectly measurable, and given a
smooth reference trajectory y

(t) for the ball position, y,


then, under the appropriate choice of the design
parameters k
3
and k
2
, so that the characteristic polyno-
mial of the closed-loop linear system, p(s)
s
2
k
3
s k
2
, is a Hurwitz polynomial, the controller
(19)(20) provides the desired tracking error equilibrium
1158 R. Morales and H. Sira-Ramrez
point, e y y

(t) 0, with an exponentially asympto-


tically stable nature.
The next section provides an alternative comple-
mentary design which requires no perfect knowledge of
the ball velocity.
3.3 An integral reconstructor for the ball velocity and
a GPI controller
The tracking controller (19) and (20) requires the
knowledge of the velocity of the ball, _ y. This means
that such a variable has to be either measured, or
estimated by means of an observer. In practice, the
estimation requires the use of on-line calculations
based on high-frequency samples of the position
variable trajectory y(t). While using the proposed
velocity estimator based on the integration of the
system dynamics, such estimations, or time discretisa-
tions, are unnecessary.
Indeed, suppose that only the distance of the ball
from the electromagnet y(t) and the input control u(t)
are available for measurement. In order to design a
controller robust with respect to constant perturbation
loads, we assume that the system dynamics (4) is
affected by a constant perturbation with an
unknown value. In this case, the velocity of the
suspended ball, _ yt, can be directly established
from (4), as
_ y g t [
_
t
0
u
2
o
y
2
o
do _ y0 22
where _ y0 is the value of the ball velocity, at time t 0.
Such information, however, is usually not available
either and we can only assume that this quantity is
known in the simplest of cases (i.e. when it is known
that the ball starts with zero velocity). Therefore, we
have no knowledge of _ y0.
Suppose, for a moment, that motivated by the
simplicity of (22), we insist upon using the following
faulty estimate, or structural estimate of the ball
velocity, _ y,

_ yt [
_
t
0
u
2
o
y
2
o
do 23
Certainly, the estimate (23) has the interesting
advantage of being easily synthesised using only the
integral of a nonlinear function of the input, u(t), and
the output, y(t). Evidently, the exact relationship
linking the structural estimate
_
^ yt to the actual value
of the ball velocity, _ yt, is given by
_ yt

_ yt g t _ y0 24
Therefore, if we use (23) in the controller expression
(19), we obtain the following equivalent feedback law:
ut y

gv
[
_
v y

t k
3

_ y _ y

t
_ _
k
2
yy

t
y

t k
3
[
_
t
0
u
2
o
y
2
o
do _ y

t
_ _
k
2
yy

t
25
When the feedback control law (25) is used on the
system (4), one obtains, after the use of (24), the
following closed-loop trajectory tracking error
dynamics:
et k
3
_ et k
2
et k
3
_ y0 g t 26
which exhibits a combination of ramp error due to the
gravity action and the constant perturbation load and
an off-set error due to the constant initial condition
excitation of the asymptotically stable tracking error
dynamics. This immediately prompts us to consider the
possibility of using a modified nonlinear feedback
controller including an integral error term and a double
integral error term which rejects these perturbation
loads. We thus proceed to propose the following
controller:
ut y

g v
[
_
v y

t k
3
[
_
t
0
u
2
o
y
2
o
do _ y

t
_ _
k
2
y y

t k
1
_
t
0
y y

o do
k
0
_
t
0
_
o
0
y y

z dz do 27
Figure 2 illustrates the proposed control scheme.
The use of (23)(24) on the modified controller
expression, (27), results upon substitution on Equation
(4) and differentiating twice in the following fourth-
order linear tracking error dynamics:
e
4
k
3
e
3
k
2
e k
1
_ e k
0
e 0 28
The set of design coefficients {k
3
, k
2
, k
1
, k
0
} are
chosen so as to render the closed-loop characteristic
polynomial,
ps s
4
k
3
s
3
k
2
s
2
k
1
s k
0
29
into a Hurwitz polynomial with desirable roots. In
order to specify the parameters {k
3
, k
2
, k
1
, k
0
}, we
locate the desired loop poles in the left half of the
complex plane. All four poles can be located in the
same point of the real line, s a, with a being a
strictly positive constant parameter. We obtain the
International Journal of Control 1159
following polynomial equation:
ps s a
4
s
4
4as
3
6a
2
s
2
4a
3
s a
4
30
where the parameter a represents the desired location
of the poles. Identifying each term of the expression
(29) with those of (30), we directly obtain the required
value for the set of coefficients {k
3
, k
2
, k
1
, k
0
}. These
are given by
k
3
4a, k
2
6a
2
, k
1
4a
3
, k
0
a
4
. 31
We conclude by stating our main result, which has
been proved throughout the previous exposition.
Proposition 3.2: Given a smooth reference trajectory,
y

(t), for the ball position, y, in the nonlinear magnetic


levitation system dynamics:
y g [
u
2
y
2
32
and assuming that only measurements of the ball
position, y, and of the applied control input u, are
available, then, the feedback controller:
ut y

g v
[
_
v y

t k
3
[
_
t
0
u
2
o
y
2
o
do _ y

t
_ _
k
2
y y

t k
1
_
t
0
y y

o do
k
0
_
t
0
_
o
0
y y

z dzdo 33
produces a closed-loop behaviour of the tracking error,
e y y

(t), which is locally governed by the linear


dynamics
e
4
k
3
e
3
k
2
e k
1
_ e k
0
e 0 34
whose design coefficients can be chosen so as to render
the origin of the tracking error space into an exponential
asymptotically equilibrium point.
4. Simulation results
Numerical simulations were carried out in order to
evaluate the performance of the proposed controller
for the magnetic levitation system. The major problems
associated with the control of this particular system are
the strong open-loop instability and inherent nonlinea-
rities. In the simulations, we consider the following
parameters: gravity acceleration g 9.81 m,s
2
, voltage
constant C 1.05 A,V, mass of the levitated
ball m0.02 kg and constant related to the mutual
inductance of the ball and coupling coefficients
K 2.48315625 10
5
Nm
2
,A
2
. Then, [
0.00136884 Nm
2
,kg V
2
. In order to design the gains
of the controller, the poles can be located in a
reasonable location of the negative real axis. In our
numerical simulations we have located the closed-loop
poles at a 70, and the value of the set of coefficients
{k
3
, k
2
, k
1
, k
0
} were obtained from the expressions
in (31). The proposed controller, previously presented
Magnetic
levitation
system
k
0

u
y
k
1
k
2
k
3
()
()
()
()
()
()
2

+
+
+
+
+

+
+
+
v
g
b
b
y*
.
y*
..
y*
Figure 2. Designed control scheme.
1160 R. Morales and H. Sira-Ramrez
in Section 3, was used in the simulations. At the
beginning of the simulation, the magnetic ball started
in a certain arbitrary position and was controlled to
follow a desired trajectory prescribed by y

(t). The
desired reference trajectory used was specified in (16)
as a Be ziers 16th-order polynomial where
" y
i
2.09 10
3
, " y
f
0.97 10
3
, t
i
0.25 s and
t
f
5.25 s.
We tested the performance of the proposed con-
troller with respect to the measurement noises and
found it to be quite robust with respect to such
perturbations. We considered the control signal u(t) as
u(t) u(t) n(t), where n(t) is a normally distributed
random process with zero mean and whose standard
deviation is varied from 0 to 1 10
1
in order to show
the effect that the noise produces in the estimation
system. Three graphs are shown in Figure 3(a)(c)
which illustrate the input control signal u(t) with
different levels of noise. It can be seen in these graphs
that the main problems appear at the beginning of the
simulation. This is because we are controlling an
unstable system and these kind of systems show a
controlled response with an overshoot around the
initial time. The feedback control input u(t) tends to
compensate this momentary drift by exerting a large
feedback control action. Figure 3(a) depicts the input
signal u(t) when the standard deviation of the signal
n(t) is null. Figure 3(b) and (c) illustrate the control
signal u(t) with the noise standard deviations 1 10
2
and 1 10
1
, respectively. The signals can be com-
pared and it is obvious that the noise strongly affects
the dynamic behaviour of the system. Moreover,
Figures 4 and 5 illustrate the trajectory tracking of
the levitated ball and the tracking error, e(t), in the
different simulations with the different levels of noise
defined previously. It can be observed in these figures
that a good stabilisation of the levitated ball and an
accurate tracking trajectory are achieved in the three
simulations. Moreover, Figure 5 depicts that the
tracking error increases when the spread level of
noise increases.
5. Experimental results
In this section, we carry out an experimental imple-
mentation to assess the performance of the proposed
control algorithm in an actual magnetic levitation
system. In the following subsections, we proceed to
briefly explain the experimental platform and the
software tools. Finally, a comparison between a
standard PID controller and the proposed control
law is carried out in order to show the improvements of
the designed control law in a simultaneous stabilisation
and trajectory tracking task.
5.1 Experimental setup
The magnetic levitation system (Maglev) used in the
experiments is shown in Figure 6. Due to strong
open-loop instability and inherent nonlinearities, this
attraction-type levitation system is a quite challenging
plant. The structure of the magnetic levitation system
is composed of the mechanical unit (model Feedback

0 1 2 3 4 5 6 7
0
2
4
t (s)
t (s)
t (s)
u
(
t
)
(
V
)
u
(
t
)
(
V
)
u
(
t
)
(
V
)


u(t)
0 1 2 3 4 5 6 7
0
2
4


u(t)
0 1 2 3 4 5 6 7
0
2
4


u(t)
Figure 3. Control input, u(t), of the magnetic levitation system. (a) u(t) when noise standard deviation is 0; (b) u(t) when the
noise standard deviation is 1 10
2
; (c) u(t) when the noise standard deviation is 1 10
1
.
International Journal of Control 1161
33-210), labelled by the number 1 in Figure 6, and an
Analogue Control Interface (Feedback

model
33-301), labelled by the number 2 in Figure 6, which
is used to transfer, back and forth, signals from the PC
to Maglev. The mechanical unit and the control
interface should be linked to each other with lead
connections. On the other hand, we have inserted into
a PCI computer slot the Advanced

PCI1711 I/O Card


(labelled as 3 in Figure 6), and connected with the
Feedback

SCSI Adapter Box (labelled by a the


number 4 in Figure 6) using the SCSI cable. The
control law implemented in the PC (operating in a
Windows

environment) uses software tools from


Mathworks

Inc. These include MATLAB

,
Simulink, Control Toolbox, Real Time Workshop

(RTW), Real Time Windows Target

(RTWT) and
0 1 2 3 4 5 6 7
2
1
0
1
x 10
3
e
(
t
)
(
m
)
e
(
t
)
(
m
)
e
(
t
)
(
m
)


0 1 2 3 4 5 6 7
2
1
0
1
x 10
3


0 1 2 3 4 5 6 7
2
1
0
1
x 10
3


e(t)
e(t)
e(t)
t (s)
t (s)
t (s)
Figure 5. Evolution of tracking error trajectory, e(t) y y

(t), of the magnetic ball. (a) e(t) when the noise standard deviation
is 0; (b) e(t) when the noise standard deviation is 1 10
2
; (c) e(t) when the noise standard deviation is 1 10
1
.
0 1 2 3 4 5 6 7
0
0.01
0.02
0.03


y

(t)
y(t)
0 1 2 3 4 5 6 7
0
0.01
0.02
0.03


0 1 2 3 4 5 6 7
0
0.01
0.02
0.03


t (s)
t (s)
t (s)
y
(
t
)
(
m
)
y
(
t
)
(
m
)
y
(
t
)
(
m
)
y

(t)
y(t)
y

(t)
y(t)
Figure 4. Evolution of the tracking trajectory of the magnetic ball. (a) y(t) and y

(t) when noise standard deviation is 0; (b) y(t)


and y

(t) when the noise standard deviation is 1 10


2
; (c) y(t) and y

(t) when the noise standard deviation is 1 10


1
.
1162 R. Morales and H. Sira-Ramrez
Visual C

Professional

. The steps necessary to


obtain the executable file from the control law model
are shown in Figure 7. MATLAB

acts as the
application host environment, in which the other
Mathworks

products run. This package offers an


extensive state-of-the-art control design toolboxes.
Simulink

provides a user-friendly, well-structured,


graphical interface for the implementation of the
control law. Real Time Workshop

automatically
builds a C

source program from the Simulink


Model. The C

Compiler

compiles and links the


code created by Real Time Workshop

to produce an
executable program. Real Time Windows Target

communicates with the executable program acting as


the Control Program, and interfaces with the hardware
device though the I/O Board. Real Time Windows
Target

controls the two-way data, or signal flow, to


and from the model (now being an executable pro-
gram), and to and from the I/O Board. The advantage
of this approach is that the designer only needs to
model the process using the graphics tools available in
Simulink

, without being concerned with the mechan-


ics of communication to and from the control plat-
form. Finally, the parameters taken in the previous
section are one of the experimental setup, and the
resolution of V
sensor
shown in Figure 1 is 5 10
3
V.
5.2 Experimental results using a PID controller
The magnetic levitation system used in the trials is a
typically nonlinear, unstable, system with a control-
lable tangent linearisation. In this experiment, we use a
PID controller for the effective regulation of the real
system. Figure 8 shows the closed-loop control scheme
used in this experiment.
If we define the equilibrium point by u " u,
operating with expression (4), we have the following
working point:
g [
" u
2
" y
2
0 ! " y
[

g
p " u 35
Linearising the system (4) around the working
point and applying the Laplaces transform, we have
the following result:
Y
o
s
U
o
s

C
1
s
2
C
2
36
where C
1
2
[" u
" y
2
, C
2
2
[" u
2
" y
3
and ()
o
represent the
incremental variables. Using the control scheme
Simulink model
C
code
Executable
program
Real time
parameters changes
Real Time
Workshop
Real Time
Windows Target
I/O Board
Magnetic
levitation
system
Figure 7. Control system development flow diagram.
Figure 6. Experimental platform.
International Journal of Control 1163
visualised in Figure 8 and the magnetic levitation
system linearised (expression (36)), after certain calcu-
lations, we obtain the closed-loop transfer function
which is shown next:
Y
o
s
Y

o
s

K
d
s
2
K
p
s K
i
_ _
C
1
s
3
K
d
C
1
s
2
K
p
C
1
C
2
_ _
s K
i
C
1
37
The set of design coefficients {K
p
, K
i
, K
d
} are
chosen so as to render the closed-loop characteristic
polynomial
p
PID
s s
3
K
d
C
1
s
2
K
p
C
1
C
2
_ _
s K
i
C
1
38
into a Hurwitz polynomial with desirable roots. In
order to specify the parameters {K
p
, K
i
, K
d
}, we can
choose to locate the desired loop poles in the left half
of the complex plane. All three poles can be located in
the same point of the real line, s a, a being strictly
positive, using the following polynomial equation:
ps s a
3
s
3
3as
2
3a
2
s a
3
39
Where the parameter a represents the desired location
of the poles. Identifying each term of the expression
(38) with those of (39), we directly obtain the value of
the set of coefficients {K
p
, K
i
, K
d
} which are given by
K
d

3a
C
1
40
K
p

3a
2
C
2
C
1
41
K
i

a
3
C
1
42
Now we proceed to show the experimental results
of the response of the magnetic levitation ball when a
PID controller is implemented. The sampling time is
1 10
3
s. In order to design the gains of the PID
controller, the closed-loop poles can be placed in a
reasonable location of the negative real axis. We chose
the closed-loop poles be located in 70 and the value
of the set of coefficients {K
p
, K
i
, K
d
} are obtained from
expressions (40)(42). At the beginning of the simula-
tion, the levitated ball started in a certain position and
was commanded to follow a desired trajectory defined
by y

. The desired reference trajectory used is specified


in the simulations results presented in Section 4. The
working point has been selected as " y " y
i
2.09, and
the control input in the working point is obtained
according to (35). Figure 9 illustrates the evolution of
the input control and Figure 10 depicts the trajectory
tracking of the position of the levitated ball. We can
observe, at the beginning of the experiment, a large
feedback control action that is typical in the control of
unstable systems. Furthermore, Figure 10 shows the
evolution of the reference and the experimental
position of the magnetic ball showing a stable behav-
iour and a correct tracking positioning during all the
trial. Finally, Figure 11 illustrates the evolution of the
positioning tracking error e(t) y(t) y

(t).
5.3 Experimental results with exact feedforward-GPI
controller
Experimental studies were carried out on the magnetic
levitation system using the control law presented in
Section 3. In order to design the gains of the proposed
controller, the poles can be placed at a reasonable
location on the negative real axis. In the experimental
platform, the closed-loop poles were located at
a 70, and the values for the set of coefficients,
{k
3
, k
2
, k
1
, k
0
}, were obtained from the expressions:
(31). The magnetic ball started at a certain initial
Magnetic
levitation
system
PID
y
y* y
u

+
+

+
d d d
u
y
+
u
Figure 8. Closed-loop control scheme using a PID controller.
0 1 2 3 4 5 6 7
1.5
1
0.5
0
0.5
1
1.5
2
2.5
t (s)
u
(
t
)

(
V
)


u(t)
Figure 9. Experimental control input voltage to the magnetic
levitation system using a PID controller.
1164 R. Morales and H. Sira-Ramrez
position and was controlled to follow the desired
reference trajectory specified by y

(t). Figure 12 depicts


the control input voltage, u(t), to the magnetic levita-
tion system showing, at the beginning of the experi-
ment, a large feedback control action that is typical
in the control of such unstable systems, and which,
moreover, is in complete accordance with the simula-
tions results presented in Section 4. Figure 13,
illustrates the quality of the trajectory tracking using
the designed controller. The position of the magnetic
levitated ball, y(t), tracks quite accurately the desired
trajectory, y

(t). The tracking error, e(t) y(t) y

(t),
is also depicted in Figure 14. The results indicate an
excellent performance of the controller showing a fast
and accurate stabilisation of the ball around the initial
equilibrium point followed by an accurate trajectory
tracking evolution characterised by a rather small
tracking error. Furthermore, comparing the systems
response with the PID controller we observe the high
improvement obtained in the tracking tasks and the
high reduction of the tracking error.
6. Conclusions
Differential flatness allows one to systematically solve
a number of interesting nonlinear control problems.
In this work, a combined design approach has been
proposed for the efficient stabilisation, and reference
trajectory tracking of a nonlinear, unstable, magnetic
levitation system. The approach is based on an exact
feedforward linearisation of flat systems combined
with a ball velocity structural estimation using a
model-based integral state reconstructor. This recon-
structor is simply based on a combination of iterated
integrals of the input and the output. Finally, output
tracking error iterated integral feedback, arising in the
GPI control of linear systems, suitably integrates a
rather efficient and easy to implement output feedback
controller for the magnetic suspension system. Since
the system is locally controllable (i.e. flat) and observ-
able, and hence, reconstructible, an integral
inputoutput parameterisation of the state variables
and of the flat output and its various time derivatives is
possible. This allows us to obtain a trajectory tracking
0 1 2 3 4 5 6 7
0
0.5
1
1.5
2
2.5
3
3.5
4

u(t)
t (s)
u
(
t
)
(
V
)
Figure 12. Experimental control input voltage, u(t), to the
magnetic levitation system using exact feedforward-GPI
controller.
0 1 2 3 4 5 6 7
0
0.005
0.01
0.015
0.02
0.025
0.03
y(t)
y

(t)
t (s)
y
(
t
)
(
m
)
Figure 13. Experimental evolution of the tracking trajectory
of the magnetic ball, y(t) and y

(t), using exact


feedforward-GPI controller.
0 1 2 3 4 5 6 7
8
6
4
2
0
2
4
6
8
x 10
4

e(t)
t (s)
e
(
t
)
(
m
)
Figure 11. Experimental trajectory tracking error,
e(t) y(t) y

(t), using a PID controller.


0 1 2 3 4 5 6 7
0.005
0.01
0.015
0.02
0.025


y

(t)
y(t)
t (s)
y
(
t
)
(
m
)
Figure 10. Experimental trajectory tracking using a PID
controller.
International Journal of Control 1165
controller for the flat output behaviour guaranteeing
the desired rest-to-rest tracking trajectory tasks. The
inputoutput integral parameterisation allows one to
locally control the system by simply resorting to a
standard pole placement procedure on a higher order
system devoid of the internal instabilities. The pro-
posed feedback control scheme was carried out without
the use of state measurements, or without devising the
dynamic systems devoted to solve the state estimation
problem, as traditionally provided by asymptotic state
observers. Neither do we require low-pass filters that
better the noisy estimation of output time derivatives
through sampling and discrete approximations. The
performance of the proposed controller has been
simulated and tested in an actual laboratory magnetic
levitation system. The experiments depicted a high
performance of the feedback regulation scheme in the
stabilisation and trajectory tracking tasks. Finally, this
methodology is well suited to face important problems
of control systems. Its versatility and ease of imple-
mentation make the controller suitable to be robustly
applied in more complex nonlinear control systems,
provided certain judgemental simplifications are per-
formed on the nonlinear plant. This will be the topic of
future publications.
References
Becedas, J., Trapero, J.R., Feliu, V., and Sira-Ram rez, H.
(2009), Adaptive Controller for Single-Link Flexible
Manipulators Based on Algebraic Identification and
Generalized Proportional Integral Control, IEEE
Transactions on Systems, Man, and Cybernetics. Part B:
Cybernetics, 39, 735751.
Fliess, M., Le vine, J., Martin, P., and Rouchon, P. (1995),
Flatness and Defect of Non-linear Systems: Introductory
Theory and Examples, International Journal of Control,
61, 13271361.
Fliess, M., Ma rquez, R., Delaleau, E., and Sira-Ram rez, H.
(2002), Correcteurs Proportionnels-inte graux Pe nralise s,
ESAIM: Control, Optimisation and Calculus of Variations,
7, 2341.
Golob, M., and Tovornika, B. (2003), Modeling and
Control of the Magnetic Suspension System, ISA
Transactions, 42, 89100.
Hagenmeyer, V., and Delaleau, E. (2003a), Exact
Feedforward Linearization Based on Differential
Flatness, International Journal of Control, 76,
537556.
Hagenmeyer, V., and Delaleau, E. (2003b), Robustness
Analysis of Exact Feedforward Linearization Based on
Differential Flatness, Automatica, 39, 19411946.
Hagenmeyer, V., and Delaleau, E. (2008), Continuous-time
Non-linear Flatness-based Predictive Control: An Exact
Feedforward Linearisation Setting with an Induction
Drive Example, International Journal of Control, 81,
16451663.
Lilienkamp, K. (2004), Low-cost Magnetic Levitation
Project Kits for Teaching Feedback System Design,
IEEE American Control Conference, 2, 13031308.
Lundberg, K., Lilienkamp, K., and Marsden, G. (2004),
Low-cost Magnetic Levitation Project Kits, IEEE Control
Systems Magazine, 24, 6569.
Sira-Ramirez, H. (2003), Sliding Modes, D
Modulators and Generalized Proportional Integral
Control of Linear Systems, Asian Journal of
Control, 5, 467475.
Sira-Ram rez, H., and Agrawal, S. (2004), Differentially Flat
Systems, New York: Marcel Dekker.
Sira-Ram rez, H., and Silva-Navarro, G. (2002), Regulation
and Tracking for the Average Boost Converter Circuit:
A Generalized Proportional Integral Approach,
International Journal of Control, 75, 9881001.
0 1 2 3 4 5 6 7
5
0
5
10
15
x 10
4


t (s)
e
(
t
)
e(t)
Figure 14. Experimental evolution of the tracking error
trajectory, e(t) y y

(t), of the magnetic ball using exact


feedforward-GPI controller.
1166 R. Morales and H. Sira-Ramrez

You might also like