You are on page 1of 6

Proceedings of the MC4.

7
2005 IEEE Conference on Control Applications
Toronto, Canada, August 28-31, 2005

Stability analysis of PD regulation for ball and


beam system
Wen Yu, Floriberto Ortiz

Abstract— Many nonlinear controllers for ball and beam In order to solve transient performance problem, energy
system can achieve in some cases asymptotic stability. Only shaping method uses a nonlinear static state feedback that is
a few of them apply their nonlinear control theory results in derived from the interconnection and damping assignment
real experiment. On the other hand, many laboratories use
PD control for the ball and beam system, but theory analysis [3]. But it requires the kinetic and potential energies shaping
is based on a linear approximate model. Little effort has been [8]. Sliding mode controller can overcome the problem
made to analyze the PD control via the complete nonlinear associated with singular states [6]. But chattering in sliding
model. In this paper we propose an asymptotically stabilizing mode is a big problem in application. Observer-based non-
PD controller that ensures that, for a well defined set of initial linear control in [7] uses the same coordinate transformation
conditions, the ball remains on any point of the bar. Complete
nonlinear model of ball and beam system and stability analysis as in [5] to design a nonlinear observer for the velocities of
of PD control are proposed in this paper. Real experiments ball and beam system. The controller is more complex than
are applied to test our theory results. [5]. Some intelligent controllers for ball and beam can also
be found, such as fuzzy control [10], sliding mode fuzzy
I. I NTRODUCTION control, neural control [1], fuzzy neural control [2], etc.
Ball and beam system is one of the most enduringly These intelligent controllers are derived from some prior
popular and important laboratory models for teaching con- information or input-output data of ball and beam system.
trol systems engineering. It is widely used because many There are two problems for ball and beam control: 1)
important classical and modern design methods can be many laboratories use simple controllers such as PD control,
studied based on it. The system (shown in Fig.1) is very but theory analysis is based on linear models. 2) nonlinear
simple – a steel ball rolling on the top of a long beam. One controllers for ball and beam system have good theory
side of the beam is fixed, the other side is mounted on the results, but they are seldom used in real applications. In this
output shaft of an electric motor and so the beam can be paper we will analyze the stability of the PD control with
tilted by applying an electrical control signal to the motor the complete nonlinear model. To the best of our knowledge,
amplifier. The position of the ball can be measured using stability analysis of PD control based on nonlinear model
a special sensor. It has a very important property – open of ball and beam system has not yet been established in the
loop unstable, because the system output (the ball position) literature. Since the dynamic equations of ball and beam
increases without limit for a fixed input (beam angle). The system are not suitable for Lyapunov method, some special
control job is to automatically regulate the position of the transformations are applied. Also we propose a modified-PD
ball by changing the position of the motor. This is a difficult controller to guarantee asymptotic stability of the regulation
control task because the ball does not stay in one place on procedure. A real experiment is applied to test our theory
the beam when  6= 0> but moves with an acceleration that results.
is proportional to the tilt of the beam.
This standard experiment can be approximated by a linear II. BALL AND BEAM MODEL AND PD CONTROL
model, many universities use it for education of classical
control theory. Linear feedback control or PID control For the ball and beam system described schematically in
can be applied, the stability analysis are based on linear Fig.1, a ball is placed on a beam where it is allowed to roll
state-space model or transfer function [9]. Resent results with 1 degree of freedom along the length of the beam. A
show that the stabilization problem of the ball and beam lever arm is attached to the beam at one end and a servo
can be solved by nonlinear controllers. Approximate input- gear at the other. As the servo gear turns by an angle , the
output linearization used state feedback to linearize ball and lever changes the angle of the beam by . When the angle is
beam system first, the a tracking controller based on the changed from the horizontal position, gravity causes the ball
approximates system can stabilize the ball and beam system to roll along the beam. The basic mathematical description
[5]. But this controller is very complex for real application. of this system consists of DC servomotor dynamic and ball
on the beam model.
Wen Yu and Floriberto Ortiz are with the Departamento de Control
Automatico, CINVESTAV-IPN, Av.IPN 2508, México D.F., 07360, México Modelling DC servomotor can be divided into electrical
yuw@ctrl.cinvestav.mx and mechanical two subsystems. The electrical system is by
0-7803-9354-6/05/$20.00 ©2005 IEEE 517
Authorized licensed use limited to: LIVERPOOL JOHN MOORES UNIVERSITY. Downloaded on November 12,2023 at 14:33:28 UTC from IEEE Xplore. Restrictions apply.
y N
R r
ball
L
L mg sin α F α

mg
beam d
θ
α z Mg
d
θ

motor
Fig. 2. Relation between motor position and beam angle.

Fig. 1. Ball and beam system summarize the two equation in (5) with I = 0>
·· ·· 2 ··
p| sin  + p} cos  = pj sin  + pu
5
based on Kirchhoff´s voltage law ··
³· ·
´ ··
g
Use the conditions | = gw u sin  + u cos  > } =
· · ³· ´
X = Op L p + Up Lp + Ne  (1) g ·
gw u cos   u  sin  , | = u sin > } = u cos 
where X is input voltage, Lp is armature current, Up and ·· ·· ·· ·2
Op are the resistance and inductance of the armature, Ne | sin  + } cos  = u + u
·
is back emf constant,  is angular velocity. Compared to It is the second equation of (4). When the system is near
· · ·
Up Lp and Ne > the term Op L p is very small. In order to stable point,   0> the acceleration of the ball is given
to simplify the modeling and as most DC motor modeling by
· ·· 5
methods, we neglected the term Op L p = DC motor model u =  j sin 
7
is µ ¶
Up Mp ·· Up Ep · Since  is a small angle, sin   = The approximation
 + Ne + =X (2) linear model for the ball and beam system becomes
Np Nj Np Nj
e
The mechanical subsystem is J(v) = (6)
µ ¶ v2
1 ·· ·
Mp  + Ep  =  p (3) In state space form, it is
Nj " · # · ¸· ¸ · ¸
{1 0 1 {1 0
where Nj is gear ratio, Mp is the effective moment of · = + x
{2 0 0 {2 e
inertia, Ep is viscous friction coefficient,  p is the torque · ¸
produced at the motor shaft. The electrical and mechanical {1
| = [1> 0]
subsystems are coupled to each other through an algebraic {2
torque equation where {1 = u> {1 = u=
·

 p = Np Lp Remark 2: The model (4) is different with the most


where Np is torque constant of the motor. popular used ball and beam system as in [5], where the
By Lagrange method we can obtain the mathmatical motor is fixed in the body center of the beam, in our case
model of the ball and beam system the fixed point D is in one side of the beam. So the gravity
¡ ¢ ·· ¡ ¢ of the beam cannot be neglected. Also the beam angle 
· ·
M1 + pu2  + 2puu + pju + O2 Pj cos  =  and motor position  are not same, we use Fig.2 to calculate
7 ·· ·2 them. The arc distances in the two circle are equal, i.e.,
5u  u + j sin  = 0
(4) O = g (7)
Remark 1: The second equation of (4) can be derived
from force relation directly. In Fig.1
··
The control problem is to design a controller which
p| = pj + Q cos  + I sin  computes the applied voltage X for the motor to move
·· (5)
p} = Q sin  + I cos  the ball in such a way that the actual position of the ball
·
reaches desired one. The controllers are constructed by
where Q is friction, I is rotational force, I U = M $> introducing nonlinear compensation terms into the tradi-
·
{
$ = U > M = 25 pU2 . Multiply with sin  and cos > and tional PD controller. Two types of PD controllers will be
518
Authorized licensed use limited to: LIVERPOOL JOHN MOORES UNIVERSITY. Downloaded on November 12,2023 at 14:33:28 UTC from IEEE Xplore. Restrictions apply.
π

r* Ball α* Motor + Motor Ball r


The whole ball and beam system is (2), (4) and (7),
U θ
+ controller
C2 +

controller
C1 + m odel
M1
m odel
M2 ¡ 2 ¢ ·· · · ¡ ¢

α pu + n1  + 2puu + pju + O2 P j cos 
d/L ·
= n2 X  n3  (12)
(a) Serial control ·· ·2
n4 u  u + j sin  = 0
Up Mp O
− Ball where n1 = N + M1 > n2 = 1 + N Up > n3 =
p
r*
+
controller
C2 +
³ p Nj g ´
O Np Ne Up Ep
Up + Ne + Np Nj > n4 = 5 , nl A 0 (l = 1 · · · 4)=
+ U Motor
θ Ball r 7
π m odel m odel
g
Motor + M1 M2
controller
C1 We define system state as { = [> u]W > the regulation error
-1 α d/L is
(b) Parallel control e = {  {
{
where { is desired variable, { = [ > u ]W . For ball and
Fig. 3. PD control for ball and beam system. ·
beam system, in the balance position  = 0> { = 0= So
{ = [0> u ]W > u is the desired ball position.
designed for this system. The first one is serial PD control It is difficult to apply the dynamic equation of the ball and
which is shown in Fig.3 (a). The beam angle  (or motor beam system (12) and PD control (10) for Lyapunov method
position ) can be controlled by PD controller F1. This directly. On the other hand, it is well known that we can
constitutes the inner-loop. The outer-loop controls the ball prove the stability of robots with PD control by Lyapunov
position with PD controller F2.  is a compensator which method. In this paper we will transfer (12) and (10) into
can assure asymptotically stable. The serial PD control has the form of the robot dynamics, then we will prove that the
the following form ball and beam system has similar properties as robots. The
³· ·´ closed-loop system is obtained by substituting the control
X = nsp (  ) + ngp    +  voltage X from the control law (10) into ball and beam
³· ·´ (8)
 = nse (u  u) + nge u  u system (12)
··
³ ·´ ·
where nsp and ngp are positive constants, which corre- P ({) { + F {> { { + J ({) = Ee { + G
spond to proportional and derivative coefficients for motor · ¸ ³ ·´
n1 + pu2 n2 d3
control, nse and nge are proportional and derivative gains where P ({) = > F {> { =
" 0 # n4
for the ball control. · · ¸
The second one is parallel PD control which is shown in n2 d5 + n3 n2 d2 + 2pu n2 d4 n2 d1
· > E = >
Fig.3 (b). Because the final position of the motor must be 0> u  ¸ 0 · ¡ 0 0
· ¢ ¸
such that the ball does not move, so  = 0= The feedback n2 pju + O2 Pj cos 
control of motor position becomes 1= The parallel PD G= > J ({) = . Before
0 j sin 
control has the following form presenting the stability analysis, we give the following
³ ·
´ h ³ ·  · ´i lemma.
X = nsp   ngp  + nse (u  u) + nge u  u + Lemma 1: The following equations
(9) ¡ ¢
pju + O2 P j cos  = n2 X
··
For regulation problem the control aim is to stabilize n4 u + j sin  = 0 (13)
· ·· ¡ ¢
the ball in a desired position u > so u = 0= The two PD X = d1 ue  d3 u  d4  + n12 pju + O2 P j cos 
controllers (8) and (9) can be rewritten in a unique form
has an isolated solution [> u] = [ > u ] =
· ·· ·
X = d1 ue  d2 u  d3 u  d4   d5  +  (10) Proof: Substitute X into the first equation of (13), we
have
where serial PD control d1 = nsp nse > d2 = ··
n2 d1 ue  n2 d3 u  n2 d4  = 0 (14)
(nsp + ngp ) nge > d3 = ngp nge > d4 = nsp > d5 = ngp > for
··
parallel PD control d1 = nse > d2 = nge > d3 = 0> d4 = nsp > From the second equation of (13), we can conclude u =
d5 = ngp > dl A 0 (l = 1 · · · 5)  n14 j sin = So (14) becomes
III. S TABILITY ANALYSIS OF PD REGULATION n2 d3
n2 d1 ue + j sin   n2 d4  = 0
In this section, PD regulation for ball and beam system n4
is proposed. By (3) we have It can be rewritten as
µ ¶
Np · n4 d4 n4 d1
X  Ne  =  (11) sin  =  ue (15)
Up d3 j d3 j
519
Authorized licensed use limited to: LIVERPOOL JOHN MOORES UNIVERSITY. Downloaded on November 12,2023 at 14:33:28 UTC from IEEE Xplore. Restrictions apply.
·· ·2
The only possible solution for  is  = 0> otherwise the ball Using n4 u  u + j sin  = 0
has to move. For any  6= 0> ue cannot be a constant, so (15) · ·2
has no solution. When  = 0> form (15) we know ue = 0= Y =  (n2 d5 + n3 ) 
¡ ¢
· · · ·
Because  = 0> this allows us to conclude [> u] = [ > u ] +[n2  + (2p + 3) uu  pju + O2 Pj cos   n2 d2 u]
is the unique solution for (13).
If we choose the compensator as
The stability of the closed-loop system is stated in the · µ ¶ ¸
following theorem. 1 · · O ·
= (2p  3) uu + pju + P j cos  + n2 d2 u
Theorem 1: The serial or parallel PD control as in (10) n2 2
with a compensator as so
h i · ·2
· · Y   (n3 d5 + n4 )  (19)
 = n12 { n2 d2 + (2p  3) u u
¡ ¢ (16) ·
+ pju + O2 P j cos } Since (n3 d5 + n4 ) A 0> Y is a negative-semidefinite func-
can guarantee asymptotic stability of the ball and beam tion. Therefore, by invoking the Lyapunov’s direct method,
system (12), i.e., from any defined set of initial condition it can be concluded that [> u] = [0> u ] ( = 0) is a stable
0  u(0)  O, the PD control (10) ensures that the ball equilibrium.
remains on any point of the bar. In order to prove asymptotic stability, we use LaSalle´s
Proof: Because P ({) and E are positive definite theorem. In the region
½ ¾
matrices, we choose the following positive definite quadratic ·
form as Lyapunov function candidate = [> u] : Y = 0
³ ·´ 1 ·W 1 W n4 · 2
Y {> { = { P ({) { + {
·
e Ee{+ u (17) the invariant set is obtained from the closed-loop system
·
2 2 2 (12) when  = 0> that is (13). Furthermore, according to
Differentiating it with respect to time, and recalling that { Lemma 1, (13) is satisfied for [> u] = [0> u ] ( = 0).
is constant, yields Therefore, invoking LaSalle´s theorem, we can assure that
the equilibrium [> u] = [0> u ] is asymptotically stable. This
gY ·W ·· 1 ·W · · ·W · ··
= { P ({) { + { P ({) {  { Ee { + n4 uu means that
gw 2 lim {e=0 (20)
··
³ ·´ · w$4
Since P ({) { = Ee
{ + G  F {> { {  J ({)
For ball and beam system, in the balance position  = 0>
· ³ · ´¸ · u is the desired ball position, (20) means
· W ·

Y = 2 { P ({)  2F {> { {
lim  (w) = 0
·W · ·· w$4
+{ [Ee
{  J ({) + G  Ee
{] + n4 uu lim u (w) = u
w$4
Because
³ ·´ · ·
· Remark 3: Since the velocities u and  in (16) are very
P ({)  2F {> { =
" # · ¸ small in regulation case, the main compensation is gravities
· ·
2puu 4pu 2n2 d5 + 2n3 2n2 d2 of the ball and beam
·  µ ¶
2u 0 0 0 1 O
 pju + P j cos  (21)
So n2 2
" · ·
# The controllers (8) or (9) with (21) are very simple and
· ·W · ·W pu 2p ·
Y =  12 { T{ + 2u{ · { easy implement. The control parameters of PD control are
 0 independent of system parameters, the compensator uses
·W ·W · ··
{ J ({) + { G + n4 uu two motor parameters and the masses of the ball and beam.
· ¸ Although the pure PD controller (with  = 0) can also
2n2 d5 + 2n3 2n2 d2 stabilize the system as many laboratories’ experimental
where T = .
0 0 proofs, the control performance under the pure PD control
" · ·
# is very unsatisfactory (especially for the confutation of our
·W pu 2p · ·2 ·
type), due to the gravities of ball and beam.
2u{ · { = 2u (p  1) u
 0 Remark 4: To the best of our knowledge, theoretical
·W ¡ ¢
(18) analysis of PD controller for ball and beam system based on
· ·
{ J ({) =  pju + O2 Pj cos  + j sin u
·W · complete nonlinear model has not yet been established in
{ G = n2  the literature. Many stability analysis are based on complex
·W · ·2 · ·
 12 { T{ =  (n2 d5 + n3 )   n2 d2 u nonlinear controller, and these controller have to use the
520
Authorized licensed use limited to: LIVERPOOL JOHN MOORES UNIVERSITY. Downloaded on November 12,2023 at 14:33:28 UTC from IEEE Xplore. Restrictions apply.
5
r(cm )
4

3
N ormal PD control
2 for simplified m odel

1
M odified PD control
0 for com plete m odel

-1

-2
N orm al PD control
for complete m odel
-3
Tim e (m s)
-4
0 20 40 60 80 100

Fig. 4.
Fig. 5. Ball and beam control system.

nonlinear model of the ball and beam system. On the other


hand, many laboratories use model-free controllers (e.g. (u). Power module is also Quanser PA-0103 with ±12V and
PD controller), the theoretical analysis use the simplified 3A output. A/D-D/A board is based on a a Xilinx FPGA
linear model as in (6). Because PD controller is also linear microprocessor, which is a multifunction analog and digital
system, traditional control theory can be applied for stability timing I/O board dedicated to real-time data acquisition
analysis. and control in the Windows XP environment. The board
is mounted in a PC Pentium-III 500MHz host computer.
IV. S IMULATION AND EXPERIMENTAL CASE STUDY Because Xilinx FPGA chip supports real-time operations
First we give some simulation to compare our controller without introducing latencies caused by the Windows de-
with the other existing methods. For the simulation we fault timing system, the control program is operated in
choose NUppNMj = 0=01176> NUppNEj + Np = 0=58823 [9]. Windows XP with Matlab 6.5/Simulink. The sampling time
If we do not consider energy effect, the whole dynamic is about 10ms.
equation is The motor and ball controllers are both of PD type
and require direct velocity measurements, but they are un-
7 ·· ·2
5u  u = j sin > available. We use derivative block of Simulink to calculate
·· ·
(22) them. This require position signals are smooth enough, first
0=01176 + 0=45823 = X
1 order low-pass filters are applied. Because the closed-loop
 = 16 
system appears (from the step input) to exhibit second order
The regulation results of normal PD control behaviour with a natural frequency around 1 rad/s. Faster
³ ·
´ h ³ ·  · ´i filters are used (a rule of thumb would suggest at least
X = 5=8  0=1 + 2=2 (u  u) + 0=8 u  u 5 to 10 times faster than the fasted closed-loop modes).
(23) For motor position we use the following first-order filter
When the kinetic energy of the system is considered, the J1 (v) = v+77
= For ball position we use the following first-
first equation of (22) becomes (12). We use the parameters order filter J2 (v) = v+8 8
= For the serial PD control (8)
as p = 0=06> j = 9=8> P = 0=12> O = 0=6= The modified we use nsp = 2> ngp = 0=1> nse = 0=5> nge = 0=1= For
PD control is (23) with compensation  = 0=2u + 0=1 cos = the parallel PD control (9) we use nsp = 2> ngp = 0=5>
The simulation results are shown in Fig.4. The normal PD nse = 0=4> nge = 0=1= The parameters for this experiment
control is suitable for simplified model, but it does not work are Og = 16> p = 0=06> j = 9=8> UpU+N p
= 0=3>
for the complete nonlinear model. The modified PD control p
P = 0=12> O = 0=6= We only use gravity compensation
proposed in this paper can work. The response is similar (21) The compensator is
as in [5], but the transient performance is worse than [8]. h i
· ·
We note that the nonlinear controllers of [5] and [8] need  = UpU+Np
{ Up
Up +Np (nsp + ngp ) nge + (2p  3) u  u
the complete model of ball and beam system. They only
p
¡ O
¢
+ pju + 2 P j cos }
give simulation results. Our modified PD control does not
require the nonlinear model of ball and beam system. It is It can be approximated as   0=3 (0=588u + 0=353) cos 
easier for application. when the ball and beam system does not move quickly=
The experiment is carried out on the Quanser ball and The response of the parallel PD control for ball and beam
beam system [9] (see Fig.5). The beam is 60cm long. The system is shown in Fig.6.
ball is about 60g. Input to the system is motor control The serial PD control with the same compensator as the
voltage X, outputs are the positions of motor () and ball parallel one. At time w = 200pv> we move the ball for 1cm,
521
Authorized licensed use limited to: LIVERPOOL JOHN MOORES UNIVERSITY. Downloaded on November 12,2023 at 14:33:28 UTC from IEEE Xplore. Restrictions apply.
2
r (cm)
5
r (cm) 1
4

3 0

2
-1
1
-2
0

-1 -3

Time (ms)
-2
-4
0 500 1000 1500 2000 2500 3000 3500 4000 4500 5000
-3
Time (ms)
-4
0 500 1000 1500 2000 2500 3000 3500 4000 4500 5000

Fig. 8. Serial PD control without compensator.

Fig. 6. Parallel PD control with gravity compensation.


[2] P.H.Eaton, D.V.Prokhorov, D.C. Wunsch II, Neurocontroller alterna-
tives for “fuzzy” ball-and-beam systems with nonuniform nonlinear
3 friction, IEEE Trans. Neural Networks, Vol.11, No.2, 423-435, 2000.
r (cm)
[3] F.Gordillo, F.Gómez-Estern, R.Ortega, and J.Aracil, On the ball and
2 beam problem: regulation with guaranteed transient performance and
tracking periodic orbits, International Symposium on Mathematical
1 Theory of Networks and Systems, University of Notre Dame, IN,
USA. August, 2002.
0
[4] J.S.Glower, J.Munighan, Designing fuzzy controllers from a variable
structures standpoint, IEEE Trans. on Fuzzy Systems, Vol.5, No.1,
-1
138 -144, 1997.
[5] J.Hauser, S.Sastry and P.Kokotovic, Nonlinear control via approxi-
mate input-output linearization: ball and beam example, IEEE Trans.
-2
on Automatic Control, Vol.37, No.3,392-398., 1992.
Time (ms)
[6] R. M. Hirschorn, Incremental sliding mode control of the ball and
-3
0 500 1000 1500 2000 2500 3000 3500 4000 4500 beam, IEEE Trans. on Automatic Control, Vol.47, No.10, 1696-1700,
Time (ms)
2002.
[7] N.H. Jo, J.H.Seo, A state observer for nonlinear systems and its
application to ball and beam system, IEEE Trans. on Automatic
Fig. 7. Serial PD control with gravity compensation and disturbance. Control, Vol.45, No.5, 968 -973, 2000.
[8] R. Ortega, M.W. Spong, F. Gómez-Estern, G. Blankenstein, Stabi-
lization of a class of underactuated mechanical systems via intercon-
nection and damping assignment, IEEE Trans. on Automatic Control,
this likes a external disturbance. The response is shown in Vol.47, No.8, 1218 -1233, 2002.
Fig.7. [9] Ball and Beam-Experiment and Solution, Quanser Consulting, 1991.
[10] L.X.Wang, Stable and optimal fuzzy control of linear systems, IEEE
When we use pure PD control, the response of the serial Trans. on Fuzzy Systems, Vol.6, No.1, 137 -143, 1998.
PD control without compensator is shown in Fig.8. We can
see that PD control with exact compensation is effective for
ball and beam system

V. C ONCLUSION
The main contributions of the paper are, 1) A class of
asymptotically stable PD controllers has been presented
for regulation of ball and beam system. The new con-
trollers, which have some attractive advantages for practical
applications, are constructed by introducing a nonlinear
compensator into the traditional PD controller. 2) By using
Lyapunov´s direct method, we have shown for a well
defined set of initial conditions, the ball remains on any
point of the bar. 3) Experimental results are presented to
illustrate the control system stability and performance.

R EFERENCES
[1] Y.C.Chu, J.Huang, A neural-network method for the nonlinear ser-
vomechanism problem, IEEE Trans. Neural Networks, Vol.10, No.6,
1412-1423, 1999.
522
Authorized licensed use limited to: LIVERPOOL JOHN MOORES UNIVERSITY. Downloaded on November 12,2023 at 14:33:28 UTC from IEEE Xplore. Restrictions apply.

You might also like