Modelling and Control of Ball-Plate System PDF
Modelling and Control of Ball-Plate System PDF
Abstract
AbstractIn this report we will have a detailed look into controlling a
Ball-on-Plate system apparatus. We will first derive the exact non-linear
differential equations of Ball-on-Plate apparatus by the use of Lagrange-
Euler equations. At the rest we derive several useful linearised model for
our system. We use the linearised model to design compensator for the
system. We simulate the results using non-linear model of system and
evaluate the results by step responses and trajectory tracking.
Contents
1 Introduction 2
3 Mathematical Modelling 3
3.1 Plant Values: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.2 Motor Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.3 Model Linearisation . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.3.1 Linearised Model of a Ball-on-Plate . . . . . . . . . . . . 7
3.3.2 State-space Model of System . . . . . . . . . . . . . . . . 8
3.3.3 Complete Linearisation of Ball-on-Plate and DC Motor . 9
4 Controller Design 10
4.1 Single Compensator in Open-Loop . . . . . . . . . . . . . . . . . 10
4.2 Compensator With Prefilter . . . . . . . . . . . . . . . . . . . . . 11
4.2.1 Multi-loop controller 1 . . . . . . . . . . . . . . . . . . . . 12
4.2.2 Multi-loop controller 2 . . . . . . . . . . . . . . . . . . . . 12
5 Result Evaluation 13
5.1 Non-linear Simulation . . . . . . . . . . . . . . . . . . . . . . . . 15
5.1.1 Trajectory Tracking Using Non-linear Simulator . . . . . 16
1
5.1.2 Coulomb Friction . . . . . . . . . . . . . . . . . . . . . . . 16
5.2 Two-Dimensional Overshoot . . . . . . . . . . . . . . . . . . . . . 17
6 Conclusions 18
7 Acknowledgement 18
1 Introduction
Balancing systems are one of most challenging problems in Control field. There
are lots of platforms for this sake like cart-pole system(inverted pendulum),
ball-beam system, double and multiple inverted pendulums[1].
The ball-on-plate system is a promoted version of the traditional ball-on-beam
control problem. The problem consists of a plate which its deviation can be
manipulated in two perpendicular directions. The goal is to carry the ball
moving on the plate to a desired position, that is to control a freely rolling ball
on a specific position or moving on a trajectory on the plate. In more precise
way, one can do stabilization control in which the goal is to carry the ball from
one specific position and hold it in the desired position or do trajectory tracking
control in which the goal is to make the ball follow a predefined trajectory with
the least error and in a the minimum time.
2
Figure 1: Side view of ball on plate system.
3 Mathematical Modelling
In this section we are going to derive the motion equations of system. In these
part we assume following simplifications:
3
Where qi stands for i-direction coordinate, T is kinetic energy of the system, V
is potential energy of system and Q is composite force.
The system has 4 degree of freedom; two in ball motion and two in inclination
of plate. Here we assume the generalized coordinates of system to be (is) xb
and yb balls position on plate and and the inclination of the plate. It is
important to note that we assume the center of x y coordinates be at center
of plate. The kinetic energy of ball consists of its both rotational with respect
to its center of mass and translational energy:
1 1
mb x 2b + y 2b + Ib x 2 + y 2
Tb = (2)
2 2
Where mb is mass of the ball and I b is moment of inertia of the ball; x b and
x b are balls translational velocities along x-axis and y-axis; x and y are balls
rotational velocities along x-axis and y-axis. The following relations between
translational velocities and rotational velocities:
x b = rb y , y b = rb x (3)
In which rb denotes balls radius. By substituting equations 3 into equations
4 we will have:
1 2 2
Ib 2 2 1 Ib
x 2b + y b2
Tb = mb x b + y b + 2 x b + y b = mb + 2 (4)
2 rb 2 rb
The kinetic energy of the plate, by considering ball as a point mass which is
placed in (xb , yb ), , consists of the (ezafi) its rotational energy with respect to
its center of mass:
Tp = 1
2 (I p + Ib ) 2 + 2 + 12 mb xb + yb 2
(5)
= 1
2 (I p + Ib ) 2 + 2 + 12 mb x2b 2 + 2xb y
b + yb2 2
Where and are plates angle of inclination along x-axis and y-axis, re-
spectively. Therefore and are plates rotational velocity. Here we can
calculate the kinetic energy of system as followings:
Where and are plates angle of inclination along x-axis and y-axis, re-
spectively. Therefore and are plates rotational velocity. Here we can
calculate the kinetic energy of system as followings: (paragraf tekrari)
T = Tb+ Tp
= 21 mb + rIbb2 x 2b + y b2 + 21 (Ip + Ib ) 2 + 2
(6)
b + yb2 2
+ 21 mb x2b 2 + 2xb y
The potential energy of the ball relative (the relative potential) to horizontal
plane in the center of the inclined plate can be calculated as:
4
Vb = mb gh = mb g (xb sin + yb sin ) (7)
Here we can derive the systems equation by Lagrangian and equations 4-7:
L = Tb + Tp Vb (8)
We use L to derive systems equations:
T L
= (Ip + Ia ) x + mb xb xb + yb , = mg cos (9)
T L
= (Ip + Ia ) x + mb yb yb + xb , = mg cos (10)
T Ib L
= mb + 2 xb , = mb xb + y b (11)
xb rb xb
T Ib L
= mb + 2 yb , = mb xb + y b (12)
yb rb yb
We assume generalized toques as x and y which are exerted torques on the
plate. From Lagrange-Euler equation we can write:
d T L
dt
= (Ip + Ib ) + mb x2 + 2mb xb xb + mb xb yb
(13)
+ mb x b yb + mb xb y mb g cos = x
d T
dt L
= (Ip + Ib ) + mb yb2 + 2mb yb yb + mb xb yb
(14)
+ mb y b xb + mb yb x b mb g cos = y
d T
dt x b L
x b = mb + Ib
rb2
b mb xb + yb + mb g sin = 0
x (15)
d T
dt y b L
y b = mb + Ib
rb2
yb mb yb + xb + mb g sin = 0 (16)
+ 2mb xb x b + mb xb yb
x = Ip + Ib + mb x2b
(19)
+mx b yb + mb xb y b + mb gxb cos
y = Ip + Ib + mb yb2 + 2mb yb y b + mb yb xb
(20)
+mb x b yb + mb xb y b + mb gyb cos
5
The equations (18)-(17) shows the relation between balls state and plates
state that is plates inclination. The equations (19)-(20) shows the effect of
external torque on the ball-on-plate system. It is obvious that working with such
complex equations is too hard. So in order to do Laplace analysis on systems
transfer function, we derive the linearised model of system in neighbourhood of
working state.
Tm (s) = Km Ia (s)
V (s) = (Ra + La s)Ia (s) + Ea (s)
V (s) = Kb (s)
= Ia (s) = [V (s) Kb (s)] / [Ra + La s]
The absolute torque exerted on the load can be found by:
L (s) Km GL (s)
G(s) = V (s) = s[(Ra +sLa )+Km Kb GL (s)]
6
Figure 2: Block diagram for an armature-controlled DC motor.
7
5
mb b xb 2 + yb + g sin = 0
x (21)
7
5
2
mb yb yb + xb + g sin = 0 (22)
7
We can linearise above equation by assuming:
Small angle of inclination for the plate(up to 5 ): 1 and 1
= sin ' , sin '
Slow rate of change for the plate: 0 and 0 = ' 0 , 2 ' 0,
2
' 0.
5
x
b + g = 0 (23)
7
5
yb + g = 0 (24)
7
By linearising the above equations, we find two separate differential equations
for each of x and y axis. Note that we can use above linear differential equations
to estimate the ball-on-plate systems states xb , yb , x b , y b . By assuming (s)
and (s) as inputs to ball-on-plate system, we find the transfer functions:
Xb (s) g
Px (s) = = 5 2 (25)
(s) 7s
Yb (s) g
Py (s) = = 5 2 (26)
(s) 7s
x1 x2 0 0
x2
B(x1 x24 + x4 x5 x8 g sin x3 )
0 0
x3
x4
0 0
x4
= 0
+ 1 0
ux
x5
x6
0 0
uy
x6
B(x5 x28 + x1 x4 x8 g sin x7 )
0 0
x7 x8 0 0
x8 0 0 1
8
Figure 3: Block diagram of the Plant.
Because
1 and
of the low velocity and acceleration of the plate rotation(||
1) we can omit the coupling term in f (x, u) and divide the system into
to sub-systems and control them independently.
x1 x2 0
x2 B(x1 x24 g sin x3 )
+ 0 ux
x3 =
x4 0
x4 0 1
x5 x6 0
x6 B(x5 x28 g sin x7 )
+ 0 uy
x7 =
x8 0
x8 0 1
9
Figure 4: Block diagram of the whole system.
MATLAB CODE:
DefineConstants();
[A,B,C,D]=linmod(PM,[0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0])
sys = ss(A,B,C,D)
sys2=tf(sys)
If we plot the root-locus plot of the above transfer function, we will get the
figure (6).
4 Controller Design
In this section we are going to design compensator for the transfer functions we
derived in previous parts. Here we propose several methods of compensation
and in
10
Figure 5: Block diagram of the motors with non-linear load characteristics.
Root-locus and step response of the first compensator are shown in figure (7).
11
Figure 6: Pole-zero map of systems transfer function.
F (s) = 16.12
s+10
C(s) =
7.2961013 s8 +5.5971014 s7 +1.9061015 s6 +3.7291015 s5 +4.5861015 s4 +3.6131015 s3 +1.7881015 s2 +4.9171014 s+6.2511013
s8 +400s7 +7104 s6 +7106 s5 +4.375108 s4 +1.751010 s3 +4.3751011 s2 +6.2511012 s+3.9071013
F (s) = 26.66
s+10
C(s) =
2.7361013 s8 +2.0991014 s7 +7.1481014 s6 +1.3981015 s5 +1.721015 s4 +1.3551015 s3 +6.7061014 s2 +1.8441014 s+2.3441013
s8 +400s7 +7104 s6 +7106 s5 +4.375108 s4 +1.751010 s3 +4.3751011 s2 +6.2511012 s+3.9071013
12
Figure 7: Root-locus and step response of the first compensator.
5 Result Evaluation
In this part we are going to evaluate the results we got from previous parts.
The main goal of this part part is to check the validity of the previous results
and whether they are valid for the case of main non-linear equations. For this
goal, we designed the comprehensive non-linear simulator to check the validity
of results.
13
Figure 8: Root-locus and step response of the second compensator.
14
Figure 10: Root-locus and step response of the third compensator.
15
Figure 11: Root-locus and step response of the forth compensator.
16
Figure 12: Main block diagram for simulation in presence of designed controller.
Figure 13: The designed controllers and non-linear implementation of the sys-
tem.
Tf = tanh ( x)
Where and are constant values. For large values of the Coulomb friction
is similar to a Sign Function and for lower values of we get softer Coulomb
friction, as shown in figure (15).
17
overshoot can be considered which is maximum distance from the zero point in
the 2D path. Figure 16 2d-overshoot point (the point with maximum distance
of zero) of a joint system consisting of two standard 2nd order linear subsystems
are drawn. Assuming n1 = n2 this will be just in the corner of rectangle, but
when n1 6= n2 this point will be on one of the sides.
2
n1
H1 (s) = 2
s2 +21 n1 +n1
2
n2
H2 (s) = 2
s2 +22 n2 +n2
6 Conclusions
In this report we derived complete equations of ball-on-plate system. We did
linearisation analysis to find the transfer function of the system. We designed
several compensator and at the rest made some analysis on the results. We tried
several trajectory tracking tasks. The final results showed that the designed
controllers had almost acceptable performances.
7 Acknowledgement
The authors would like to thank all their classmates, friends and masters that
helped on this project. They would like to thank Ehsan Omidi and Farokh
Atashzar for their illuminating discussion and ideas. They also knowledge
Dr.H.A.Talebi for his comprehensive and off course perfect instructions.
References
[1] N. Mohajerin, M. B. Menhaj, and A. Doustmohammadi, A reinforcement
learning fuzzy controller for the ball and plate system, in Proc. IEEE Int
Fuzzy Systems Conference, 2010, pp. 18.
[2] S. Awtar, C. Bernard, N. Boklund, A. Master, D. Ueda, and K. Craig,
Mechatronic design of a ball-on-plate balancing system, Mechatronics,
vol. 12, no. 2, pp. 217228, 2002.
[3] X. Dong, Z. Zhang, and C. Chen, Applying genetic algorithm to on-line
updated pid neural network controllers for ball and plate system, in Proc.
18
Fourth Int Innovative Computing, Information and Control (ICICIC) Conf,
2009, pp. 751755.
[4] X. Fan, N. Zhang, and S. Teng, Trajectory planning and tracking of ball
and plate system using hierarchical fuzzy control scheme, Fuzzy Sets and
Systems, vol. 144, no. 2, pp. 297312, 2004.
[5] D. Liu, Y. Tian, and H. Duan, Ball and plate control system based on
sliding mode control with uncertain items observe compensation, in IEEE
International Conference on Intelligent Computing and Intelligent Systems,
ICIS09, vol. 2. IEEE, 2009, pp. 216221.
[6] K. kyu Lee, G. Btz, and D. Wollherr, Basketball robot: Ball-on-plate with
pure haptic information, in IEEE International Conference on Robotics
and Automation, May 2008.
[7] D. Yuan and Z. Zhang, Modelling and control scheme of the ball-plate
trajectory-tracking pneumatic system with a touch screen and a rotary
cylinder, Control Theory & Applications, IET, vol. 4, no. 4, pp. 573589,
2010.
[8] F. Golnaraghi and B. Kuo, Automatic control systems, vol. 2.
[9] R. Dorf and R. Bishop, Modern control systems, 11th ed. Pearson Printice
Hall, 2008.
19
Figure 14: Results of trajectory tracking.
20
Figure 15: Coulomb Friction Models.
Figure 16: 2-D overshoot place. This figure shows the point which has the
maximum distance from zero for different parameters of 1 and 2 . Each curve
is a class of systems which have one subsystem and the other subsystem differs.
21
Figure 17: 2-D overshoot. This figure shows the the maximum distance from
zero for different systems with 1 = 2 according to their subsystems natural
frequencies ratios.
22