Sunteți pe pagina 1din 9

Ball and Beam System Dynamics

Derivation of the Dynamics of the Ball and Beam System


Dr Ben Cazzolato
September 2007
The following document presents the derivation of the dynamics of the ball and beam system
shown in Figure 1 below. The derivation is based on a Lagrangian formulation but could just
as easily be formulated using a Newton/Euler formulation.

r=0

Ball

Beam
Pivot
Arm
X

Pivot
R0
R1

Ball

D
d

Beam

Figure 1: Schematic of the ball and beam system


It should be noted that the following material was derived using the Symbolic Toolbox in
Matlab. Although it is expected that the code is correct, as it was vetted against other works
(discussed in the literature review and the end of this document), it is possible that the
reproduction in this document may contain some typographic errors.

Page 1

Ball and Beam System Dynamics

Definitions
Prior to commencing with the derivation of the dynamics we will make a few definitions.
Fixed Parameters
L (m) is the length of the beam,
d (m) is the distance from the pivot to the plane of ball contact on the beam,
D (m) is the distance from the pivot to the centre of mass of the beam,
R0 (m) is the radius of the ball,
R1 (m) is the distance between the axis of rotation of the ball (centre of gravity) and
the point of contact of the ball with the beam,
m (kg ) is the mass of the ball,
M (kg ) is the mass of the beam (located at d (m) from the pivot),
C1 ( N/(m/s)) is the viscous friction coefficient between the ball and the beam (and
accounts for ball rotational viscous losses to since these enter at the same dynamic
order),
J beam (kg.m 2 ) is the moment of inertia of the beam, including all rotational
components such as rotor including beam mass offset (parallel axis theorem),
g = 9.81m/s 2 is the gravitational acceleration.
Independent Variables
r (m) is the displacement of the ball along the beam. Positive r is when the ball is
traveling to the right and r = 0 represents the centre of the beam,
(rad) is the angular rotation of the beam, where a counter-clockwise direction is
positive,
i (A) is the current flowing through the servo-motor,
V (V) is the voltage applied to the servo-motor.
Dependent Variables
(Nm) is the torque the servo-motor applies to the beam, where a counter-clockwise
direction is positive,
Fg ( N) is the force due to gravity acting through the centre of mass of the ball,

F f ( N) is the rolling constraint force on the ball.

Electrical System
Rm () is the electrical resistance of the servo-motor,

K m (Nm/A) is the electromotive torque constant of the servo-motor, and is equal to


the back emf constant for SI units,
Lm (H) is the electrical inductance of the servo-motor,

C2 ( Nm/(rad/s)) is the viscous damping constant of the servo-motor rotor,

J m (kg.m 2 ) is the moment of inertia of the servo-motor rotor.

Page 2

Ball and Beam System Dynamics

Assumptions
Before deriving the dynamics of the system a number of assumptions must be made. These
are:
The motor shaft and the beam are assumed to be rigidly coupled and infinitely stiff
There is no skidding between the ball and beam contact
There is no backlash in the motor/gearbox assembly
There is no static friction in either the ball/beam contact or in the motor/gearbox
assembly and damping is limited to viscous losses

Position, velocity and acceleration of the ball


From the geometry of the ball and beam we can define the position of the centre of the ball in
Cartesian (x and y) coordinates as
xc = r cos( ) (d + R1 )sin( )
y c = r sin( ) + (d + R1 )cos( )

Differentiating this with respect to time we get the velocity of the ball
x& c = r& cos( ) r sin( )& (d + R1 )cos( )&
y& = r& sin( ) + r cos( )& (d + R )sin( )&
c

And again to get the acceleration of the ball


&x&c = &r&cos( ) 2r& sin( )& r cos( )(&) 2 r sin( )&& + (d + R1 )sin( )(&) 2 (d + R1 )cos( )&&
&y& = &r&sin( ) + 2r& cos( )& r sin( )(&) 2 + r cos( )&& (d + R )cos( )(&) 2 (d + R )sin( )&&
c

Angular position, velocity and acceleration of the ball


We can use geometry to also determine the angle that the ball has turned from
r
=
R1
Therefore the angular velocity and the angular acceleration of the ball is given respectively by
r&
& = &
R1
&r&
&& = &&
R1
The moment of inertia of the ball is given by that of a sphere
2
J ball = mR 02
5

Page 3

Ball and Beam System Dynamics

Lagrangian approach to the system dynamics


We now proceed with a Lagrangian formulation of the system dynamics of the mechanical
system.
First define the potential energy of the system
E p = mg (r sin( ) + (d + R1 ) cos( ) ) + MgD cos( )
144444244444
3 14243
Beam

Ball

Now define the kinetic energy of the system


1
1
1
Ek = m ( x&c ) 2 + ( y& c ) 2 + J ball (& ) 2 + J beam (&) 2
2 4444424424443 1
2 4243
1

Ball

Beam

Substituting the expressions for the moment of inertia of the ball and the angular velocity of
the ball gives
2
2
1 r& cos( ) r sin( )& (d + R1 ) cos( )& 1
r&
1
2 &
+ mR0 + J beam (&) 2
Ek = m
2
2 + r& sin( ) + r cos( )& (d + R ) sin( )& 5
R1
2 4243

1
1
144444444444424
444444444443
Beam

Ball

We may now define the Lagrangian being the difference in kinetic and potential energies,
L = Ek E p
From this we obtain the Lagrange equation
L
L
+ Ci q& i

= Qi
t q& i
qi
where qi = r, is the generalised coordinate, Ci is a generalised viscous damping coefficient
and Qi = 0, is the generalised force.

System differential equations


Evaluating the Lagrange equation for both qi = r & , the two fundamental differential
equations of the ball and beam system are:
2
2 R2

0
&& d R 2 R0 r & 2 + g sin( ) + C r& = 0

+
m &r&1 +

(1)
1
1
2

{ 1
424
3 {
5 R1 Centrifuga
5 R1

l
Ball
Gravitational
Damping

()

and

2 R0
2

+ && J beam + m R12 + R02 + r 2 + d 2 + 2 R1d


m&r& d + R1 +
{
Beam
5

1
442454R4
14
3
Rotation 1444442444443
Ball
Rotation

Ball Translation

+ 21
mr
r&& gMD sin( ) gm(sin( )( R1 + d ) + r cos( ) ) + C2& =
23
14243 144444244444
3 {
Coriolis

Beam Gravitational

Ball Gravitational

( 2)

Beam
Damping

Page 4

Ball and Beam System Dynamics

These two equations can be solved in terms of the acceleration of the ball and angular
acceleration of the beam, as given by
2
3
&2

5 R 2 mgr cos( ) 5 gR sin( ) J


1
1
beam 2 R0 mgr cos( ) + 5 R1 mr

+ 5 R1 mr 3 & 2 5 R12C2& 2 R02C2& 5 R1C1r&J beam / m + 2 R02 mgd sin( )

+ 5 R12 MDg sin( ) + 2 R02 MDg sin( ) 5 R1dmgr cos( ) 5 R1mgr 2 sin( )
2
2
+ 5 R1 + 5 R1d + 2 R0

2
2
2
2
&
&
&
&
&

+ 5 R1dMDg sin( ) 5 R1C1rd 2 R1 R0 C1r 5 R1C1rr 4 R0 mrr


2

2
2
2
2 & 2
3
&
&

10 R1 C1dr& 10 R1 mrr& + 2 R0 R1mr + 5 R1rmd 5 R1 C1r&


2
2

2
+ 5 R1r & J beam 5 R1C2 d& + 10 R1 dmr & 10 R1dmrr&&

&r& = R1
2 R02 md 2 + 2 R02 mr 2 + 5 R12 mr 2 + 5 R12 J beam + 2 R02 J beam

()

()

()

()
()

()

(3)

and

()

5 R 3 mr & 2 5 R 3C r& 4 R 2 mrr&& 5 R 2 C & + 5 R 2 MDg sin( ) 5 R 2 mgr cos( )


1 1
0
1
2
1
1

1
2
2
2
2
2
2
&
&
&
+ 5 R12 + 2 R02
+ 2 R0 MDg sin( ) 2 R0 C 2 5 R1 C1dr& + 5 R1 dmr 10 R1 mrr&

2 R1 R02 C1r& + 2 R02 R1mr & + 2 R02 mgd sin( ) 2 R02 mgr cos( )

&
&
=
2 R02 md 2 + 2 R02 mr 2 + 5 R12 mr 2 + 5 R12 J beam + 2 R02 J beam

()

()

]
(4)

Page 5

Ball and Beam System Dynamics

Linearised state equations for mechanical system


If we linearise the expressions about the equilibrium positions:
re = 0
r&e = 0

e = 0
&e = 0

(5)

using a Jacobian linearization we obtain the following linearised state equations,


r& 0
&r& A
= 21
& 0
&&
A41

1
A22

0
A23

0
A42

0
A43

0 r 0
A24 r& B21
+
1 0

A44 & B41

( 6)

where
A21 = mgR1 (5R1d + 2 R02 + 5R12 ) /(2 R02 md 2 + 5R12 J beam + 2 R02 J beam )
A22 = R12C1 (2 R02 + 5d 2 + 10 R1d + 5R12 + 5 J beam / m) /(2 R02 md 2 + 5R12 J beam + 2 R02 J beam )
A23 = gR1 ( 2 R02 MD 5 R1 J beam + 2 R02 md + 5 R12 MD + 5 R1dMD ) /( 2 R02 md 2 + 5 R12 J beam + 2 R02 J beam )
A24 = C2 R1 (5 R1d + 5 R12 + 2 R02 ) /( 2 R02 md 2 + 5 R12 J beam + 2 R02 J beam )
A41 = mg (5 R12 + 2 R02 ) /( 2 R02 md 2 + 5 R12 J beam + 2 R02 J beam )
A42 = C1 R1 (5 R1d + 5 R12 + 2 R02 ) /( 2 R02 md 2 + 5 R12 J beam + 2 R02 J beam )
A43 = g ( 2 R02 md + 5 R12 MD + 2 R02 MD ) /( 2 R02 md 2 + 5 R12 J beam + 2 R02 J beam )
A44 = C2 (5 R12 + 2 R02 ) /( 2 R02 md 2 + 5 R12 J beam + 2 R02 J beam )
B21 = R1 (5 R1d + 5 R12 + 2 R02 ) /( 2 R02 md 2 + 5 R12 J beam + 2 R02 J beam )
B41 = (5 R12 + 2 R02 ) /( 2 R02 md 2 + 5 R12 J beam + 2 R02 J beam )

Page 6

Ball and Beam System Dynamics

Linearised state equations for coupled mechanical and electrical system


The differential equation describing the electrical subsystem for a DC motor may be found
using Kirchhoffs law:
Lm i& + Rm i + K m& = V (7)
which may be arranged in terms of the derivative of the current i&
V Rm i K m&
i& =
Lm

(8)

The torque produced by the dc motor is


= K mi
We can now merge the two state equations (and knowing that the torque produced by the
motor is = K m i ) to give the fully coupled state equation:
0
r&
&r& A21
0
& =
&& A41

i& 0

A22

A23

A24

A42

A43

A44
Km
Lm

r 0

B21 K m 0
r&
0 0
V
+
B41 K m & 0

Rm 1
i
Lm Lm
0

(9)

Page 7

Ball and Beam System Dynamics

Literature review
There are numerous papers addressing the ball and beam system. Some of these are reported
here and are grouped according to simplifications/assumptions. Given the relatively simple
dynamics there is a surprising lack of published works presenting the full dynamics.

Sobhani et al: C1 = C 2 = 0
Sobhani et al1 appear to be the only authors that have attempted to completely describe the
non-linear dynamics of the ball and beam system. Their results do not agree with Equations
(1) and (2) above. The only apparent assumption they make is that the system is lossless, ie
C1 = C 2 = 0 . They only consider the mechanical system and do not calculate the coupled
electro-mechanical system.
They use a slightly different notation where R1 = r * , d = h* , D = s0 , = , r = x .
It should be noted that there are many errors in their paper. There is a small dimensionality
error in their equation for the beam response (Equation 10); the term mgr cos( ) is missing
the r . There also seems to be terms missing g sin( )(mR1 + md ) for the fact that the centre
of mass of the ball does not pass through the pivot point. There is an unusual velocity term
m(d + R1 )(&) 2 which seems to be some sort of Coriolis force? Finally the coefficients of
the && do not match at all.

White and Patenaude: R1 = R0 & M = D = d = 0


One of the most comprehensive and accurate models of the ball and beam system is that of
White and Patenaude2. The only simplifying assumptions they make are that the ball rolls
along its outer radius R1 = R0 and that there is no offset for the beam rotation d = 0 . The
authors present both a Lagrangian formulation and a Classical formulation employing
Newtons and Eulers laws. Their results closely match the Equations (1) and (2) above. Only
the mechanical subsystem is considered and no electrical subsystem is presented.

Hauser et al: C1 = C2 = 0, M = D = 0, R1 = R0 & d = R1


Hauser et al3,4 inspired a flood of nonlinear control papers5,6,7,8 with application to the ball
and beam system. In their work they assume that there are no losses C1 = C 2 = 0 , that the ball

Sobhani, M., Neisius, B., Jayasuriya, S., Rumler, E. and Rabins, M.J. (1992) Some new insights on the
classical beam and ball balancing experiment, Proceedings of the American Control Conference, 450-454
2
White,W. and Patenaude, J. Ball and beam dynamics, Kansas State University:
http://www.mne.ksu.edu/research/laboratories/non-linear-controls-lab/main-pages/problemtypes/ball-and-beam
3
Hauser, J., Sastry, S., & Kokotovic, P. (1989) Nonlinear control via approximate inputoutput linearization:
The ball and beam example, 28th control and decision conference, Tampa, FL (pp. 19871993).
4
Hauser, J., Sastry, S. and Kokotovic, P. (1992) Nonlinear control via approximate input-output linearization:
The ball and beam example, IEEE Transactions on Automatic Control, 37(3), 392-398.
5
Li, J., Wang, H.O., Niemann, D. and Bushnell, L. (1998) Nonlocal control of the ball and beam system:
Regulation and tracking, IEEE World Congress on Computational Intelligence.
6
Guo, Y., Hill, D. and Jiang Z.-P. (1996) Global nonlinear control of the ball and beam system 1996.,
Proceedings of the 35th IEEE Conference on Decision and Control, 3, 2818-2823.
Page 8

Ball and Beam System Dynamics

rolls along its radius (not very practical) R1 = R0 and that the centre of mass of the ball passes
through the axis of rotation of the beam d = R1 which drastically simplifies the resulting
equations.
There is a small error in their work: they failed to include the dynamic forces that occur on the
ball due to the rotational acceleration of the beam, namely
r&
r&
1
1
J ball ( ) 2 J ball (& ) 2 .
R1
R1
2
2
14
4244
3 144244
3
Hauser

Correct

In doing so, there are two terms that have been neglected in the nonlinear DE:

2
J
J
&r& m + ball
m&& ball mr & + mg sin( ) = 0
2
R0
R1

1424
3

()

missing term

and
J &r&
ball + &&(J ball + J beam + mr 2 ) + 2mrr&& + mgr cos( ) =
R0
123
missing term

Jonsonn et al: C1 = C2 = 0, R1 = R0 & D = M = 0


Jonsonn9 and others at the University of Lund have derived the dynamics of the ball and beam
system. Their analysis includes the offset from the plane in which the ball rolls and the
rotation axis of the beam. However, they neglect the coupling from the ball position back into
the dynamics of the beam angle, and simply model the angle of the beam as a simple servo
system,
K
( s)
.
=
V ( s ) s ( sT1 + 1)

Wellstead: C1 = C2 = 0, R1 = R0 = 0, J ball = 0 & M = D = d = 0


Wellstead10 only considers the ball as a point mass and hence neglects all rotational inertial of
the ball. He also includes an unusual translational (rather than rotational) spring-damper
attached the beam.

Rosales: C1 = C2 = 0, D = M = 0,& = 0 & d = R1 R0


Rosales11 assumes that the pivot of the beam lies in the plane of the ball contact, ie
d + R0 R1 = 0 or d = R1 R0 . Rosales neglects to include the centrifugal forces. When
calculating the torque balance on the beam, any inertial effects from the ball are neglected as
in damping, so the equation for the beam response is simply a double integrator.
7

Zhang, F. () Chapter 1 Feedback linearization control of systems with singularities: A ball-beam revisit,
Mathworks.
8
Lai, M.C., Chien, C.C., Cheng, C.Y., Xu, C.Z. and Zhang, Y. (1994) Nonlinear tracking control via
approximate backstepping, Proceedings of the American Control Conference, Baltimore, 1339-1343.
9
Jonsonn, O. (1990) Modelling and control of the ball and beam process.
10
Wellstead, P. (2000) Introduction to physical system modelling, Control Systems Principles,
http://www.control-systems-principles.co.uk/ebooks/Introduction-to-Physical-System-Modelling.pdf
11
Rosales, E.A. (2004) A ball-on-beam project kit, Undergraduate Thesis, Department of Mechanical
Engineering, MIT.
Page 9

S-ar putea să vă placă și