Vous êtes sur la page 1sur 7

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/272237344

Control of the Ball and Beam using Kalman Filter - A Flatness Based Approach

Conference Paper · September 2014

CITATIONS READS

0 781

2 authors:

José Oniram De Aquino Limaverde Filho Eugenio Liborio Feitosa Fortaleza


University of Brasília University of Brasília
15 PUBLICATIONS   4 CITATIONS    40 PUBLICATIONS   71 CITATIONS   

SEE PROFILE SEE PROFILE

Some of the authors of this publication are also working on these related projects:

Subsea equipments installation View project

Reservoir Control and Optimization View project

All content following this page was uploaded by José Oniram De Aquino Limaverde Filho on 14 February 2015.

The user has requested enhancement of the downloaded file.


Anais do XX Congresso Brasileiro de Automática
Belo Horizonte, MG, 20 a 24 de Setembro de 2014

CONTROL OF THE BALL AND BEAM USING KALMAN FILTER - A FLATNESS BASED
APPROACH

J OSÉ O NIRAM DE AQUINO L IMAVERDE F ILHO∗, E UGÊNIO L IBORIO F EITOSA F ORTALEZA∗



GRACO - Grupo de Automação e Controle
Universidade de Brasília
Brasília, Distrito Federal, Brasil

Emails: joseoniram@ieee.org, efortaleza@unb.br

Abstract— The tracking control design problem for a nonlinear ball and beam system is addressed. In this paper, the flatness
property of the system is here exploited for design a state feedback control scheme aiming to stabilize the system’s trajectory
tracking error with respect to off-line planned trajectories. Differentially flat nonlinear systems can be written in the Brunovsky
canonical form, which allows to perform the state estimation using the Kalman filter. In order to validate the performance of the
proposed tracking control, numerical simulations and experimental results are presented and discussed.

Keywords— Trajectory Tracking; Nonlinear Control; Differentially Flat Systems; Kalman Filter; Ball and Beam

Resumo— O problema de rastreamento de trajetória para um sistema não-linear barra-esfera é apresentado. Nesse trabalho,
a planicidade diferencial do sistema é explorada tanto para desenvolver uma estrutura de controle por realimentação de estados
visando estabilizar o erro de rastreamento de trajetória com respeito as trajetórias desejadas. Sistemas não-lineares diferencialmente
planos podem ser escritos na sua forma canônica de Brunovsky, o que se permite realizar a estimação de estados através do
Filtro de Kalman. Buscando avaliar a performance do controlador de rastreamento proposto, simulações numéricas e resultados
experimentais são apresentados e discutidos.

Palavras-chave— Rastreamento de Trajetória; Controle Não-linear; Sistemas Diferencialmente Planos; Filtro de Kalman; Barra-
Esfera

1 Introduction first proposed and developed in (Fliess et al., 1992).


This property allows a complete parametrization of
Control of underactuated systems, which is de- all systems variables (states, inputs, outputs) in terms
fined as the one with fewer controls inputs than de- of a finite set of independent variables, called the
grees of freedom, is currently an active research field flat outputs, and a finite number of their time deriva-
due to its theoretical challenges and their broad appli- tives (Sira-Ramírez and Agrawal, 2004).
cation in Robotics, Aerospace Vehicles, and Marine Indeed, many physical systems are known to be
Vehicles (Olfati-Saber, 2001). The motivation for the differentially flat, as can be seen in (Murray et al.,
study of controllers for this systems is due the fact it 1995). These systems can be directly linearize to a
allows us to reduce weight and cost as well as con- controllable linear system in Brunovsky’s canonical
sider situations in which component failures can oc- form by endogenous transformation. This feature al-
cur (Reyhanoglu, 1996). lows to trivialize the trajectory planning tasks, without
Belonging to the class of underactuated systems, solving differential equations, while simplifying the
the ball and beam system is one of the most popular feedback controller design problem to that of a set of
and important benchmarks system for studying non- decoupled linear time invariant systems (Sira-Ramírez
linear control design. This system is widely used be- and Agrawal, 2004).
cause of its simplicity to understand as a system and The power of flatness is precisely that it does not
provides the opportunity to analyze the control tech- convert nonlinear systems into linear ones. When a
niques (Amjad et al., 2010). system is flat, it is an indication that the nonlinear
Many classical and modern control methods have structure of the system is well characterized and one
been proposed to solve both stabilization and tracking can exploit that structure in designing control algo-
problems for the ball and beam system. In (Hauser rithms for motion planning, trajectory generation, and
et al., 1992), an approximate feedback linearization is stabilization (Martin et al., 2012).
proposed to resolve the fact the relative degree of the In (Rouchon et al., 1992), it was presented that
ball and beam system is not well defined. A Linear a ball and beam system used in (Hauser et al., 1992)
Quadratic Regulator (LQR) was developed in (Rahmat is non-differentially flat system, but a high frequency
and Wahab, 2000) as an optimal control strategy con- control and averaging approach is proposed to approx-
sidering the voltage of the motor as the input of the imate the system by means of a flat system. In (Sira-
system. In (Chang et al., 2012), a tracking control Ramírez, 2000), an approximate flat system is ob-
strategy is designed using a pair of decoupled fuzzy tained by disregarding the centripetal force of the ball.
sliding-mode controllers. The flatness property allowed to compute a suitable
Besides these techniques, tracking control ap- off-line trajectory planning and designed an incremen-
proaches based on differential flatness have grown tal time-varying linear feedback controller.
substantially in recent years. Flatness property was Using differential flatness theory, this paper pro-

2601
Anais do XX Congresso Brasileiro de Automática
Belo Horizonte, MG, 20 a 24 de Setembro de 2014

poses a different control approach for trajectory track- respectively. Furthermore, R is the radius of the ball, g
ing of the flat nonlinear ball and beam system pre- is the acceleration due to gravity, rarm is the distance
sented in (Sira-Ramírez, 2000). Transforming the between screw and motor gear. The system input is
nonlinear system to the Brunovsky’s canonical form, given by the voltage of the motor Vm .
one can design a feedback control law based on Let (x1 , x2 , x3 , x4 )T = (r, ṙ, θ, θ̇)T . The sys-
the flat output ensuring convergence of the track- tem (1) can be represented by the following state space
ing error to zero. In addition, following the results equations:
in (Rigatos, 2012), state estimation of the flat output 
and its time derivatives is performed by applying the 

 ẋ1 = x2
standard Kalman Filter recursion to the equivalent lin- 
ẋ2 = Kbb sin(x3 )

ear system. (2)
The paper is organized as follows. The mathe- 

 ẋ 3 = x 4

matical model describing the dynamics of a nonlinear 
ẋ = β x + β V
4 1 4 2 m
ball and beam model is introduced in Section 2. In
Section 3, a brief mathematical description of differ- where
entially flat systems is given. The flatness property of 1
β1 = −
the system is used to determine the nominal trajecto- τ
ries for all system variables. Then, the steps to derive K1
the tracking controller is presented. Section 4 contains β2 = (3)
τ
the state estimation procedure for the associated lin-
mrarm gR2
earized system by applying Kalman Filter. The perfor- Kbb = .
mance of the proposed controller is evaluated through Lbeam (mR2 + Jb )
numerical simulations and experimental tests in Sec-
tion 5. The conclusions and suggestions for further 3 Differentially Flat Systems
research are presented in the last section.
Differentially flat system is a system whose inte-
gral curves (curves that satisfy the system equations)
2 Ball and Beam Model
can be mapped in a one-to-one way to ordinary curves
(which need not satisfy any differential equation) in a
suitable space, whose dimension is equal to the num-
ber of input vector (Lévine, 2010).
More precisely, the flatness condition reduce to
find a set of specific variables such that all states and
inputs can be parametrize from these outputs and their
derivatives without integration. If a nonlinear system
ẋ = f (x, u) has states x ∈ Rn , and inputs u ∈ Rm ,
then the system is said to be differentially flat, if there
exists a flat outputs z ∈ Rm such that:

z = H(x, u, u̇, · · · , u(n) ) (4)

x = α(x, ẋ, · · · , x(n) ) (5)

u = λ(x, ẋ, · · · , x(n) , x(n+1) ) (6)


Figure 1: Schematic of the ball and beam system. where the components are differentially independent
and two functions α and λ are smooth functions.
The nonlinear model for the ball and beam system
considered in this paper was presented in (Quanser,
3.1 Off-line Trajectory Planning
2008). The mathematical model of the system, illus-
trated in Figure 1, is given by: Equation (4) implies that, if we want to construct
a trajectory whose x(0) and u(0) are known, one
mrarm gR2

r̈
 = sin(θ) can find the initial and final values of the flat out-
 Lbeam (mR2 + Jb ) puts and their time derivatives by the surjectivity of
(1)
 1 K1 (α, λ). Thus, it suffices then to construct a trajectory
θ̈ = − θ̇ +

τ Vm t 7−→ z(t) at least n + 1 times differentiable that sat-
isfies these initial and final conditions since x(t) and
where θ and r are the beam angle and the ball position, u(t) are obtained by (5) and (6) (Lévine, 2010).
respectively. Also, τ is the time-constant, K1 is the Knowing the system (2) is found to be differen-
steady-state gain, Lbeam is the length of the beam, m tially flat with flat output represented by the ball po-
and Jb are the mass and moment of inertia of the ball, sition x1 , the differential parametrization associated

2602
Anais do XX Congresso Brasileiro de Automática
Belo Horizonte, MG, 20 a 24 de Setembro de 2014

with the flat output and its time derivatives is given Then, initially, assume that the state vector xT can
by: be measured. If the nominal trajectories for the x1
and its time derivatives are known, we can denote by
e = x1 − x∗1 (t) the tracking error. An endogenous dy-
x2 = ẋ1 (7) namic feedback can be computed for the system (15)
  as follows (Lévine, 2010):
ẍ1
x3 = arcsin (8)
Kbb 3
X
(3)
υ = υ∗ + k(i+1) e(i) (17)
x1 i=0
x4 = 1/2 (9)
ẍ2

Kbb 1 − 12 ∗(4)
where υ ∗ = x1 and the gains ki being chosen such
Kbb
that the polynomial p(s) = s4 +k4 s3 +k3 s2 +k2 s+k1
2 (4) (3) are Hurwitz polynomials. The tracking error e con-
[Kbb − ẍ21 ]x1 + ẍ1 (x1 )2
3/2 − β 1 x4 verges to 0, which implies convergence of the flat out-
ẍ21

3
Kbb 1 − 2 put and all its time derivatives to their respective nom-
Kbb inal trajectories. Thus, from (5) and (6), we conclude
Vm = (10)
β2 that the x1 , x2 , x3 , x4 and Vm locally exponentially
converge to their reference.
Thus, it means that we can directly obtain the
nominal trajectories x∗2 (t), x∗3 (t), x∗4 (t) and Vm∗ (t) if From (11), the final expression therefore for
x∗1 (t) and its time derivatives are known. It should Vm (t) is given by replacing (17) in (10).
be emphasized that (8) is only valid when ẍ1 /Kbb be-
longs to the domain of the function arcsin, and that (9) 4 Kalman Filter for Nonlinear Flat Systems
and (10) present singularities when ẍ21 = Kbb 2
.
All state variables usually cannot be measured in
3.2 A Trajectory Tracking Feedback Controller many control applications, therefore, state estimators
As immediate consequence of the differential can be a practical or economical alternative solution.
parametrization, the system (2) can be transformed in For linear systems subject to Gaussian measurement
the Brunovsky’s canonical form (Rigatos, 2012): or process noise, the Kalman Filter (KF) provides an
efficient computational (recursive) solution for state
(4) estimation using a predictive-corrective structure. Fig-
x1 = υ = f (xT ) + g(xT )Vm (11)
ure 2 illustrates a classic discrete-time Kalman Filter.
with
h i
(3)
xT = x1 ẋ1 ẍ1 x1 (12)
3/2
ẍ2

(3)
3
β1 x4 Kbb 1 − 12 − ẍ1 [x1 ]2
Kbb
f (xT ) = 2 − ẍ2 ] (13)
[Kbb 1
3/2
ẍ21

3
β2 Kbb 1− 2
Kbb
g(xT ) = 2 − ẍ2 ] (14)
[Kbb 1
Figure 2: Schematic diagram of the discrete-time
It means that system (2) is equivalent to a fourth Kalman Filter (Bishop and Welch, 2001).
order chain of integrators with the state vector xT con-
taining the flat output and its time derivatives.
where the matrices Q and R correspond to the pro-
Thus, the linear system (11) can be written in
cess and measurement noise covariance matrices, re-
state-space representation:
spectively. For further details, refer to (Bishop and
ẋT = AxT + Bυ Welch, 2001).
(15) For nonlinear systems such as ball and beam sys-
y = CxT tem, the Extended Kalman Filter (EKF) is commonly
used for obtaining estimates of the state vector through
with
the fusion of observed measurements. Although EKF
     
0 1 0 0 0 1 is efficient in several sensorless control, it is charac-
0 0 1 0 0 0 terized by cumulative errors due to the local lineariza-
A=  , B =   , C T =   (16)
     
tion assumption, and this may affect the accuracy of
0 0 0 1 0 0
the state estimation or even risk the stability of the
0 0 0 0 1 0 observer-based control loop (Rigatos, 2012).

2603
Anais do XX Congresso Brasileiro de Automática
Belo Horizonte, MG, 20 a 24 de Setembro de 2014

In (Rigatos, 2012), it is proposed a derivative-free where the second trajectory starts at −0.1 m and ends
KF based on the differential flatness theory. For non- at 0.1 m after 50 seconds. For each trajectory, the cor-
linear flat systems, state estimation of the flat output responding nominal trajectories for x∗2 (t), x∗3 (t), x∗4 (t)
and its time derivatives is performed by applying the and Vm∗ (t) were directly computed by (7-10).
standard Kalman Filter recursion to the equivalent lin- From (Quanser, 2008), the ball and beam param-
ear model in Brunovsky’s canonical form without the eters were Lbeam = 0.4255 m, rarm = 0.0254 m,
need for calculation of Jacobian matrices. In contrast R = 0.0127 m, g = 9.81 m/s2 , m = 0.064 kg,
to EKF, this method improves the accuracy of state Jb = 4.129 × 10−6 kg · m2 , K1 = 1.5286 rad/sV
estimation for nonlinear system avoiding linearization and τ = 0.0248 s.
approximations. The initial conditions for the system were set as:
Based on that, for the ball and beam system, it
allowed us to estimate the state vector xT of the lin- x1 (0) = −0.2125 m x2 (0) = 0 m/s
(20)
ear system (15), which is used to compute the tracking x3 (0) = −0.9774 rad x4 (0) = 0 rad/s
controller described by the schematic shown in (17).
The control design using KF therefore can be summa- The control parameters were chosen to be:
rized in Figure 3.
k4 = 20 k3 = 150 k2 = 500 k1 = 625 (21)

where all closed-loop poles are equal to -5.


The ball velocity and beam angular velocity are
estimated by the KF described in Section 4. Using a
sampling period Ts = 0.001s, the discrete-model of
Figure 3: Tracking control design for the ball and the system (15) can be represented as follows:
beam system.
xT (k+1) = Ak xT (k) + Bk υk (22)

5 Simulation and Experimental Results with

Ak = exp(ATs ) (23)
The experimental apparatus is a Quanser ball and
beam as can be seen in Figure 4. The beam consists Bk = BTs (24)
of a metal beam with a built in potentiometer sensor
that detects the ball role along the beam and its posi- Then, the matrices Q and R were defined as:
tion, whereas an encoder is used to measure the beam  
angle. By applying a torque at the end of the beam, 0.1 0 0 0  
 0 0.1 0 0
an DC servomotor drives the beam to a desired angle. Q=  , R = 0.01 0
0 0 0.1 0  0 0.01
Furthermore, input saturation was added to the system.
0 0 0 0.1
(25)

Figures (5-6) and (8-9) depicts the ball position


and beam angle for constant and polynomial trajec-
tory, respectively. The time evolution of the control
inputs is shown in Figure 7 and Figure 10.
Both simulations show the ball and beam sys-
tem perfectly following the trajectories specified pre-
viously, thereby ensuring that the tracking errors con-
verging to zero as expected. Then, it allows us to val-
idate the tracking controller in the Quanser ball and
Figure 4: Ball and beam system setup
beam.
Numerical simulations were initially carried out 0.15
Ball Position

Reference
to validate the performance of the proposed tracking 0.1 Ball Position

controller for two different set-points: 0.05

0
I) Constant Trajectory
R [m]

−0.05

−0.1

x∗1 (t) = 0 (18) −0.15

−0.2
II) Polynomial Trajectory −0.25
0 5 10 15 20 25 30 35 40 45 50
t [s]

x∗1 (t) = (1.2 × 10−10 )t5 − (3 × 10−8 )t4


Figure 5: Ball position for constant trajectory.
+ (2 × 10−6 )t3 − 0.1 (19)

2604
Anais do XX Congresso Brasileiro de Automática
Belo Horizonte, MG, 20 a 24 de Setembro de 2014

Beam Angle
1
Reference
By using the same control parameters previ-
Beam Angle
ously defined, experimental tests were carried out for
0.5
x∗1 (t) = −0.05 m, x∗1 (t) = 0 m and x∗1 (t) = 0.05 m.
θ [rad]
Figures (11-13) present the ball position for each de-
0
sired trajectory.
−0.5
Ball Position

Reference
−1 0.2
Ball Position
0 5 10 15 20 25 30 35 40 45 50
t [s]
0.1

Figure 6: Beam angle for constant trajectory.

R [m]
0

−0.1
Input Signal
10
Reference
8 Input Signal −0.2

6 0 50 100 150 200 250 300 350 400 450 500


4
t [s]
Vm [V]

0
Figure 11: Performance of the tracking control for
x∗1 (t) = −0.05 m.
−2

−4

−6

−8
0 5 10 15 20 25 30 35 40 45 50
t [s] Ball Position
Reference
0.2
Ball Position
Figure 7: Input signal for constant trajectory.
R [m] 0.1

Ball Position
0.15 0
Reference
0.1 Ball Position
−0.1
0.05

0 −0.2
R [m]

−0.05
0 50 100 150 200 250 300 350 400 450 500
−0.1 t [s]

−0.15

−0.2 Figure 12: Performance of the tracking control for


−0.25
0 5 10 15 20 25 30 35 40 45 50 x∗1 (t) = 0 m.
t [s]

Figure 8: Ball position for polynomial trajectory. Ball Position

Reference
0.2
Ball Position
Beam Angle
1
Reference 0.1
Beam Angle
R [m]

0.5 0
θ [rad]

0 −0.1

−0.2
−0.5
0 50 100 150 200 250 300 350 400 450 500
t [s]
−1
0 5 10 15 20 25 30 35 40 45 50
t [s]
Figure 13: Performance of the tracking control for
Figure 9: Beam angle for polynomial trajectory. x∗1 (t) = 0.05 m.

10
Input Signal
As it can be seen, the proposed controller has a
Reference
8
Input Signal good performance for all three cases. The main con-
6 trol design issue is choosing appropriate values for the
4 gains of the closed-loop controller, since it was real-
Vm [V]

2 ized that the state estimation is directly influenced by


0 their values.
−2

−4
0 5 10 15 20 25 30 35 40 45 50 6 Conclusions
t [s]

In this work, a nonlinear ball and beam model is


Figure 10: Input signal for polynomial trajectory.
presented as differentially flat. This property immedi-
ately allows to establish the equivalence of the model,
by means of dynamic state feedback, a controllable

2605
Anais do XX Congresso Brasileiro de Automática
Belo Horizonte, MG, 20 a 24 de Setembro de 2014

linear system in Brunovsky’s canonical form. Precom- Martin, P., Murray, R. and Rouchon, P. (2012). Flat-
puting the necessary off-line trajectory, the approach ness based design, Control Systems, Robotics
is based on showing a systematic feedback controller and Automation 13.
design to converge trajectory tracking error to zero ex-
ponentially. Murray, R. M., Rathinam, M. and Sluis, W. (1995).
Unlike other estimation methods, it was shown Differential flatness of mechanical control sys-
that Kalman Filter can be apply in nonlinear flat tems: A catalog of prototype systems, Proceed-
systems avoiding linearization approximations, which ings of the 1995 ASME International Congress
improves the accuracy of estimation of the system and Exposition.
state variables. Numerical simulations and experimen- Olfati-Saber, R. (2001). Nonlinear control of under-
tal tests illustrates the validity of the designed motion actuated mechanical systems with application
planning and tracking control scheme for different tra- to robotics and aerospace vehicles, PhD thesis,
jectories. Department of Electrical Engineering and Com-
In further studies, we expect to propose a flatness- puter Science, Massachusetts Institute of Tech-
based controller design for the ball and beam sys- nology.
tem assuming the influence of centrifugal force term,
which implies that the system is no longer flat. How- Quanser (2008). Ball and beam user manuals.
ever, a new approach based on the concept of flat in-
puts could be used to redesign the input vector field of Rahmat, M.F. nad Wahid, H. and Wahab, N. (2000).
the system such that the given output becomes the flat Application of intelligent controller in a ball and
output, and allows to use the method discussed here. beam control system, Vol. 3, pp. 45–60.

Reyhanoglu, M. (1996). Control and stabilization of


Acknowledgment an underactuated surface vessel, Decision and
Control, 1996., Proceedings of the 35th IEEE,
The authors would like to acknowledge the Vol. 3, IEEE, pp. 2371–2376.
Brazilian institutions: ANP, FINEP, MCT and Petro-
bras for supporting the present study and the program Rigatos, G. (2012). Derivative-free kalman filter-
PRH-PB 223. ing for sensorless control of mimo nonlinear
dynamical systems, Mechatronics and Automa-
tion (ICMA), 2012 International Conference on,
References pp. 714–719.

Amjad, M., Kashif, M. I., Abdullah, S. and Shareef, Rouchon, P. et al. (1992). Flatness and oscillatory
Z. (2010). A simplified intelligent controller control: some theoretical results and case stud-
for ball and beam system, Education Technology ies, Ecole des mines de Paris, Technical Report
and Computer (ICETC), 2010 2nd International PR412 .
Conference on, Vol. 3, pp. V3–494–V3–498.
Sira-Ramírez, H. (2000). On the control of the "ball
Bishop, G. and Welch, G. (2001). An introduction to and beam" system: A trajectory planning ap-
the kalman filter, Proc of SIGGRAPH 8(27599- proach, Conference on Decision and Control.
23175): 41. Proceedings of the 39th IEEE.

Chang, Y.-H., Chang, C.-W., Tao, C.-W., Lin, H.- Sira-Ramírez, H. and Agrawal, S. K. (2004). Differen-
W. and Taur, J.-S. (2012). Fuzzy sliding-mode tially Flat Systems, Control Engineering Series,
control for ball and beam system with fuzzy ant Marcel Dekker.
colony optimization, Expert Systems with Appli-
cations 39(3): 3624 – 3633.

Fliess, M., Lévine, J., Martin, P. and Rouchon, P.


(1992). Sur les systèmes non linéaires différen-
tiellement plats, C. R. Acad. Sciences 315: 619–
624.

Hauser, J., Sastry, S. and Kokotovic, P. (1992).


Nonlinear control via approximate input-output
linearization: the ball and beam example,
Automatic Control, IEEE Transactions on
37(3): 392–398.

Lévine, J. (2010). Analysis and Control of Nonlin-


ear Systems: A Flatness-Based Approach, Math-
ematical Engineering, Springer.

2606

View publication stats

Vous aimerez peut-être aussi