Application of Sliding Mode Control To The Ball and Plate Problem
Application of Sliding Mode Control To The Ball and Plate Problem
Keywords: Ball and Plate System, Sliding Mode Control, Robust Control, Multivariable Control, Nonlinear Control.
Abstract: This paper proposes and investigates the application of sliding mode control to the ball and plate problem.
The nonlinear properties of the ball and plate control system are first presented. Then the experimental setup
designed and built specifically for the purpose of this research is discussed. The paper then focuses on the im-
plementation and thorough evaluation of the experimental results obtained with two different control schemes:
the linear full-state feedback controller and the sliding mode controller. The latter control strategy was se-
lected for its robust and order reduction properties. Finally the control performance of the two controllers
is analysed. The sliding controller manages to obtain a faster and more accurate operation for continuously
changing reference inputs. The robustness of the proposed control scheme is also verified, since the system’s
performance is shown to be insensitive to parameter variations.
z Tx y
1 INTRODUCTION Plate
ball
The ball and plate system, depicted in Figure 1, is one Qy
of the most popular educational models developed
by control engineers to teach and validate various Qx
x
control strategies. The control objective of the ball Ty
and plate problem is to balance a ball, or to make Pivot
it track a desired trajectory, on a flat plate, solely
by tilting the plate relative to the horizontal plane.
This system is of particular interest to the control
community because it allows the user to study and Figure 1: The ball and plate system.
validate a wide class of both linear and nonlinear
control schemes, before applying them to real-life multiple-output (MIMO) system, creating an interest-
applications that exhibit similar dynamics. ing situation where engineers can study and observe
the effects of cross-coupling between different inputs
This control challenge, which reportedly originated and outputs. In addition the ball and plate setup is
in the mid 1990s from Rockwell laboratory of also nonlinear and open-loop unstable. All these
Czechoslovakia University, is an extension of the properties lead to several control challenges that are
traditional ball and beam system (Moarref et al., still being addressed by current research.
2008), (Wang et al., 2007), (Liu and Liang, 2010).
The ball and beam problem is a two degrees of Throughout the years a variety of control topologies
freedom (DOF) system whose objective is to stabilize have been applied to the ball and plate problem.
a rolling ball on a rigid beam. In contrast the ball Awtar and Craig, in (Awtar et al., 2002), applied a
and plate system exhibits four DOF, namely the two two-loop cascaded control strategy where the inner
independent motions of the free rolling ball about the loop controlled the plate’s actuation mechanism
plate’s plane and the two independent and orthogonal and the outer loop controlled the ball dynamics of
inclinations of the plate which indirectly control the the system. The response of the inner loop, for
ball’s motion. Since the system exhibits less actuators such topologies, needs to appear instantaneous with
than DOF, then it is clearly underactuated. Another respect to the outer loop. The inner loop controller
property of this setup is that it is a multiple-input consisted of a Proportional-Integral-Derivative (PID)
servo controller while the ball dynamics were con- complexities involved in the ball and plate setup.
trolled through a lead compensator. Similar linear Papers (Moarref et al., 2008), (Awtar et al., 2002),
cascaded topologies like the linear full-state feedback (Ker et al., 2007) present different mechanisms that
controller can also be used where the inner loop can be used to implement the actual ball and plate
usually consists of a digital torque controller while system. The L-shaped mechanism presented in
standard LQR and pole-placement design procedures (Awtar et al., 2002), is the most popular mechanical
are applied to the outer loop. Such linear topologies structure, to transmit the necessary torques. In fact
manage to achieve a limited performance. This is due this is the standard actuation mechanism used in
to the unaccounted nonlinear dynamics that become educational setups and research papers (Jadlovska
more dominant the further the states are from the et al., 2009), (Wang et al., 2012). Variations of
system’s equilibrium point. On the other hand in the same mechanisms are presented in (Yuan and
(Moarref et al., 2008), (Wang et al., 2007) and (Yuan De-hu, 2009),(Ker et al., 2007) and (Yuan and
and De-hu, 2009) the authors used a fuzzy estimator Zhang, 2010) where different types of actuators
in the outer loop to include some ”intelligence” in the (pneumatic cylinders and magnetic levitation) are
control action action used to regulate the ball position. used. The main limitation of such structures is the
resulting small angle plate deflections allowed by
In (Ho et al., 2013) a standard linear full-state the actuating mechanism. Moarref (Moarref et al.,
feedback controller is used with the feedback lineari- 2008) presented a different actuation mechanism
sation topology to control the ball and plate system. where two stepper motors are located at the sides
Feedback linearisation techniques are subject to lim- of the plate. One of the motors is directly coupled
itations such as the undefined relative degree of the to a metal frame supporting the rotating plate. The
linearised ball and plate system at certain locations. other motor is actuating the plate’s motion through
The authors managed to apply an approximative a mechanical linkage. This structure allows a larger
input-output feedback linearisation technique, where range of motion, but it is subject to limitations when
higher terms of the output could be ignored. A the two motors are operating simultaneously. Like
similar control topology that tries to force a nonlinear the previous mechanical structures, the encoders do
system to behave like a linear system, is the recursive not provide direct feedback of the plate’s angular
backstepping method (Khalil, 2002). This method movements. Inaccurate feedback will deteriorate the
has been successfully applied to regulate the ball’s overall performance of the closed-loop system. Such
position of two different ball and plate setups in (Ker limitations are not desirable for a setup intended to
et al., 2007) and (Hongrui et al., 2008). On the other test nonlinear topologies. Section 3 discusses the ball
hand papers (Liu and Liang, 2010) and (Liu et al., and plate hardware that we designed and constructed
2009) manage to successfully simulate different to overcome the limitations imposed by the already
sliding mode topologies on the ball and plate model. available structures.
Encoder
sired closed-loop eigenvalues. The full-state control
feedback law, u, is given by:
Base u = −KT x + gr (5)
where:
r is the desired reference input.
Figure 2: The mechanical design of the proposed ball and K is a gain matrix that ensures that the system
plate system.
achieves the desired closed-loop eigenvalues.
x is the state vector of the system.
g is the feedforward gain that ensures zero steady-
state error between the system’s output and its ref-
erence input.
Figure 4 shows how this topology is applied to
the ball and plate problem. Note that the block
diagram does not show the inner-most loop which
controls the armature currents requested by the outer
state-feedback regulators. In this case the current
response is assumed to be instantaneous with respect
to the state-feedback regulator. Another observation,
from Figure 4, is that two state-feedback regulators
are required to control the two axes of the system.
This is due to the linearisation process presented in
Section 2 which decouples the two axes of the ball
and plate system from each other. Hence, when using
classical control design procedures, like the state-
feedback linear regulators, the effects introduced by
cross-coupling terms are ignored. Recall from the
nonlinear model, shown in (1) - (4), that these terms
become more dominant for larger non-equilibrium
conditions and thus limit the type and range of
achievable performance. This is further discussed in
Figure 3: The constructed ball and plate system. Section 6.
by dividing the computations between eight proces- The state-feedback regulator, shown in Figure 4, is
sors working simultaneously. Hence it is able to track unsuitable for continuously changing inputs or in
and provide the ball’s location, to the main process- cases where the system is subjected to external dis-
ing unit, at a 30Hz rate. This tracking update rate turbances. Hence an extra integral action is added to
was verified that is high enough to capture the desired the feed forward path of each regulator. This modifi-
closed-loop dynamics. cation adds another state variable to both axes while
leaving the actual design process, for the calculation
of value K, unchanged. The results shown in Sec- show the inner-most current loop since it is assumed
tion 6 were obtained with this modified state-feedback that this exhibits an instantaneous response with re-
topology, which is usually referred to as the state- spect to the control actions requested by the PID reg-
feedback tracker. ulators. Ideally the PID controllers should also ap-
pear instantaneous with respect to the switching con-
xref + Tx trol action that is requested by the outer sliding mode
gx x controllers. The high control activity requested by the
Ball & sliding controller is very difficult to achieve with any
yref + Ty Plate y mechanical servo mechanism, resulting in a degrada-
gy Model
tion of the system’s output response. Recall that the
simulation results shown in (Liu and Liang, 2010) and
Kx T (Liu et al., 2009) did not take into consideration the
x=[x ẋ θx θ̇x ]T
plate dynamics and their effects. But such matters
Ky T
y=[y ẏ θy θ̇y ]T cannot be ignored when the proposed scheme is to
be implemented and validated on the the constructed
Figure 4: Linear regulator topology. ball and plate hardware. This is further discussed in
Section 6.
θx
5 SLIDING MODE CONTROL xref + θxref Tx x
SM Cx + P IDx Ball &
Sliding mode control aims to enforce the system tra- yref + θy ref Ty Plate
SM Cy P IDy Model
jectories into a desired manifold in order to obtain the +
θy y
desired closed-loop dynamics. This is achieved by
using a discontinuous control action (Slotine and Li,
Figure 5: The sliding mode control topology.
1991). This topology can guarantee a suitable system
response even in the face of model uncertainties and
The works in (Liu and Liang, 2010) and (Liu et al.,
external disturbances. Moarref (Moarref et al., 2008)
2009) differ in the way they tackle the nonlinearities
shows only one set of results from the experimental
present in the ball dynamic equations. Liu and Lang
implementation of the sliding mode controller, where
remove the cross-coupling terms leading to a decou-
the ball had to balance at the centre of the plate. The
pling of the two axes In (Liu et al., 2009) the au-
plot indicates that the ball took approximately nine
thors assume a plate deflection of ±5o , leading to the
seconds to stabilise at the origin. In (Liu and Liang,
removal of trigonometric terms from the mentioned
2010) and (Liu et al., 2009) the authors manage to
equations. Unlike (Liu and Liang, 2010), the authors
simulate this nonlinear control topology on the ball
of (Liu et al., 2009) retain the cross-coupling terms
and plate model. Liu and Liang, specify that they
which are estimated through an uncertain item ob-
used a double feedback structure to control the full
server. More accurate system dynamics would reduce
ball and plate dynamics (Liu and Liang, 2010). On
the need for large switching functions to ensure sys-
the other hand (Liu et al., 2009) assumes that the
tem robustness. For the scope of this research the ef-
plate dynamics do not affect the ball’s position. In
fects introduced by the cross-coupling terms were not
both cases, only the ball dynamic equations are used,
considered during the design procedure. Equation (1)
and an ideal servo response is assumed for the plate
describes the ball dynamics, in the x-direction, of the
dynamics. This assumption was made due to the
ball and plate system. Removing the cross-coupling
limitations of standard sliding mode control design
terms from (1) results in the standard affine nonlinear
topologies, which are based on nonlinear models
second order model:
that have a scalar output and are affine in the control
1
input. Hence the simulations, in both papers ignore ẍ = ( ) (−mb g sin θx ) = bu(θx ) (6)
the effects introduced by the plate dynamics. Jb
mb + r2
b
Figure 5 shows the full sliding mode control topology where:
that we are proposing and that we have implemented
u(θx ) = sin θx and b= ( −mb g )
on the constructed ball and plate experimental testbed, J
mb + 2b
presented in Section 3. To control the plate dynamics rb
a PID controller was designed, leading to a total of The primary aim of the discontinuous switching con-
three cascaded loops. Figure 5, like Figure 4, does not troller is to impose the desired dynamics on the sys-
tem being controlled. For a second order system, the Each paper contributed different terms to the standard
resulting surface s would have the following form: sliding mode control equation, shown in (8), to im-
prove the overall performance of the system. In (Liu
s = x̃˙ + λx̃ (7)
and Liang, 2010), the authors add the proportional
where: term αs(t) which reduces the time the trajectory takes
x̃ = x − xd is the tracking error between the sys- to reach the sliding surface. On the other hand, in
tem’s output and the desired reference input, xd . (Moarref et al., 2008) the authors tried to eliminate
the chattering effects by replacing the discontinuous
λ is a strictly positive constant that sets the desired signum function with a continuous saturating func-
dynamics of the sliding surface. tion. Another modification is to add an integral term
The switching action ensures that the state trajectory to the sliding surface which will improve the con-
of the system reaches and remains on the sliding sur- troller’s performance to continuously changing refer-
face. Once the state trajectorby reaches the sliding ence inputs. When adding the integrator to the sliding
surface, the dynamics defined by λ will be imposed on mode controller, (8) changes to:
the system’s output response. Another action that can ( )
1( )
be added in conjunction with the switching function is u = arcsin ẍd − 2λx̃ − λ x̃ − βsgn(s)
˙ 2
(9)
the equivalent control term, ueq . To obtain the ueq ex- b̂
pression, ṡ is assumed to be equal to zero and ẍ terms
are substituted with (6). Theoretically the derived ex-
pression would result in a continuous control law that 6 RESULTS AND EVALUATION
can maintain the trajectory on the desired sliding sur-
face provided that the exact model of the system is This section will focus on the results obtained when
known. In this case equivalent control could theo- the presented control topologies where applied to the
retically replace the discontinuous control function. constructed hardware. Figure 6 shows the results ob-
Practically this is never the case due to model uncer- tain when the linear full-state tracker and the sliding
tainties and external disturbances present in the actual mode tracker were implemented on the constructed
system. Hence the following control action is used: ball and plate system. Recall from Section 4 that
( ) linear control topologies do not take into considera-
1( )
u = arcsin ẍd − λx̃ − βsgn(s)
˙ (8) tion nonlinear and cross-coupling terms. These terms
b̂ become more dominant with faster responses and
where: larger ranges of operation. Faster specifications al-
b̂ is an estimate of the nonlinear model coefficient ways result in smaller ranges of operation and stabil-
b, shown in (6). ity. Hence the performance requirements had to be
limited to ensure that the ball reached the desired tra-
βsgn(s(t)) is the bang-bang action, multiplied by jectory even if its initial conditions are not on the de-
a gain β, which ensures the system’s robustness. sired trajectory. For successful operation the tracker
specifications had to be decreased to a 0.6s rise time
One of the greatest advantages of this topology is and a 15% peak overshoot. Faster requirements are
the intuitive tuning of control parameters λ and β, possible, but would not guarantee stability if the ini-
due to the sliding mode’s order reduction property. tial position of the ball is not on the desired trajectory.
Control parameter λ has a direct influence on the For the set specifications the following tracker param-
control bandwidth of the whole system. Two factors eters were derived:
that limit the selection of λ, hence limiting the [ ]
performance that can be achieved by the system, are Kx T = −18.43 −7.023 10.41 1.049
[ ]
neglected time delays and the control loop’s available Ky T = −5.412 −1.783 2.643 0.2689
sampling rate. Switching gain β determines how
gx = −23.86 gy = −6.059
fast the trajectory is moving towards the surface
and the resulting switching that slides the trajectory The linear tracker results, in Figure 6, show how
along the selected sliding surface. When selecting the system behaves when subjected to a sinusoidal
parameter β a compromise between a faster response reference input with a ±0.12m magnitude and
and smaller chattering effects must be found. Proper frequency of 0.1Hz. The tracker’s response resulted
selection of these control variables should lead to an in an attenuated output that lagged behind the desired
asymptotically stable system as discussed in (Liu and reference input. The resulting root mean square
Liang, 2010). (RMS) tracking errors, for the x and y axes, were
equal to 0.0545m and 0.0497m respectively. The
Linear Tracker Results
heuristically tuned according to the selection criteria
x-axis position (m) vs Time (s) y-axis position (m) vs Time (s)
discussed at the end of Section 5:
0.1
0.1
β = 0.35 λ = 2.5
x-axis position (m)
0.05
0
The sliding mode tracker results, in Figure 6, show
0
the system’s output response when it was subjected to
a sinusoidal signal with a magnitude of ±0.11m and a
-0.05 -0.05
-0.1 -0.1
frequency equal to 0.3Hz. The resulting RMS track-
0 10 20 30
-0.15
0 10 20 30 40 ing errors for the x and y axes were equal to 0.0055m
Time (s) Time (s)
Sliding Mode Tracker Results and 0.0096m respectively. Unlike the linear tracker
x-axis position (m) vs Time (s) y-axis position vs Time (s) scenario, the trajectory response of the sliding con-
0.1 0.1 troller was not limited to ±0.11m but during opera-
0.05 0.05 tion the magnitude of the sinusoidal reference input
x-axis position (m)
0
was successfully increased to ±0.14m without deteri-
0
orating the overall response of the system. Hence the
-0.05
-0.05 sliding mode controller managed to get a faster and
-0.1
-0.1 more precise response for bigger ranges of operation.
0 2 4
Time (s)
6 8 10 0 2 4
Time (s)
6 8 10 This is due to the controller’s robust nature which
makes the output response more insensitive to the in-
Figure 6: Results obtained when Linear and Sliding Mode creasing effects introduced by the nonlinear dynamics
trackers were applied to the ball and plate setup. present in the system. Moreover, in contrast to the lin-
ear controller, the sliding-mode scheme managed to
observed output delay and attenuation continued to cope very well even in cases when the plant dynamics
increase when faster reference inputs were requested. were modified deliberately, by changing the ball with
The resulting tracking error, when the reference input one that is forty times heavier (a metal ball bearing
was increased to 0.3Hz, increased to 0.1217m and instead of a tennis ball). In the case of the sliding-
0.113m for the x and y axes respectively. These large mode controller there was no degradation in perfor-
delays and errors are due to the system’s closed-loop mance, while the linear controller simply went unsta-
bandwidth which is unable to handle such high-speed ble. This verifies experimentally that proposed con-
dynamics. On the other hand faster closed-loop troller is very robust to high variations in the model
bandwidths are not possible due to the limitations parameters.
introduced by the unaccounted nonlinear terms. It is interesting to note that the sliding mode controller
does not perform well when subjected to constant ref-
The sliding mode control topology presented in Sec- erence inputs, even when the plate dynamics were
tion 5 does not take into consideration the plate dy- not being considered in the simulation environment.
namics of the ball and plate system. Hence a PID con- In this case the sliding mode response of the system
trol loop was added between the outer sliding mode was never able to reach the speed and range that was
controller and the inner torque controller to control achieved with the linear state-space regulator. This is
the plate dynamics. Recall that the high control ac- due to the equivalent control action which is working
tivity requested by the sliding controller is very diffi- against the switching function during the initial phase
cult to achieve with any mechanical servo mechanism. when the system’s trajectory is reaching the sliding
The best performance that was achieved by the PID surface. This scenario is made worse by the imperfect
controller was insufficient to keep up with the discon- switching introduced by the slow plate dynamics and
tinuous switching control action that was being up- the large β values due to the motors’ dead-zones. The
dated every 0.033s. This would result in an imperfect latter effects were reduced by switching the signum
and delayed sliding control action which would re- function with a saturation function, at the expense of
sult in a degradation of the system’s output response reducing the controller’s robustness.
and an increase in the chattering problem. The ef-
fects introduced by the plate dynamics are not shown
in (Liu and Liang, 2010) and (Liu et al., 2009) since 7 CONCLUSION
both papers assumed an ideal servo response in their
simulations. Despite these limitations, when apply- In this paper a mechatronic design of the ball and
ing the switching control action shown in (9), we still plate system was presented. Two different control
managed to obtain a very accurate tracking response. schemes were presented and their respective perfor-
The sliding mode control parameters β and λ were mance, was experimentally validated on a physical
testbed that was designed and constructed for the Liu, D., Tian, Y., and Duan, H. (2009). Ball and plate con-
purpose of this research. Linear state-feedback trol system based on sliding mode control with uncer-
controller was discussed in detail. This was fol- tain items observe compensation. In Intelligent Com-
puting and Intelligent Systems, 2009. ICIS 2009. IEEE
lowed by an analysis of the results obtained by the
International Conference on, volume 2, pages 216–
sliding mode controller. When compared to the lin- 221. IEEE.
ear tracker results, the sliding controller managed to Liu, H. and Liang, Y. (2010). Trajectory tracking sliding
obtain a more precise response at much higher speeds. mode control of ball and plate system. In Informatics
in Control, Automation and Robotics (CAR), 2010 2nd
The imperfect switching, introduced by the servo- International Asia Conference on, volume 3, pages
loop which could not handle the high control activ- 142–145. IEEE.
ity requested by the sliding mode controller, was one Moarref, M., Saadat, M., and Vossoughi, G. (2008). Mecha-
of the main factors which limited the performance of tronic design and position control of a novel ball
this robust control strategy. Future research should fo- and plate system. In Control and Automation, 2008
16th Mediterranean Conference on, pages 1071–
cus on designing a switching function that takes into 1076. IEEE.
consideration all the states of the system. Hence ef- Slotine, J.-J. E. and Li (1991). Applied nonlinear control,
fectively designing a multidimensional sliding mode volume 199. Prentice hall New Jersey.
controller that would consider both the ball and plate Wang, H., Tian, Y., Sui, Z., Zhang, X., and Ding, C. (2007).
dynamics. Tracking control of ball and plate system with a dou-
ble feedback loop structure. In Mechatronics and
Automation, 2007. ICMA 2007. International Confer-
ence on, pages 1114–1119. IEEE.
ACKNOWLEDGEMENTS Wang, Y., Li, X., Li, Y., and Zhao, B. (2012). Identifi-
cation of ball and plate system using multiple neural
This research was partially funded by the Strate- network models. In System Science and Engineer-
gic Educational Pathways Scholarship (Malt). This ing (ICSSE), 2012 International Conference on, pages
Scholarship is part-financed by the European Union 229–233. IEEE.
- European Social Fund (ESF) under Opera- Yuan and De-hu (2009). Pneumatic servo ball and plate sys-
tional Programme II - Cohesion Policy 2007- tem based on touch screen and oscillating cylinder. In
2013,“Empowering People for More Jobs and a Better Intelligent Systems and Applications, 2009. ISA 2009.
International Workshop on, pages 1–4. IEEE.
Quality of Life”.
Yuan, D. and Zhang, Z. (2010). Modelling and con-
trol scheme of the ball–plate trajectory-tracking pneu-
matic system with a touch screen and a rotary cylinder.
REFERENCES IET Control Theory & Applications, 4(4):573–589.
Awtar, S., Bernard, C., Boklund, N., Master, A., Ueda, D.,
and Craig, K. (2002). Mechatronic design of a ball-
on-plate balancing system. Mechatronics, 12(2):217–
228.
Ho, M.-T., Rizal, Y., and Chu, L.-M. (2013). Visual ser-
voing tracking control of a ball and plate system: De-
sign, implementation and experimental validation. In-
ternational Journal of Advanced Robotic Systems, 10.
Hongrui, W., Yantao, T., Siyan, F., and Zhen, S. (2008).
Nonlinear control for output regulation of ball and
plate system. In Control Conference, 2008. CCC
2008. 27th Chinese, pages 382–387. IEEE.
Jadlovska, A., Jajcisi, S., and Lonscak, R. (2009). Mod-
elling and pid control design of nonlinear educational
model ball and plate. In Proceedings of the 17th
International Conference on Process Control 2009,
pages 475–483. Slovak University of Technology in
Bratislava.
Ker, C. C., Lin, C. E., and Wang, R. T. (2007). Tracking
and balance control of ball and plate system. Journal
of the Chinese Institute of Engineers, 30(3):459–470.
Khalil, H. K. (2002). Nonlinear systems, volume 3. Prentice
Hall Upper Saddle River.