0% found this document useful (0 votes)
106 views6 pages

Prototype Design and Analysis of Controllers For One Dimensional Ball and Beam System

Uploaded by

Sameer Rajpoot
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
106 views6 pages

Prototype Design and Analysis of Controllers For One Dimensional Ball and Beam System

Uploaded by

Sameer Rajpoot
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

t

1s IEEE International Conference on Power Electronics. Intelligent Control and Energy Systems (ICPEICES-2016)

Prototype Design and Analysis of Controllers for


One Dimensional Ball and Beam System
) 2 3
Sudarshan K. Valluru , Madhusudan Singh and Supriya Singh
1,2,3Department ofElectricalEngineering, Delhi Technological University, Delhi-110042, India
E-mail: [email protected]@[email protected]

Abstract-Ball and Beam structure is an under actuated window[3]. This paper presents a comprehensive
nonlinear unstable electro-mechanical system and it is one of modelling of ball and beam system and design of different
the robotic benchmark problem in control engineering. This controllers such as PID, state space, lag-lead, robust LQR
paper addresses the control and real time modelling of ball
and observer based LQG controllers for positioning
and beam system. Different types of controllers are being
control of ball on the beam. A linearized model of ball and
used to balance a ball on a beam at a pre-defined location
with precise amount of force and torque in minimum time
beam system is derived for testing of controllers and
for stable operation of the system. The accurate control of
dynamic performance of ball position is determined
ball position on beam is a challenging task. The performance through simulation study in MATLAB. Stability of open
analysis of ball and beam system is carried out using PID, loop unstable ball beam system is also described using
state space, lag-lead, robust LQR, observer based LQG Lyapunov Direct method.
controllers, and performance characteristics of the system is This research paper is organized in four sections:
presented. Lyapunov direct method is used describe the Section 11 brietly describes the mathematical model for the
unstable behaviour of ball and beam system.
ball beam system and transfer function deduction. Section
Keywords-PID; State Space; Lag-lead; LQR; LQG;
III deals with the design of different controller's viz. PID,
Lyapunov Stability
state space controller, lag-lead compensator, robust LQR
I. INTRODUCTION and observer based LQG controller. Section IV consists of
prototype implementation of ball beam system followed
The study of system dynamics and control is essential by the conclusion in Section V.
for analyzing and design of automatic control systems.
Most of the physical systems display nonlinear dynamics 11. MODELLlNG AND IDENTIFICATION OF BALL ON
and require a complex nonlinear analysis methods to A BEAM SYSTEM
investigate their performance. In recent years many
nonlinear controllers are suggested to improve the
performance of nonlinear system. A ball and beam system
is a nonlinear unstable system, where control problem is to
automatically control the angle of the beam in order to
obtain the required position of the ball on the beam by \

applying an appropriate torque to the joint. This task is 1


Gra tional
Force('"lil
difficuIt because the ball moves with an acceleration that
is proportional to the tiIt angle of the beam and ball does
not stay at one location on the beam[l]. There are two Fig. 1: A Schematic Diagram ofBall and Beam System

degrees of freedom in this system. One is the ball rolling The Fig. 1 shows the schematic representation of a
up and down the beam, and the other is beam rotating ball and beam system, here the beam is mounted on the
through its central axis. output shaft of a stepper motor that can be tiIted about its
Numerous studies have been conducted on a ball­ centre axis by applying an electrical actuating signal to the
beam system and various controllers have been proposed motor. The system is open loop unstable in control system
for control of this under actuated mechanism. The ball­ terminology because the system output (the ball position)
beam system is a bench mark example in control systems increases without limit for a fixed input (motor angle). To
but unlike other models, a stepper motor pivoted at the keep the ball in a desired position on the beam feedback
center of the beam is used here to control the position of controllers are used, so that the ball is positioned
the ball along with an accelerometer sensor which accordingly to desired position[4].
provides information related to the orientation of the
A. Mathematical Modelling
beam. Thus, as the ball moves to an extemal disturbance,
the angle of the beam is changed to counteract this The derivation of the system equations by kinematic
change[2]. The current orientation of the beam and the analysis of the force balance on the ball[5] is represented
position of the ball is displayed serially to a terminal as
978-1-4673-8587-9/16/$31.00 ©2016 IEEE [1]
1st IEEE International Conference on Power Electronics. Intelligent Control and Energy Systems (ICPEICES-2016)

mgsinl/)= Ftran51ational + Frotational = Fg (1) It should be observed the ball beam system is an
The torque developed by ball's rotational motion is unstable system and interesting control problem. The
identical to muItiplication of ball radius(R) and rotational model dynamics and the system behaviour such as open
force. According to Newton's second law the torque is loop time response, root locus, frequency response, Bode
multiplication of ball's moment of inertia and angular plot, Nichols plot and Nyquist plot are shown in Fig.2,
acceleration is expressed in equation (2) which conforms the ball beam system is unstable.
<ii Step Response
Fr = Jball; (2)

2 2
Where Jball is the moment of inertia of the spherical
ball and it is defined in equation (3) 8

Jball = '5 mR (3)


By rearranging these equations the rotational force is
attained as in equation (4)
mgsinl/)= �mx+ ; x+ ; x+mx (4) 2

where Fr represents the externally applied force, <I> is


the beam's tilt angle from the horizontal position and x is 0.5 2 2.5 3
the vertical distance between the center of the shaft and Fig. 2(a): Open Loop Response ofBall Beam System
center of ball, x is linear acceleration of the ball, R is Root Locus
radius of the ball in meters, m is mass of the ball in kg, B
is the friction constant, K is the spring constant.
0.5
B. Linearization by using Taylor Series Expansion
The nonlinear dynamics of the ball beam system will •
be linearized for a small angle sinl/) "'" I/) by using second
order approximation of truncated Taylor Series[6]. The
Maclaurin expansion (the Taylor expansion about 0) of -0.5
sine function is given equation (5)
I/) 1/)3 ,
sml/)=- --+ -1 Real Axis

1! 3!
(5) -1.5 -0.5 o
By ignoring the higher terms, the dynamical

2
Fig. 2(b): Root Loeus ofBall Beam System
expression can be approximated in the form of equation Bode Diagram
(6)
. B . K ..
mg rA'IJ = '5mx+ ; x+ ; x+mx (6)
By neglecting the spring constant K, the equation (6)
can be rewritten as in equation (7)
mg I/) = �mx+ ; x+mx (7)
The linearized system equations can be expressed in

X2
state space form by choosing ball position x =X1 and ball
velocity

[� ] = [00 2� ] Xl rO
x = as state variables and the beam tilting angle I/)

X2 - ;;;- ("5+ ;) [X2 ] + 19 ] I/)


as input.
Fig. 2(e): Bode Plot ofBall Beam System
1

0] [;�]
1 B (8)
100
y = [1 (9)
50

IJ;-=CC--
However the equation (8) represent dynamics of the �
ball position only, but the controlling position vary
through change of beam tiIting angle by controlling the
torque of stepper motor.
The transferfunction for ball beam system in terms of
-100
the ball position x(s) to the stepper motor angle I/)(s):
(5) =
M(s) = X1/)(5) (�) -180 -150 Open_LoopA"la.... (deg) -120 -90
9
52 +(mR
�+�)5 rad (10)
5
Fig. 2(d): Niehols Plot ofBall Beam System

[2]
t
1s IEEE International Conference on Power Electronics. Intelligent Control and Energy Systems (ICPEICES-2016)

Nyquisl�gram

S2r-------l���I-----1��1 11------l� S2,


40
OOl �
Saturat i on Tra nsfer F cn
20
Fig. 3(b): Ball Beam System Transfer Function
0

25

·40 .......•.• Desired reference trajectory


20
-- Ball Beam System response without controller
'"
6 �5 25 _2Rea1AxlS -1.5 1 05
.
.
( .3 · .

Fig. 2(e): Nyquist Plot ofBall Beam System


· · .

e
15
.�
x
The ball beam system operation is also subjected to a
set of restrictions: -12< V <12 (voIts),-45< <I> <45 I
iii 10
(degrees),-0.5 < x < 0.5 (m).The parameters for ball beam "'
system are given in Table L
5
TABLE I. TABLE I: BALL BEAM PARAMETERS
R Radius of the ball 0.02 m
G Acceleration of gravity 9.8 mJs2 0
0 2 3 4 5
M Mass of ball 0.1 Kg Time (Sec)

L Length of beam I m
Fig. 3(c): Ball Beam System Response with Step Reference
B The friction constant 0.002 kg-m/s
III. DESIGN AND ANALYSIS OF CONTROLLERS
C. Lyapunov Stability Analysis ofBall and Beam System
The controllers such as PID, state space, lead-lag
As per Lyapunov stability analysis[7] the ball beam
compensator, LQR, Observer based LQG controllers are
system asymptotically stable with x=O as an equilibrium
analyzed and studied for ball beam system.
point of x f(x),D 2:: Rn, let V: D 2:: R be a continuously
=

differentiable function such that V(x) < 0, then x 0 is =


A. PID Controller
"globally asymptotically stable". The linearized ball beam
System is stabilized by feedback and to achieve
system equations can be represented in state-space form
desired settIing time and overshoot we use PID
by selecting the state variables such as:
controller[8]. The transferfunction for a PID controller is
Xl X (ball's position), X2 x (velocity) and u is the
= =

given in equation (15)


beam tilting angle (I) supplied from stepper motor as an K·
C(s) Kp + 7- + Kds
=
(15)

[��] [� -�.4] [;�] + [�]


input.
For the given ball beam system The proportional gain Kp' decreases the response time
=
(11) and by increasing Kd, we can lower the overshoot and
decrease the settIing time. By using automated tuning
Using Lyapunov function V(x) which is analogous to algorithm PID gains are to be obtain for balance
potentialfunction. performance. The schematic of PID controlled ball beam
V(x) Kinetic energy + potential energy

[::J [::2]
=
system and their response is shown in Fig. 4(a) and (b).
V (x) (VVYf(x)=
(12) The PID gains, Rise time, SettIing Time, overshoot are
V (x) =
x 2 x
[!t ( )f ( ) F (13) given in Table IL

V (x) 0.1 X2 > 0


=
(14)
Hence the ball beam system is an unstable system,
which requires controllers to make the system stable. The pos�ion 1-.-----.lD
ball beam system Simulink model is shown in Fig.3 (a), Scope

system transferfunction is shown in Fig.3 (b) and system BALL AND BEAM MODEL
response without controller is also shown in Fig.3(c)
Fig. 4(a): PlD Tuned Ball Beam System
TABLE 2: PlD PERFORMANCE PARAMETERS
position 1---D
--,----1� Proportional gain(Kp) 0.59447
Integral gain(K;) 0.01316
Scope
Derivative gain(Kd) 0.28732
Rise time(sec) 0.522
BALL AND BEAM MODEL
Senling Time(sec) 1.7
Over shoot(%) 9.07
Fig. 3(a): Ball Beam System

[3]
t
1s IEEE International Conference on Power Electronics. Intelligent Control and Energy Systems (ICPEICES-2016)

Fig. 5(b): State Space Controller with Ball Beam System

2.5 ,.-----�--�--___,

- Ball Beam System response with PtO Controller


-Error

0.5

Fig. 5(c): Closed-Ioop Response with Step Input

-0.2 L...--::'
.. �----'-�---,L:-
--'-�-:-'::-
-'- �--'--�-:"-::-�-'--�c'-::-
......--l The settIing time and overshoot are satisfied for ball
o 0.5 1.5 2.5 3.5 4 4.5
Time (Sec) beam system, if the poles are moving to left side of plane
Fig. 4(b): Ball Beam System Response the settIing time is attained quickly. The constant gain is
added to the step reference to eliminate steady state error,
B. Design oJState Space Controller the ball beam system response is shown in Fig. 5( d).
Step Response
The state space controller operates altogether four
2.S ,------�---�--,
states for control of the ball beam system, which controls

f
the position of the ball, velocity of the ball, by changing 2 ·

the angle of the stepper motor and its angular velocity. � S


The controller makes use of these values to derive an error

[ ] []
signal and same used as feedback. For the ball beam � 1

system the state space parameters are derived as


-1.4286 0 1
[A] =
[ B] =

1.0000 0 0 0.02 Tme(��4ec) 0.06 0.08


"Time(Sec)
[Cl =
[0 7.0000] [D] [0] =

For matrix A eigenvalues of system are to be tested Fig. 5(d): Improved Response ofBall Beam System

[_ � ] .Since there is one pole at origin, system is


whether the system is stable or unstable, which are same
C. Lag-Lead Compensator
as the poles of the transfer fimction i.e. Poles
The phase lag- lead compensator[9] is a general form
1. 286 of controller/compensators that can be applied using a
marginally stable. Then a controller for ball beam system passive resistor and capacitor network or an RC network
that utilizes full state-feedback control[l]. The schematic with an operational amplifier. With help of Ctrllab toolkit
offull state-feedback control is shown in Fig.5 (a) in MATLAB the lag-lead compensated controllers are
designed to meet desired time response and model can be
represented in (16) and the response is shown in Fig. 6.
(s+1.091)(s+0.1)
Gc =
0.2282
(s+0.9162)(s+0.01221)
(16)

1.5 ,------.---,-S'-'-t''''-p''R''spo''-n''s''-r--,---,

- Compensaled

Fig. 5(a): Full State-feedback Control


After adding the P matrix, the state space equations c
o

� 0.5

are given as x CA - BP)x + Bu, Y Cx So the


= =

stability is dependent on eigen values of CA - BP)


matrix.By using pole placement technique we can satisfy Time (Sec)
our design requirements and fmd the controller matrix
°O�--�----1�O---�15�---2=O---�25
[P] [0.5714 2.0000].The Simulink block diagram
=

and the c10sed loop response is shown in Fig. 5(b) and Fig. 6: Response with Lag-lead Controller
Fig. 5(c).
D. Robust LQR Controller
A feedback control system has robustness against
Step Gainreference BalibeamState-Space Scope
external disturbances and uncertainties inherent in the

[4]
t
1s IEEE International Conference on Power Electronics. Intelligent Control and Energy Systems (ICPEICES-2016)

systems. The ball beam system should be controllable for


K=
[ 0 7.0000 ] (27)
design of controller is given in (17) 7.0000 0
Tc = [B, AB, . . . , A(n - 1)B] (17) Plan! noise 0(t)

The rank of transformation matrix Tc is called the


controllability index of the system and equals the number
of controllable states in the system. If rank Tc = n = 2,
the system is fully controllable. For ball beam system Tc
is given in (18)
[Tc ] =
[1.0000 -1.4286] (18)
0 1.0000
So the ball beam system is completely controllable,
the performance index for the optimal controller design is
in (19) Fig. 8(a): Observer-based LQG Control

J= � XT tf(SX)tf � ft;[XT (t) Q(t) X(t)


+ +
By using Ctrllab tool kit in MATLAB, the optimal
control Matrix Q = diag[1 1] for plant noise 0(t) =
uTtRtu(t)dt (19)
1e-3 and measured noise e(t) = 1e-6 LQG controller
Here Q and R are weighting matrices for the state signal is in (28). The response of observed based LQR
variables and the input variables, respectively, and tr is the controller is shown in Fig. 8(b) and the Bode plot for
terminal time for control action. To solve this LQ optimal observed based LQR controller is also shown in Fig. 8(c).
control problem[lO], the HamiItonianfunction is in (20) 25.3554(5+1.247)
Gc(s) =
- � [xT(t) Q(t)x(t)
(28)
H= + uT(t)R(t) u(t)] + (52 + 21.915 + 238.4)
SlepRespoose
AT(t)[Ax(t) + Bu(t)] (20)
Differentiating with respect to u
0.8
(ßHjßU) =O (21)
U = -R-BTA
The Lagrangian multiplier is A(t) = -P(t)x(t),
(22)
h6
I •
� 0.4

Where pet) is the symmetrical solution matrix of the well­
known differential algebraic Riccati equation in (23)
P + PA + AT P - PBR-BT P + Q = 0 (23) 4 Tlrne(sec) 5
So the optimal control signal is in (24)
Fig. 8(b): Response under LQG Control
U(t) = -R - BTP(t)x(t) (24)
The state feedback gain matrix K, and P is the Bo:.IeDiagram

solution matrix for the (25) is

i.: r:· :· ,: : ,: :·:· ·: : ,: :. ,· · :;:J


K = [6.7067 7.0711]
(25)
P = [6.7067 7.0711 ] (26)
7.0711 57.5252
The response of ball beam system is shown in Fig.7

.
Step Response ..

f 10
.2
.
;1 . ..." �.:;.: : . .�,:. . ,: . ]
. . 10
·'
10
0 Freqooncy (radlsec) 10
'
10
2
10
J

Fig. 8(c): Bode Plot for Observer based LQG

IV. PROTOTYPE IMPLEMENT ATION


OF BALL BEAM SYSTEM

The system includes a beam made up of polyvinyl


Fig. 7: Response ofBall Beam System with LQR Controller chloride sheet which is rotated about its center by a 12 V
permanent magnet stepper motor as per desired motion
E. Observer based LQG Controller and a ball which is an unconstrained object as it rolls
The block diagram for observer based LQG controller freely unless acted by an external force. Basically a high
is shown in Fig.8(a), the observability matrix with rank voItage and high current Darlington array IC ULN 2003 is
n=2 is given in (27) so that system is also observable. used as a driver IC to give full strength and speed to

[5]
t
1s IEEE International Conference on Power Electronics. Intelligent Control and Energy Systems (ICPEICES-2016)

stepper motor. The IC is connected to Arduino UNO such as horizontal stabilization of an aircraft during
microcontroller with ATMEGA328 as processor. landing and while experiencing turbulence. The MATLAB
The position of ball is sensed by an ultrasonic sensor simulation results along with the graphs for the controllers
HC-SR04 fixed at one end of beam which works on have been included. From output graphs it can be seen that
SONAR principle. Further the tilt sensor ADXL-335 robust LQR controller approaches the desirable
keeps a track on tilt of beam. By locating the position of performance when compared with other controllers.
ball and tilt of beam, signals could be sent to move the Unlike other systems, here the motor being used is a
beam c10ckwise or anticlockwise accordingly so as to stepper motor instead of a servo makes the system more
keep ball at the center of the beam. The beam tilt angle is economical one.
compared with the definite angle of zero degrees and PID
controller is used to minimize the error. The prototype of REFERENCES

ball beam is shown in Fig. 9. The unique features of our [ I] J. Hauser, S. Sastry, and P. Kokotovi, "Nonlinear Control Via
ball-on-beam system are as folIows: Approximate Input-Output Linearization: The Ball and Beam
Example," IEEE Trans. Automat. Contr., vol. 37, no. 3, pp. 392-
1. First, it is inexpensive compared to those
398,1992.
commercially available. [2] DJ.S. Ruth, K. Dhanalakshmi, and S.S. Nakshatharan,
2. Second, the position of ball is sensed by using "Interrogation of Undersensing for an Underactuated Dynamical
ADXL-335 sensor. There is no tear and wear by System," IEEE Sens. J., vol. 15,no. 4, pp. 2203-22 I1,20 I5.
[3] H. Sira-ramirez, "On the Control of t.he ' Ball and Beam' System:
the ball movement.
A," in 39th IEEE conference on Decision and control, 2000, pp.
3. Third, it uses a microcontroller for the 4042-4047.
implementation of the control algorithm. It [4] M. Amjad, M. I. Kashif, S. S. Abdullah, and Z. Shareef, "Fuzzy
enjoys all the convenience that comes with a logic control of ball and beam system," in 2nd International
Conference on Education Technology and Computer, 2010, vol. 3,
microcontroller.
pp. 489-493.
[5] W. Chen, X. Sui, and Y. Xing, "Modeling and Modulation of
Nonlinear Ball-beam System Controller Based on Matlab," in
Proceedings of 9th international conference on fuzzy systems and
knowledge discovery,20 I2,vol. 5,no. Fskd, pp. 2388-239 I.
[6] B. C. Chang, H. Kwatny, and S.-S. H. S.-S. Hu, "An application of
robust feedback linearization to a ball and beam control problem,"
in Proceedings of the IEEE International Conference on Control
Applications, 1998,vol. I,no. September, pp. 694-698.
C. Aguilar-ibanez and C. Aguilar-iban, "The Lyapunov direct
method for the stabilisation of the ball on the actuated beam," Int. J.
Control I, vol. 7 I79,no. April, pp. 2 I69-2 I78,20 I6.
[7] K.T. Prasad and Y.V. Hote, "Optimal PID controller for Ball and
Beam system," in International Conference on Recent Advances
and Innovations in Engineering, ICRAIE 2014, 2014,
pp. 1-5.
[8] P. Rapp, O. Sawodny, and C. Tar, "An Immersion and Invariance
based Speed and Rotation Angle Observer for the Ball and Beam
System," in proceedings of American control conference, 20 I3, pp.
Fig. 9: Proto Type ofBall Beam System 1069-1075.
[9] N. Hara, M. Takahashi, and K. Konishi, "Experimental Evaluation
V. CONCLUSION of Model Predictive Control of Ball and Beam Systems," in
proceedings of the American Control Conference, 201 I, no. 4, pp.
In this paper, the basic design of a one dimensional I 130-- I132.
ball beam system using different controllers has been
illustrated. This system emulates real control problems

[6]

You might also like