Académique Documents
Professionnel Documents
Culture Documents
net/publication/272237344
Control of the Ball and Beam using Kalman Filter - A Flatness Based Approach
CITATIONS READS
0 781
2 authors:
Some of the authors of this publication are also working on these related projects:
All content following this page was uploaded by José Oniram De Aquino Limaverde Filho on 14 February 2015.
CONTROL OF THE BALL AND BEAM USING KALMAN FILTER - A FLATNESS BASED
APPROACH
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
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:
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)
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)
Reference
to validate the performance of the proposed tracking 0.1 Ball Position
0
I) Constant Trajectory
R [m]
−0.05
−0.1
−0.2
II) Polynomial Trajectory −0.25
0 5 10 15 20 25 30 35 40 45 50
t [s]
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
R [m]
0
−0.1
Input Signal
10
Reference
8 Input Signal −0.2
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
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]
−4
0 5 10 15 20 25 30 35 40 45 50 6 Conclusions
t [s]
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.
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.
2606