You are on page 1of 5

Ball and Beam Control system

Safaa Al Tameemi Andres Fernandez


Sustainable Energy Engineering Sustainable Energy Engineering
Cork Institution of Technology Cork Institution of Technology
Cork, Ireland Cork, Ireland
Safaa.al-tameemi@mycit.ie a.fernandez-bevan@mycit.ie

Andrew De Juan
Sustainable Energy Engineering
Cork Institution of Technology
Cork, Ireland
andrew.dejuan2@mycit.ie

Abstract—The system selected for this report was The Ball II. THEORETICAL MODEL OF THE PLANT
and Beam which is one of the most popular and important
laboratory models for understanding control systems
The underlying physics of the system must be understood
engineering. The mathematical model for this system is before the hardware and controller are designed. By applying
inherently nonlinear, so linearization was done in order to Newtonian mechanics, the forces and torques acting on the
improve the controllability of the system. This system is also system can be shown and the dynamics understood.
open-loop unstable and second order integrating process which is There are three main components that have moments and
widely used as a test bed for evaluating various control strategies.
This paper presents a gain scheduling PID controller for
forces acting on them: the servo motor, the beam, and the ball.
stabilizing the ball and beam system. Data acquisition and There are two degrees of freedom in this system. One is the
analyzing can be completed by virtual instrument based on ball rolling up and down the beam, and the other is the beam
MATLAB. itself rotating through its connected axis [2]. The experimental
setup of the ball and beam system is illustrated in Fig. 1. Here
the slant (angle (α)) of the beam can be changed as the beam
I. INTRODUCTION connected with the lever arm moves up and down according to
The ball and beam system is viewed as a benchmark the change of the position angle (θ) of the servo motor. In the
control engineering setup whose underlying concept can be sequel, the angle (α) of beam is changed according to the
applied to stabilization problem for diverse systems such as the movement of the position angle (θ) [3].
balance problem dealing with goods to be carried by a moving
robot, horizontally stabilizing an airplane during landing and in
turbulent airflow and spaceship position control systems in
aerospace engineering. The control schemes for ball and beam
system involve different techniques such as LQR (linear
quadratic regulator) and LQG (linear quadratic Gaussian)
controllers using state equation, neural network controllers and
PD cascade controllers [1]. One of the system include, which is
a PD cascade controller, consists of two loops (inner and outer
loop). The controller in the inner loop is used to position
control of servo motor while the outer controller modifies the
reference of the inner loop through changing position of the
ball [1]. This is a difficult control problem given that it is
complicated to produce sound system’s response in presence of
rapidly changing position of a ball. There is a need for robust
controller to achieve effective control.
The objective of this report is to investigate the effects of Fig. 1. Ball and Beam system [3]
applying a control on the Ball and Beam system in order
stabilize the ball to a desired position along the beam. Using The control goal is to govern the position of ball by
the proportional-derivative (PD) controller, a cascade control applying a suitable voltage level to the servo motor.
system is designed to meet a set of specifications. Maintaining a steady state of the ball is by adjusting an angle
of the beam through the movement of the servo motor. The
position of the ball is obtained by measuring the voltage at the
steel rod while the angle of servo motor is recorded by the

1
position of the encoder. It is difficult to directly control the
velocity and acceleration of the ball due to the friction = - mg (5)
coefficient between ball and beam as well as serial linkage
(connection) between the individual elements of the ball and
beam system [1]. By rearranging equation (5) to get the transfer function from
the gear angle (θ (s)) to the ball position (R (s)) as show in
III. CONTROL PARAMETERS equation (6) below, which represent the open loop transfer
function.
For this system it is assumed that the ball is rolling without
slipping and negligent the friction between the beam and ball.
The constants and variables in this report are defined as (6)
follows [3]:
 (m) Mass of the ball;
 (R) Radius of the ball;
 (d) Lever arm offset; V. BLOCK DIAGRAM
 (g) Gravitational acceleration;
 (L) Length of the beam; The block diagram for this system with a controller and unity
 (J) Ball's moment of inertia; feedback of the ball’s position is as illustrated in Fig. 2 below:
 (r) Ball position coordinates;
 (α) Beam angle coordinate;
 (θ) Servo gear angle.

IV. MATHEMATICAL SYSTEM


The second derivative of (r) is affected by the second Fig. 2. Block diagram of the ball and beam system[4]
derivative of the input angle (α) with contribution ignored.
The Lagrangian equation of the ball’s motion is as follow [3]:
VI. PID CONTROLLER
Proportional – Integral – Derivative (PID) controller is the
=0 (0) three term controller which has different types of control
actions. The controller system consists of applying the sum of
Linearized the equation (1) above about the beam angel, α = 0, the proportional action, an integral action and the derivative
gives a liner approximation of the system as shows in equation one[5]. It is widely used in industries for feedback control in
(2) below: unstable systems.

For any PID control problem for continuous systems, the PID
(2) transfer function is expressed in Laplace transform as
= - mgα

The relation between the beam angel to the angle of the beam (7)
(α and θ) can be approximated as liner equation as shows in
equation (3) below:

where
α= (3) KP = Proportional gain
KI = Integral gain
KD = Derivative gain
Substituting equation (3) into equation (2) to get equation (4)
below:
The PID controller works in a closed-loop system which
consists of a number of variables. The variable (e) represents
(4) the tracking error, the difference between the desired input
= - mg value (R) and the actual output (Y). The error signal is sent
back to the PID controller which is then computed of both the
By taking the Laplace transforms of equation (4) to get error signal’s derivative and integral by the controller. The
equation (5) below: signal (u) from the controller (controller output, CO) is now
equal to the proportional gain (K p) by the magnitude of the

2
error plus the integral gain (Ki) by its error plus the derivative (11)
gain (Kd) times the derivative of the error.

(8) Where Ki is the integral gain. According to this formula, the


integral action is related to the past values of the control error,
in that it sums up all the errors, taking into consideration how
A new output (Y) is obtained when the signal (u) is sent to the long and the discrepancies from the set point over time. The
plant. This basic process will keep going until the error is corresponding transfer function through Laplace transform is:
minimized thus, optimizing the system. This report details the
use of PID controller on the Ball and Beam system, simulated (12)
using MatLab.

The general characteristics of these three terms are shown in


the table below. Please note that the correlations are not
Using proportional action in conjunction to an integral action
always exactly accurate as KP, KI and KD are dependent of
i.e. a PI controller is widely used as it solves the main issues in
each other. Changing one variable will affect the output;
reducing steady-state errors associated with using only the
therefore, the table is only to be used as reference in
proportional controller.
determining values for each controller.

TABLE I. TYPICAL PID CHARACTERISTICS IN A GENRAL SYSTEM

Control
Settling Steady-
Loop Rise Time Overshoot
Time State Error
Response
Small Fig. 3. Proportional-Integral, PI Controller in automatic reset configuration
Kp Decrease Increase Decrease
Change
Ki Decrease Increase Increase Eliminate
Small Small C. Derivative Action
Kd Decrease Decrease
Change Change The derivative action is based on the predicted future values of
the control error, while the proportion action is based on the
A. Proportional Action current value of the control error and the integral action is
based on past values of the control error. The control output,
The proportional action is proportional to the current control
(u) is expressed as:
error, according to the expression
(13)
(9)
where Kd is the derivative gain. The corresponding controller
transfer function is
Where KP is the proportional gain, it increases the control
(14)
variable when the control error is large from which a transfer
function can be derived as
The derivative action predicts or anticipates the incorrect trend
(10) of the control error and counteract for it [3].

Proportional controller has an advantage of providing a small VII. ANALYSIS


control variable only when there is small error in order to
avoid excessive control efforts. A major disadvantage of using Applying a combination of the PID controller, simulated
pure proportional controller is that it produces a steady-state using MatLab to see the various effects it has on a ball and
error and it does nothing to eliminate it. beam system and to optimize the system i.e. minimize
Steady-state error is defined as the difference between the overshoots and eliminate steady-state errors.
input and the output of a system as the response reaches the
steady state. A. Proportional Controller
As seen in Fig. 3, the addition of proportional gain does not
B. Integral Action make the system stable. Increasing the value will only reduce
The integral action is proportional to the integral of the control the rise time but does not eliminate the steady-state error as
error as expressed in the time domain [3] as shown in Fig. 4. Hence, it is an unstable system and will
perpetually continue to overshoot.

3
Step Response
0.5 C. Derivative Controller
0.45 Using the derivative controller in conjunction with
0.4
proportional control (PD controller), reduces overshoot and
the settling time. By increasing both the Kd and Kp values, we
0.35
can see a faster response by the proportional control and the
0.3
dampening action by the derivative control. However, too
Amplitude

0.25 much of derivative will mean large proportional and integral


0.2 effect will have to be implemented in order to compensate for
0.15
the process to move. The derivative action will constantly try
to dampen the response which tends to destabilize the loop[6].
0.1

0.05

0 Step Response
0 10 20 30 40 50 60 70 0.35
Time (seconds)

Fig. 4. Proportional, Kp response response purely proportional action (Kp 0.3

value = 1)
0.25

Step Response
0.5
0.2

Amplitude
0.45

0.15
0.4

0.35
0.1

0.3
Amplitude

0.05
0.25

0.2
0
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
0.15 Time (seconds)

0.1 Fig. 7. Proportional-Derivative, PD action reduces overshoot (P = 10, D =


0.05
10)

0
0 10 20 30 40 50 60 70 Increasing the P value results in faster rise time but will
Time (seconds) overshoot and become aggressive. Therefore adjusting the D
Fig. 5. Increasing proportional action, P results in increased frequency but the value accordingly will result in a much smoother system with
same characteristic (Kp value = 5) minimum overshoot and reducing steady-state error. Fig. 7
B. Integral Controller shows a high P value and a low D value, although results in a
faster P response, the system would still require a stronger
Using PI minimizes the overshoot. However, PI is proving to derivative action in order to dampen the proportional action.
be an unstable system as simulated in MatLab shown in Fig. 5
[3]. The integral action causes small fluctuations in the system
which eventually goes out of control. Step Response
0.4
12
x 10 Step Response
5 0.35

4
0.3

3
0.25
2
Amplitude

0.2
1
Amplitude

0.15
0

-1 0.1

-2 0.05

-3
0
0 1 2 3 4 5 6 7 8 9 10
-4 Time (seconds)
0 10 20 30 40 50 60 70 80
Time (seconds)
Fig. 8. Proportional-Derivative, PD controller with high P and low D (P = 20,
Fig. 6. Proportional-Integral, PI action (P = 10, I = 10) D = 5)

4
D. Proportional, Integral and Derivative action Fig. 1 Proportional-Integral-Derivative controller with high values of I and D
to control the aggressive nature of P (P =12, I = 20, D = 15)
Using all three actions results in a somewhat reasonable
system, however, using only PD provides a smoother response VIII. CONCLUSION
that is best to achieve the fastest response and less steady-state As explained above, we analyzed each parameter
error. (proportional, integral and derivative) individually and
explained each one of their functions. In order to minimize the
Step Response
0.4 steady state error in the system we also combined the terms to
improve the systems response such as P, PI and PD. The most
0.35
effective turned out to be PD as it reduces overshoot in the
0.3 system and the settling time which is the parameter considered
to measure the performance.
0.25

This system is useful for demonstrating the benefits of basic


Amplitude

0.2
control methods and for demonstrating the effect of delay in a
0.15 feedback control system. It is also a good way of
0.1
understanding embedded control because its design and
implementation involve all the basic components of an
0.05 embedded control system.
0
0 5 10 15 20 25 30 35 40 45 50
REFERENCES
Time (seconds)

Fig. 8. Proportional-Integral-Derivative Controller with a high I value (P =


[1] S.-K. Oh, H.-J. Jang, and W. Pedrycz, “The design of
10, I = 15, D = 10) a fuzzy cascade controller for ball and beam system: A
study in optimization with the use of parallel genetic
PID controller on the ball and beam system as shown in Fig. 8 algorithms,” Eng. Appl. Artif. Intell., vol. 22, no. 2, pp.
has multiple overshoot; this is due to the integral action which 261–271, Mar. 2009.
accumulates the errors that affects the proportional action. The
derivative constantly monitors the proportional action and [2] A. Burghardt and J. Giergiel, “Modelling and control
dampens it each time and steady-state error is eventually of a underactuated sphere and beam system,”
minimised and eliminated. The time it takes to achieve this is Commun. Nonlinear Sci. Numer. Simul., vol. 16, no. 5,
much longer compare to just the PD, hence taking the integral pp. 2350–2354, May 2011.
component out is best for the ball and beam system.
[3] “Control Tutorials for MATLAB and Simulink - Ball
A smoother system can also be achieved by increasing the & Beam: System Modeling.” [Online]. Available:
derivative action in order to control the aggressive nature of http://ctms.engin.umich.edu/CTMS/index.php?
the proportional action. The integral action is also increased to example=BallBeam&section=SystemModeling.
further minimise the steady-state error. Fig. 9 shows a [Accessed: 23-Apr-2014].
smoother PID controller in action which is still not a better
system compared to that of the Proportional-Derivative system [4] “CTM Example: PID Control of the Ball & Beam.”
as the time it takes to reach the set point is longer. [Online]. Available: http://www-
dii.ing.unisi.it/~control/ctm/examples/ball/bbPID.html
Step Response . [Accessed: 23-Apr-2014].
0.35

[5] A. Visioli, Practical PID Control (Google eBook), vol.


0.3
2006. Springer, 2006, p. 332.
0.25
[6] “Control Engineering | Search Single Display.”
0.2
[Online]. Available:
Amplitude

http://www.controleng.com/search/search-single-
0.15 display/understanding-derivative-in-pid-
control/4ea87c406e.html. [Accessed: 23-Apr-2014].
0.1

0.05

0
0 2 4 6 8 10 12 14 16 18
Time (seconds)

You might also like