You are on page 1of 6

2019 IEEE 4th Colombian Conference on Automatic Control (CCAC)

October 15-18, 2019. Diez Hotel, Medellin, Colombia.

Classic Continuous-Time Control Methods Applied


to the Ball and Beam System
Diana Carolina Diaz, Jeison Estiven Garcia, and Diana Marcela Ovalle
Facultad de Ingenierı́a
Universidad Distrital “Francisco José de Caldas”
Bogotá D.C., Colombita
{dicdiazc, jegarciat}@correo.udistrital.edu.co, dmovallem@udistrital.edu.co

Abstract—This document presents the implementation, PID controller is the one in [4], where the authors design the
modeling, identification and control in continuous-time of a controller using the Coefficient Diagram Method (CDM), and
ball and beam system. The prototype is different from the compare it with a controller developed following the Ziegler-
commercial ones in the sense that the coupling with the motor
is in the center of the beam, rather than in one of its ends. The Nichols tuning method, to show, in simulation, that under
model proposed is completely linear and from it a continuous- typical performance index and time response characteristics
time tracking with feedback state, as well as loops with PD and the CDM design performs better. Also, in the field of linear
PID controllers were designed. Practical and simulated data are control, we found an application in [5] with the design of a
presented, showing ball position control. Some comments about Linear Quadratic Regulator (LQR), together with an extended
the controllers implementation are presented. Finally, some
conclusions are drawn. state observer, which estimates the nonlinearities of the system
as an additional state, allowing to neglect them from the model
Keywords— ball and Beam, Analog control, PID, PD, Low- to design the LQR; results are validated through simulation.
cost, Tracking control with state-feedback Considering non-linear control, the simpler approaches are
related to mix PID controllers with fuzzy techniques, as in
I. I NTRODUCTION [6], where the authors compare the fuzzy PID performance
The ball and beam system has been used extensively in with a PID resulting of using the auto-tuned function of
the study of linear and non-linear control. Given its inherent Simulink; the study was performed in the ball and beam
instability and the possibility to model the physical effects system model GBB2004 produced by Googol Technology.
tacking place on ti as non-linear, it has caught the attention of Also, from the fuzzy control branch, we found the work in [7],
academics in the last decades. One of the very first works with where a Takagi-Sugeno fuzzy model is used together with an
this system is the one presented in the CDC1989, which then adaptive dynamic control surface (DCS), results are compared
evolved to a more complete work in [1], where the authors with classical DCS approaches through both, simulation and
perform a nonlinear control of the system via Approximate experimental setups, concluding that the adaptive DCS has
input-output linearization, and they show the ball and beam better performance.
tracking control from this linearization is more effective than Some other more complex non-linear control approaches for
the one from the standard Jacobian linearization, according the ball and beam system are related to optimal control, model
to the simulation results presented. From there, hundreds of predictive control (MPC), robust control, slide mode control,
works have been developed, using linear or nonlinear control; and so on. Regarding to MPC, in [8] the authors design and
through simulation, or implementation; using it as a very implement an MPC for the Quanser ball and beam system,
versatile system to prove the validity of different control comparing theoretical with experimental results. In [9], the
theories. In the following, we will discuss some of the works authors design a robust control via a discontinuous sliding
carried out during the last years, but the reader could find more mode control approach, the validation of the controller pro-
information in the references inside those works. posed is carried out through simulations of system behavior.
Between the works that consider linear controllers, we found In [10], the authors consider the possibility of disruptions in
[2], where the authors design and implement a PD controller the feedback, achieving a sort of switching control to keep the
for the system, using two loops, one for the motor and another states of the ball and beam system stable, they validate their
one for ball position and studying the stabilizing properties approach with the Quanser ball and beam system. In the same
of the controller. In [3], a very classical approach for a PID line, authors of [11] design an optimal bang-bang control to
control is shown, the use of the Ziegler-Nichols second tuning overcome disruptions in the feedback control.
method to tune the PID, some simulation and implementation In this work we start showing a low-cost implementation
results are included in the work. Another work that involves a of the system, that differs from the commercial ones (by
Quanser or Googol Technology) in the fact that the motor
axe is directly coupled to the center of the beam. Then, we
go throw a linear modelling process of the system, in order to

978-1-5386-6962-4/19/$31.00 ©2019 IEEE


get a state-space model of the system. After that, we show
an approach to identify the unknown terms of the model,
which cannot be measured or calculated directly. Then, we
design a tracking feedback control system for ball position,
as well as a two loops with PD-PID controllers in order to
control the beam angle and the ball position, respectively. After
that, we show details for the analogical implementation of
the controllers and compare the simulation with the practical
results of implementing the controller in our prototype. Finally,
we draw some conclusions of the work.
II. S YSTEM P ROTOTYPE
Fig. 2. Implementation result of the physical structure
As it is well known, a ball and beam system consists of a
beam, in this case moved by a DC reducer motor, over which
a ball rolls. The objective of the control is to feed the motor
with the adequate amount of voltage to make the ball position
to be at the desired position.
In order to implement the system, we use a 3D model of
the physical structure (Fig. 1), which then was the model for
cutted and assembled in MDF wood (Fig. 2). The beam is 40
cm long, with ultrasonic position sensors in both ends, and
the ball is simply a ping pong. The position of the ball over
the beam was set as 0cm in the point were the motor and the Fig. 3. Power circuit for the DC motor.
beam were mechanically coupled, to the right there is set a
positive displacement up to 20 cm, as well as to the left, but
as a negative displacement. The DC reducer motor has 12V after colliding with an object, the duration of this process will
of nominal input, and the reducer box has a relation of 51:45. be stored and processed to obtain the relative position of the
In order to sense the beam angle, we use a potentiometer, object, through of a micro-controller.
which rotating knob is coupled mechanically to the motor axe. The output of the digital-analog converter supplied by this
The voltage from the potentiometer is conditioned to have a microcontroller is bounded between (0−5)V , so it is necessary
resolution of 0.5 V/degree, to have 0V at 0 degrees, and to to condition the signal to represent the desired range of motion,
have positive values counter-clock wise. getting 50V /m (or 0.5V /cm).

C. Angle sensor
The angle sensor is a linear potentiometer of 20 kΩ, which
variation is proportional to the angle of rotation of the motor,
this action is due to the fact that the axes are connected by the
mechanism shown in Figure 4. The sensor is polarized with
Vcc = 12V , and the proportional voltage to the beam angle
can be written as

Vs (θ) = (12V · Rs (θ))/(20 kΩ). (1)


Fig. 1. 3D Model of the physical structure. where, Rs (θ) is the resistance of the potentiometer between
the middle terminal and the grounded terminal, depending on
A. Power system for the DC reducer motor the angle of the bar.
The power system used for the control signal to be able to
move the motor is the one depicted in Fig. 3. As it is shown,
it is a power follower with a pair of BJT complementary
transistors.
B. Ball Position Measurement Fig. 4. Pulley array to coupling the potentiometer and the motor shaft.
As we mentioned above, to measure the distance between
the ball and the sensor located at one end of the beam, It is necessary to condition the sensor output, with the
were used ultrasound sensors HC-SR04. When enabled, its purpose of emulating the measured magnitude V (θ) = k θ,
operation emits a burst of 8 high frequency pulses that return obtaining the linear approximation.
D. Angular and linear velocities Due to the geometry of the moving body, the effect of the
Since we have adequate measurements for the beam angle frictional force is negligible. Since we would like to have a
and the ball position, in order to avoid the implementation of a linear model of the system, and therefore the sub-system, we
state observer, we decide to implement differentiators in order will consider only small values of θ. That is |θ| < 0.1745 rad
to obtain the derivatives of the angular and linear positions. As and, therefore, [sin(θ) ≈ θ]. The last allows us to write the
expected, that results in very noisy signals, which was solved final equation for the ball moving on the inclined plane as
with low-pass second order active filters. δ2 x
−mB g θ = mB (6)
δt2
E. Implementation costs
The system, as described above with the specific compo-
nents detailed, has an overall cost of about $15. Table I shows
the costs of the different system components.

TABLE I
C OST OF THE IMPLEMENTED SYSTEM

Element Value (USD$)


Ultrasonic sensors 2.0
Lineal potentiometer 0.7
MDF 2.0
Laser cut 2.2 Fig. 5. Free body diagram of an object on an inclined plane.
Reducer motor 5.8
Miscellaneous 2.3 The second sub-system considered is the one with the
TOTAL 15.0 angular motion of the beam. The torques acting on the beam
are depicted in Figure 6. There, we can see the applied torque
from the DC motor (τA ), an opposite torque generated by the
III. M ATHEMATICAL M ODEL ball moving over the beam (τB ), another opposite torque due
to the friction between the beam and the motor (τbeta ), and an
In order to develop a linear mathematical model of the ball elasticity torque (τk ), that also opposes to the beam motion.
and beam system, we are going to analyze two sub-systems. Then, applying Newton’s second law to the beam, we have
The first sub-system is related with the translational motion of
a body (ball) on an inclined plane. For that, we will consider δ2 θ
τA − τβ − τk − τB = Jv ,
the free-body diagram presented in Fig 5. There are two forces δt2
acting over the ball: a force that produce the ball motion, where Jv is the beam moment of inertia; for the case of the
equivalent to the perpendicular component of its weight (FA ), beam can be calculated as
and a friction force, that opposes the displacement of the ball mV L2
(Fβ ). Therefore, applying the second Newton’s law on the ball, Jv = (7)
12
we have Where (mv ) is the beam mass [kg], and (L) is the beam
δ2 x
FA − Fβ = mB 2 . (2) length [m]. Given that the motor dynamics is faster than the
δt dynamics for both, the beam angle and the ball position, we
The perpendicular component of the ball weight can be writen have approximate the applied torque to be proportional to the
as (3). Which is considered with a negative sign, since the FA voltage of the DC motor, Vin . That is, τA = k Vin . The torque
will be applied in the opposite direction to the movement of generated by the ball moving over the beam is proportional to
the ball. the ball weight and its position over the beam, that is
FA = −mB g sin(θ) (3)
τB = mB g cos(θ) x ≈ mB g x.
Where, mB corresponds to the ball mass [kg], g is the The linear friction torque can be written as
acceleration of gravity [m/s], and θ is the angle of inclination
δθ
of the beam [rad]. The friction force, considered to be linear τ β = βv ,
can be written as (4). δt
where βV is the friction coefficient between the motor shaft
δx and the beam, in [kg m2 /s]. The elasticity torque can be written
Fβ = β (4)
δt as
Where x is the ball displacement over the beam [m], and β τk = kv θ,
corresponds to the friction constant [kg/s]. From (3) and (4), with kv the bending coefficient of the beam [kg m2 /s2 ]. Then,
(2) can be described as the angular motion equation for the beam can be rewritten as
δx δ2 x δθ δ2 θ
−mB g sin(θ) − β = mB 2 . (5) k Vin − βv − kv θ − mB g x = Jv 2 . (8)
δt δt δt δt
From (12), and given the block diagram in Fig. 7, we can find
that
K Kv βv
= 148.6, = 0, = 7.265.
Jv Jv Jv

TABLE II
PARAMETERS OF THE BALL AND B EAM S YSTEM .

Symbol Value Symbol Value


mB 2.7 × 10−3 Kg Lv 50 × 10−2 m
mv 35 × 10−3 Kg Jv 7.29 × 10−4 kg m2
Fig. 6. Diagram of torques applied to the beam.
Rθ (s) + 90 Θ(s)
Gθ (s)
π
The model of the system consists in (6) and (8), where the −

system input is Vin and the system output is x.


Fig. 7. Block diagram for the beam angle behavior in closed loop.
A. State space representation
Let us select the state-variables as follows: x1 = x, 1.6
x2 = dx/dt = x˙1 , x3 = θ and x4 = dθ/dt = x˙3 . That is Output
1.4
x = [x1 , x2 , x3 , x4 ]T . In the same sense, the control variable Input
Aproximation
1.2
u = Vin and the output variable y = θ. Given the previous
1
definitions and, using them, together with (6) and (8), we

Amplitude
0.8
can write the state-space representation for the ball and beam
0.6
system
0.4

0 1 0 0 0
   
0.2

 0 0 −g 0  0 0
ẋ =  0 0 0 1  x +  0  u,
   
-0.2
 m g (9) 0 0.2 0.4 0.6 0.8 1 1.2
B kv βv  k Time (seconds)
− 0 − −
 Jv  Jv  Jv Jv Fig. 8. Closed loop step response for the beam angle.
y = 1 0 0 0 x+ 0 u
IV. S YSTEM PARAMETERS I DENTIFICATION V. C ONTROLLERS D ESIGN
In Table II, the known system parameters are listed. How- The control objective is for the ball position to be able to
ever, there are parameters that cannot be directly measured or track a desired set point, with zero position error, a setting
calculated. Notice that for (6), the parameters are know. But, time around 4 sec, and small overshoot, if possible. In order
for (8) there are some parameters that need to be identified in to do that, we decide to design two type of controllers, first
some way. Here, we decide to take the ball off the system, to a state-feedback control with tracking (to ensure the position
eliminate the last term of the right in (8). That is error to be zero), and a two loops PD-PID for the ball position
and beam angle, respectively. In the following, we will give
δθ δ2 θ some details about the design processes.
k Vin − βv − kv θ = Jv 2 . (10)
δt δt
Now, applying Laplace transform to obtain the transfer func- A. Tracking control with state-feedback
tion of Θ(s) = L{θ(t)} respect to Vin (s) = L{Vin (t)}, we
have
k
Θ(s) Jv
Gθ (s) = = . (11)
Vin (s) β v kv
s2 + s+
Jv Jv
What we are interested in doing is to prove a closed loop for Fig. 9. General scheme for a state-space tracking controller, adapted from
[12] (Chapter 12).
(11) in order to approach the unknown terms, which are the
same that in (9). That is, we analyze the step response of the
The control loop to design and implement is the one shown
system in Fig. 7. A transfer function that reflects the output
in Figure 9. For this system, we have to consider an additional
behavior of the system can be written as
state, due to the addition of the integrator,
148.6
Gcl (s) = . (12) ξ˙ = r − C x,
s2 + 7.265 s + 148.6
the control action is given by is, the transfer function of the PID controller for the beam
angle, can be written as
u = −K x + Ki ξ.
(s + 10.1872)2
We can write an extended state equation of the system, for a Cθ (s) = 0.1208 .
s
new state vector x̄ = [xT ξ]T , of the form
  2) PD control of ball position: As it is seen in Fig. 10, the
0 ball position control acts on the bean angular position loop in
x̄˙ = Ā x̄ + B̄ u + r, (13)
1 series with the transfer function of X(s) respect to Θ(s), that
from (6) can be written as
with    
A 0 B X(s) g
Ā = , B̄ = . (14) Gx (s) = = − 2. (17)
−C 0 0 Θ(s) s
Given that we define the desired response of the system, the In the same way we did the PID design, we proceed for the
dominant poles are going to be located at PD design for external loop. We define the closed loop step
response of the ball position to have a very small overshoot,
s1,2 = −1.3 ± 0.591i. (15)
1%, and a settling time of 3.4 sec. The transfer function of the
Since we have to set the location of five closed loop poles, PD controller for the external loop, to control the ball position,
the remaining poles are located in such a way that they do not can be written as
affect the behavior of the dominant poles. That is Cx (s) = 0.2263 (s + 1.16).
s3 = −6.5, s4 = −6.6, s5 = −6.7. VI. S IMULATION AND I MPLEMENTATION R ESULTS
In order to find the feedback control gains K and the integral A. Tracking control with state-feedback
gain ki , knowing the desired location of the system closed The implementation of the controller was done with dif-
loop poles, we follow the classic method presented in [13] ferent operational amplifiers configurations: a subtractor, an
(Chapter 11), for the extended system. Then, integrator with gain 1, and an adder-subtractor with the state-
    variables and the integral action as inputs and with K̄ gains.
K̄ = K −Ki = −25.5 −13.9 37.7 3.7 12.2 . All those circuits where designed to implement the adequate
(16) control action for the ball and beam system, obtaining simula-
B. PID and PD controllers tion and implementation results as the ones shown in Fig. 11.
It is worth to notice that the final design was validated, after
In order to control the ball position over the beam using
verifying in the implementation that the control action does
PID controllers, after seen that many of related works usually
not saturate, in order to guaranty the behavior of the closed
work with servo motors, we decide to first control the beam
loop system. Also, the practical results shown in Fig. 11, as
angular position and, from that proceed to control the position
the ones shown after, where normalized in order to ease the
ball, as it is shown in the block diagram in Fig. 10. After some
comparison with the unit step response simulation.
trials, we end up using a PID for the beam angular position
and a PD for the ball position on the beam.

R(s) + + Θ(s) X(s)


Cx(s) Cθ (s) Gθ (s) Gx(s)
− −

90
π

50

Fig. 10. Diagram of the control system

1) PID control for angle position: For the beam angle


position control we use the transfer function from Vin (s) to
Θ(s), neglecting the effect of the ball over the beam, as we did
in (11). In order to design the controller, we need to establish
the desired behavior of the system, to apply some specific Fig. 11. Step response of the tracking feedback controller.
design method. In this case, we select for the closed loop step
response of the beam angle an overshoot of 20% and a settling
time of 575 ms. Then, we follow the standard procedure for B. PD and PID controllers
designing controllers using the root locus method, like the The implementation of this controller was a bit simpler than
one in [14] (Chapter). Here, we decided for the PID to have the previous one, since it needs less circuits. Again, we use a
repeated zeros in s = −10.1872, with a gain of 0.1208. That subtractor, and a filter to implement the particular controller,
as the ones proposed in [12] (Table 5-1). In here, the designs it is necessary to change the motor for one with higher torque.
were also validated in the implementation to verify the control The last given that in some experiments the motor torque was
action does not saturate. not sufficient to execute the desired control action, since the
First, we have to check that the loop for the beam angle opposing torque generated by the ball position on the beam
allows the motor to behave as a servo system. Fig. 12 shows was comparable to disturb the tendency of the response of the
the simulation and practical results for the loop. We can see system.
that the simulation and the implementation are a bit similar, On the other hand, the system parameter identification
even though the peak time is a little bit shifted to the right, process carried out in this work was very basic and it neglected
and the response oscillations take a little bit longer to banish. some obvious strong effects on the system, like the effect
of the ball position on the beam control. In addition, since
Angle PID Control the control action lies in a continuous range of voltages, the
1.6 identification around a particular equilibrium point shows to be
simulation
1.4 practical insufficient. Therefore, we are planning to use pseudo-random
1.2
signals together with least square methods, having into account
1
the ball position effect, in order to obtain a better model of
Amplitude

the system.
0.8

0.6 R EFERENCES
0.4 [1] J. Hauser, S. Sastry, and P. Kokotovic, “Nonlinear control via approx-
imate input-output linearization: the ball and beam example,” IEEE
0.2
Transactions on Automatic Control, vol. 37, no. 3, pp. 392–398, March
0 1992.
0 0.2 0.4 0.6 0.8 1 1.2 1.4
Time (seconds) [2] W. Yu and F. Ortiz, “Stability analysis of pd regulation for ball and
beam system,” in Proceedings of 2005 IEEE Conference on Control
Fig. 12. Simulation and practical results for the PID controller for angle Applications, 2005. CCA 2005., Aug 2005, pp. 517–522.
control. [3] W. Chen, X. Sui, and Y. Xing, “Modeling and modulation of nonlinear
ball-beam system controller based on matlab,” in 2012 9th International
Once, we guaranty the beam angle, we have to check if the Conference on Fuzzy Systems and Knowledge Discovery, May 2012, pp.
2388–2391.
ball position is controlled with the PD. The simulation and [4] B. Meenakshipriya and K. Kalpana, “Modelling and Control of Ball
practical results for the ball position loop are shown in Fig. and Beam System using Coefficient Diagram Method (CDM) based
VI-B. These results are practically the same, it is remarkable PID controller,” IFAC Proceedings Volumes, vol. 47, no. 1, pp. 620 –
626, 2014, 3rd International Conference on Advances in Control and
how alike they are, of course some noise is present and, also, Optimization of Dynamical Systems (2014).
some mistakes in the ball position measurements at some [5] M. K. Choudhary and G. N. Kumar, “ESO Based LQR Controller
time instants. for Ball and Beam System,” IFAC-PapersOnLine, vol. 49, no. 1, pp.
607 – 610, 2016, 4th IFAC Conference on Advances in Control and
Optimization of Dynamical Systems ACODS 2016.
But this result is very satisfactory, and verifies the presence [6] N. S. A. Aziz, R. Adnan, and M. Tajjudin, “Design and evaluation of
of at least one integrator in the direct way, that guaranties fuzzy PID controller for ball and beam system,” in 2017 IEEE 8th
Control and System Graduate Research Colloquium (ICSGRC), Aug
zero position error, as it is stated in (17). 2017, pp. 28–32.
[7] Y. Chang, W. Chan, and C. Chang, “T-S Fuzzy Model-Based Adaptive
Dynamic Surface Control for Ball and Beam System,” IEEE Transac-
1.2 tions on Industrial Electronics, vol. 60, no. 6, pp. 2251–2263, June 2013.
[8] D. Martı́nez and F. Ruiz, “Nonlinear model predictive control for a ball
1 beam,” in 2012 IEEE 4th Colombian Workshop on Circuits and Systems
(CWCAS), Nov 2012, pp. 1–5.
Amplitude

0.8 [9] R. Soni and S. Sathans, “Robust control of a ball and beam system
through sliding mode controller,” in 2018 International Conference on
0.6
Emerging Trends and Innovations In Engineering And Technological
Research (ICETIETR), July 2018, pp. 1–5.
[10] S. Oh, K. Lee, and H. Choi, “Control of a ball and beam system
0.4
under intermittent feedback,” in 2018 18th International Conference on
Control, Automation and Systems (ICCAS), Oct 2018, pp. 56–61.
0.2 simulation [11] K. Lee, S. Oh, and H. Choi, “Bounded control of a ball and beam system
practical
in the absence of feedback,” in 2017 17th International Conference on
0 Control, Automation and Systems (ICCAS), Oct 2017, pp. 1167–1169.
0 1 2 3 4 5 6
Time (seconds) [12] K. Ogata, Modern Control Engineering (3rd Ed.). Upper Saddle River,
NJ, USA: Prentice-Hall, Inc., 1997.
Fig. 13. Simulation and practical results for the PD controller for ball position [13] C.-T. Chen, Analog and Digital Control System Design: Transfer-
control. function, State-space, and Algebraic Methods. New York, NY, USA:
Oxford University Press, Inc., 1995.
[14] N. S. Nise, Control Systems Engineering, 3rd ed. New York, NY, USA:
John Wiley & Sons, Inc., 2000.
VII. C ONCLUSIONS
Even though the obtained results are satisfactory, there is a
system characteristic that needs to be improved. Particularly,

You might also like