The Ball and Beam Control Experiment - 1978
The Ball and Beam Control Experiment - 1978
I INTRODUCTION
This document describes our experiences in the construction and use of a simple
but flexible electromechanical control system. The basic system, shown in Fig. I,
consists of a steel ball which is free to roll along a groove in the top of a rigid beam,
which is pivoted about the centre. The control task is to use the angle of tilt of the
beam o (r) (see Fig. I for a defmition of variables) in order to control the position
x (r) of the ball. The essential dynamical characteristics of the system may be
appreciated by noticing that the angle a(t) determines the fraction of gravitational
force which is parallel to the direction of motion of the ball. Thus if the ball is
thought of as a point mass m sliding on an inclined plane (Fig. 2), then by the
laws of motion
x=gsina (l)
When this expression is linearized and Laplace transformed with zero initial
conditions, the following transfer function is obtained
.f
nevertheless it serves to indicate the double integration which is the essential
mass, m
mg s~n a a
~~ ;. \
\
~ mg cos a
Beam mg
FIG.] FIG. 2
21
dynamical property of the system. Indeed it is just this property which makes the
ball and beam a difficult yet tractable and instructive control exercise. Specifically,
the ball is open-loop unstable and therefore requires active stabilizing feedback. A
useful feature of the simple form of equation (2) is that it allows the modern
control algorithms of optimal control and pole assignment to be applied in a form
suitable for hand-calculation.
2 CONSTRUCTION
In our design, the ball and beam equipment consists of a light plexiglass beam of
length 90 em and with a 2.5 em square cross-section. As shown in Fig. 3, the beam
is mounted in a cradle made from an aluminium angle-piece which in turn is
mounted via a bearing block to a rigid back plate. The beam is pivoted about the
axis of rotation and driven via a flexible connecting rod by means of a vertically
mounted moving coil actuate r. The angle of the beam is measured by means of a
vertically mounted linear displacement transducer which is again connected by a
flexible rod. Perhaps it would have seemed more logical to use a torque-motor
drive for the beam angle control in place of the push-pull control of the moving
coil actuator. However, the large torque requirements and small angular excursions
of the beam mitigate in favour of the moving coil system. For, in addition to
generating the required torques with only a low input power, the mechanical
limits on the travel of the actuator introduces a constraint on the maximum
angular displacement. A natural limitation such as this on control excursions is
desirable for operational reasons, and in addition allows the time-optimal control
problem to be posed in a natural manner (cf. section 4.3).
The position of the steel ball on the beam is measured by a potentiometric
method in which the ball replaces the wiper blade. Specifically the plexiglass beam
!90cm ----'~
I"
Back Plate
Plexi-GlasB Beam
Linear Displacement
Transducer
~6cm~
Bearing
Block Beam Cradle
Back Beam
Plate
:i//,I;
FIG.3b Side elevation (displacement transducer in line behind actuator, and not
shown).
has a channel cut in the top face and along the length of the beam. (see Fig. 4).
Mounted in grooves on the edge of the channel are a pair of parallel 1.6 mm diameter
nichrome wires. A small balanced voltage is developed across the ends AB of one
wire, and as indicated in Fig. 5, a voltage vit) proportional to the position of the
ball is measured by connecting one end (c) of the free wire to an operational
amplifier. A particular problem is the disturbance introduced into the measurement
scheme by the intermittent contact made by the ball as it rolls along the channel
between the two wires (Fig. 6). The contact noise cannot be completely removed,
Wire
f
2.5cm
~
~2.5cm
"-i
FIG. 4 Beam detail.
A .... - -..... B
but it can be reduced by inserting a smoothing capacitor across the input to the
operational amplifier. When the ball makes good contact with the wire the capacitor
charges rapidly, with time constants determined by the small con tact resistance. If
the ball temporarily loses electrical contact with the wires, then the capacitor tends
to retain its potential, discharging slowly through the operational amplifier input
resistance. Operated in this manner, a fairly noise-free measurement of ball position
is possible, provided of course that the ball and wires are kept reasonably clean.
The remaining constructional details are summarized in appendix 1, together
with schemas of the actuator drive amplifier and the angle transducer output
circuitry. As a guide to potential constructors, the principal physical dimensions
used by us are given in Figs. 3 through 6. All dimensions are in centimetres.
3 MODELLING
The double integrator transfer function mentioned in the introduction establishes
the basic dynamical behaviour of the ball and beam. Indeed, most of the control
studies developed in subsequent sections rely upon this dynamical model. It is
important, however, to be aware of the approximations which are involved in
arriving at this model. Such insight can best be obtained through the development
of a complete dynamical model of the system. To this end the experimental ball
and beam can be represented in a form suitable for mathematical modelling by
Fig. 7. In this diagram the friction associated with the rotation of the beam is
lumped into a single linear coefficient b. The stiffness of the spring mounting of
the moving coil is assumed to be k, and the force exerted by the actuator is denoted
F(t). We can work directly in terms of F(t) as the system input since, over the
frequency range of interest, the moving coil actuator can be regarded as an ideal trans-
ducer. Thus F(t) is directly proportional to the actuator drive amplifier input voltage.
k b
F(t)
moment of inertia
about pivot. I
a
FIG. 7 Depicting the ball and beam in a form suitable for dynamical modelling.
The most straightforward means of modelling the ball and beam is by variational
methods.' To do this we pick the ball position x, and the beam angle a as a com-
plete independent set of generalized coordinates. Since the ball position and the
beam angle are not externally constrained, the pair (ox, oa) also form a complete
independent set of variational coordinates.
L=u*-T (3)
where U*, the kinetic co-energy, is composed of the translational and rotational
kinetic co-energy of the ball, plus the kinetic co-energy of the beam.
(4)
where the translational velocity of the ball v, and its angular velocity w must be
rewritten in terms of the generalized velocities, (x, Q). Consider first the angular
velocity; the angular distance 0 rolled by the ball with respect to the fixed datum is
given(from Fig. 8) by
o= l/J + a =-rx + a
dO x .
Hence w=- =-+a (5)
dt r
a.
The distance rolled is AB and related
to the peripheral distance on the ball
AC by
AB = AC
or rlji =x
FIGS. 8 and 9 Kinematic relations for ballangular/translational velocity.
The velocity of the ball can be obtained from kinematic relations shown in
Fig. 9 as
v={(xi+(xaY}! (6)
The potential energy T of the system is associated with the energy stored in the
spring. If only small angular excursions are considered and the spring is linear with
stiffness k, then T is given by
1
T=-k(lexY (7)
2
(8)
1 • 2
J=-b(lcx) (9)
2
A
dt
(aL) aL + aa
aa - aa aJ = 7
2
(lO)
where F 1 is the generalized force associated with forces resolved in the direction of
the generalised co-ordinate x. In this case F 1 consists of the components of the
gravitational force mg acting in the x-direction.
F 1 =mgsina (11)
The equations of motion of the system can now be formulated by substituting the
appropriate quantities in equation (lO) and differentiating to yield
(13a)
(13b)
Equations (13a) and (l3b) are the equations of motion of the ball and beam.
They constitute a non-linear coupled set of differential equations which as such
are unsuitable for linear control studies. The equations reduce to a more tractable
form if the following assumptions are made
(i) The moment of inertia of the ball I b and its mass m are small and have relatively
little influence on the beam behaviour as expressed by equation (l3).
a
(ii) The influence of terms in &. and in equation (13a) can be neglected.
The validity of these assumptions are open to question, depending, as they do,
upon the relative physical features of the system. For the equipment described
here the approximations are felt to be quite justifiable. Indeed, the errors involved
in invoking them are small in comparison to certain other phenomena to be
mentioned later.
Using approximation (i), (ii) and remembering that angular excursions a are
small, the equations of motion reduce to the following linearized set
(14b)
(15)
(14a)
repeat
The system equations can now be Laplace transformed to give an approximate
transfer-function model of the ball and beam. As illustrated in Fig. 10, this reduces
the system to its essential linear form of a beam transfer function in cascade with a
ball transfer function. Such a representation, albeit approximate, is convenient
since it separates the dynamical functions of the beam and the ball. For example,
two-loop feedback can be employed with an inner loop to control the beam angle
Q, and an outer loop to achieve ball position control. Actually, the reason for
including a beam angle sensor was to permit such an exercise. It has been found,
however, that with the beam drive described in section 2 the beam dynamics are
sufficiently fast to be negligible in comparison with those of the ball. This final
simplification yields the double integrator transfer function mentioned previously
_ g F(s)
( )
x s - ( 2
kl 1+--
R2)82
(16)
5 r2
Notice that the gain of the double integrator is determined, among other things, by
the ratio of ball radius R to rolling radius r. (see Fig. 6). Thus the dynamic response
of the ball may be conveniently modulated by varying this ratio.
To conclude, the ball and beam can be modelled by a pair of coupled non-linear
equations. Under certain conditions these can be linearized to give a second-order
beam transfer function in cascade with a double-integrator ball transfer function. In
most cases the beam dynamics are so fast that the entire system is adequately
modelled by the double integrator. This simplifies the control problem since it
FIG. 10
avoids a detailed study of the beam dynamics which actually contain many modes
which cannot be readily incorporated into a modelling and control study. For
example, the flexurable mode of the backplates presents a resonance which is
coupled to the basic oscillatory frequency of the beam. In addition, backlash in the
actuator and transducer linkages, contributes a constant phase lag to the beam
frequency response which is often misinterpreted.'
For the practical studies outlined in the next section, the system transfer
function was determined by applying a known voltage to the actuator and record-
ing the time taken for the ball to roll the length of the beam. The gain of the ball
transfer function is then obtained from the standard equations of motion.
4 CONTROL
G (1 + Ts)
(1 + a.lTs)
measured
demanded ball
ball position
position
ball
position step response for T = 3,
I
/\. step response for T = 2
,,
I
I
I
I
beam poles
-10 -5
- 5
FIG. 12 Root locus for classically compensated system including beam dynamics.
x=Ax+ bu (17)
u=-kx+r (18)
can be designed such that the closed loop characteristic polynomial has specified
zeroes. Assuming that the ball and beam is adequately represented by the double
integrator model with ball position x(t) related to actuator input u(t) by
a suitable state space model may be written in the form of equation (17) as
(20)
where the system states are x I , the ball position and x 2, the ball velocity.
If XI and X2 are measurable, the state feedback control law can be applied with
feedback vector
(21)
(22)
In this simple case the state vector can be designed by classical root locus methods.
Specifically, k, is selected to give the required undamped natural frequency, w n '
while k 2 provides velocity feedback which governs the damping factor.j , of the
closed loop system.
A cautionary note is required which again stems from the presence of the beam
dynamics. When k 2 is zero, the root locus for k I does not lie on the jw axis.
Instead, as shown in Fig. 14a, the beam poles cause the locus branches associated
with the ball dynamics to move into the right half plane. In practice this means that
jw
jW
t
20
20
15
10
10 -10 -5 10
-5
-10
-20
-25
(a) (b)
FIG. 14a and 14b Root locus for (a) k 2 = O. k 1 varying, (b) k 2 varying and k, at
design value.
jw
1.0
00
-1.0 -5 00
-5
-1.0
FIG. 14c Close-up oforigin for the locus ofFig. 14b, showing locus of the ball
poles.
ball
positio
time(seconds)
a small, but non-zero, coefficient k 2 is required to make the closed-loop system into
a bounded amplitude simple harmonic oscillator. A similar degree of caution is
required when employing large values of k 2 , since as indicated in the root locus for
k 2 (Fig. 14b) the beam poles migrate into the right half plane for k 2 sufficiently
large.
Despite these restrictions the magnified diagram (Fig. 14c) of the root locus of
k 2 shows that the branches of the locus associated with the ball poles closely follow
the semi-circular contour which one would expect if the beam poles were absent.
Moreover, the actual step response of the closed-loop system designed for critical
damping and undamped natural frequency of 0.7 radians/sec corresponds qualitatively
to that which would theoretically be expected (Fig. 15).
4.3 Optimal control
Two types of optimal control strategy can be demonstrated using the ball and
beam: linear quadratic regulationv" and time-optimal control." The former
is a tractable laboratory exercise if the infinite target time is considered. In this
case the optimal strategy can be synthesized, via the steady state Ricatti equation,
as a linear combination of the system states. As such linear quadratic regulation
of the ball and beam is similar in implementation to the pole-shifting experiment
described previously.
In particular, if the performance index (PI) is
ce
PI = f (x t Qx + zu 2 )dt (23)
(24)
The solution of the algebraic Riccati equation gives the optimal state feedback
gain vector as
(25)
where, for simplicity, the control gain b in equation (19) has been set to unity.
As in the case of pole shifting, the elements of the state weighting matrix can
be related to the classical transient response criteria of undamped natural
frequency w n and damping factor ~. Specifically,
X2 = bu(t) (27)
where x, is the ball position.x, is the ball velocity. The limits on the control
u(t) can be assumed to be ±I, with b scaled accordingly.
The time optimal control which transfers the ball from an initial state
{ x I (0), X 2 (D)} to a target state will involve one switch of control. From the system
equations the possible equations of motion are:
For u = + I
(28a)
Foru=-I
(28b)
If the origin of the state space is the desired final state, then the final part of the
control satisfies.
1 2
X I = - 2b x 2 x I negative
(29)
1
Xl = 2b x ~ Xl positive
The time-optimal rule thus consists of an initial period with the appropriately
signed maximum control with a switch of control sign when
(30)
Fig. 16 (curve a) shows the time optimal trajectory for the ball position (xd
transferred from an initial state Xl (0) = a, X2 (0) = 0, to the origin.
An interesting feature of time optimal control of the ball and beam is the
intuitively satisfying way in which the results of premature and retarded switching
of control are exhibited. Specifically, if the control is switched too soon the tra-
jectory bounces down the switching curve (equation (30)), rapidly alternating
between control extrema. Fig. 16 (curve b) shows the ball position trajectory when
this occurs. If the control is switched too late, the trajectory over-shoots the target
state and converges in an oscillatory manner. Fig. 16 (curve c) shows the ball
position trajectory for this case.
The appealing aspect of the ball and beam when it exhibits this behaviour is the
graphic way in which all the system states and control are exposed, so that one
actually sees the ball bouncing down the switching curve, or oscillating around the
target state.
5 CONCLUSION
The ball and beam is a simple, robust system which can be used for a variety of
control studies, some of which have been indicated here. The use of a flat beam is,
however, a special case of a more general problem and by way of conclusion, it is
interesting to speculate upon the uses of a curved beam. As an example, consider
a concave beam with uniform radius of curvature lit (Fig. 17). The linearized
dynamic equations for this system are
&+ ga 2R 2 =0 (31)
(lIt-r)(l +5~)
The system is thus a simple harmonic oscillator with natural frequency inversely
proportional to the concave radius of curvature ll. A root locus of equation (31)
ball
positio ~(c) retarded switch of control
/~-~ -
7
target
position
(a) optimal
control
1 2 t imef seconds )
can be drawn (Fig. 18) to show that by selecting a concave radius of curvature the
twin poles at the origin are split and shifted as a complex conjugate pair along the
jw axis. Conversely, if the beam is convex (lR negative), the system poles split and
shift along the real axis.
Thus by a simple modification of the beam shape two variants on the basic
double integrator system are possible.
ACKNOWLEDGEMENTS
The ball and beam experiment did not originate with us. The idea was brought to
our attention in the laboratories of the Division of Automatic Control, Lund
Institute of Technology, Lund, Sweden.
We acknowledge the advice and help given us by Professor K. J. Astrom and
his colleagues of Lund Institute of Technology. In particular the comments made
by Johan Wieslander were most helpful. During the design, construction and
testing of the equipment many helpful suggestions were made by Mr. P. Bowler
and R. Shelley of the Electrical Engineering Department, U.MJ.S.T. Postgraduate
students from the Control Systems Centre who contributed significantly are
J. M. Edmunds and B. H. Thiang.
FIG. 18 Root locus for the ball dynamics and a curved beam.
Pivot
Beam
Actuator
Input
Measured
o-----l Ball
Position
Drive
Amplifier
Measur-ed
Beam Beam
Angle Position
Output
Buffer
o---------------p---~----o+9v
loon
2N3055
Inputs Output ~
To Actuator T
PNP3055
2N3055
0 - - - - - - - 4 - - - - - - - - + - - - - - - + - - - - - - - 0 -9v
10m
+15v
loom
-15v
,----00
Input Output
From
Wire
1 2 2 IlF
•
FIG. A4 Ball position transducer output buffer.
REFERENCES
[1) Crandell, S. H. et ai, Dynamics ofMechanical and Electro-Mechanical Systems.
McGraw-Hill, (1968).
[2) Thiang, B. M.,Design Exercise, Control Systems Centre, (1976).
[3] D'Azzo, J. J. and Houpis, C. H., Linear Control System Analysis and Design - Con-
ventional and Modern. McGraw-Hill, (1975).
(4) Robins, A. J., Design Exercise, Control Systems Centre, (1976).
(5) Fletcher, P. E., Design Exercise, Control Systems Centre, (1976).
[6] West, J. C., Analytical Techniques for Non-Linear Systems. English Universities Press,
(1960).
Der Kugel-und-Balken-Regelungsversuch
Die Konstruktion und Anwendung eines elektromechanischen Regelungsversuch wird
beschrieben. Das System, das eine auf einem drehbaren Balken rollende Stahlkugelbenutzt,
repriisentiert ein einfaches mechanisches System, das jedoch eine aufschlussreiche Ubung in
der Regeltechnik darstellt.
BOOK REVIEW