Professional Documents
Culture Documents
Copy Ball and Beam Report XDXD
Copy Ball and Beam Report XDXD
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.
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.
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].
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.05
0 Step Response
0 10 20 30 40 50 60 70 0.35
Time (seconds)
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
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
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)
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)