Automatic Control of Ball and Beam System Using Particle Swarm Optimization
Automatic Control of Ball and Beam System Using Particle Swarm Optimization
Abstract— Over the last few decades, many evolutionary flocks. It was in 1995, that particle swarm optimization was
algorithms have emerged. One such algorithm is Particle Swarm first presented as a tool for optimization of functions by
Optimization which emulates social and cognitive behavior of Kennedy and Eberhart [7].
bird-flocks. In this paper, particle swarm optimization algorithm
is presented as a robust and highly useful optimization technique The algorithm works on the scenario of birds randomly
to tune the gains of the PID controllers in the two feedback loops searching for food. It begins with a swarm of birds/particles
of the classic Ball and Beam Control System. As the name being initialized at random positions in the problem-space.
implies, Ball and Beam control system tends to balance a ball on Typically, the numbers of birds in the swarm (n) is kept in the
a particular position on the beam as defined by the user. Various range 20-40. During the journey, each bird keeps track of its
trials of the algorithm with varying parameters is implemented coordinates in the problem space. A record is also kept of the
on the control system and the fitness of the response of the system least distance (fitness value) from the food achieved by each
to a unit step input is used as a criterion for judging the most individual bird so far, called pbest (personal best). The
optimal solution. A slight variation in the fitness value function is minimum value of pbest in the swarm is called gbest (global
also introduced, rather than using conventional performance best), that is, the minimum distance achieved by any of the
integrals as a criterion. Furthermore, the results from PSO birds in the swarm so far.
tuning are quantitatively compared to ITAE equations method of
PID tuning and Fuzzy-logic controller to reach a conclusion on On each iteration, the velocity of each bird is updated and
the most efficient controlling technique. added to the current coordinates of the respective birds.
Keywords- Particle Swarm optimization; Ball and Beam system;
fitness function; ITAE equations; Fuzzy-logic controller positionnew [ ] = positionold [ ] + velocitynew [ ] (1)
0.7
Gtotal(s) = Gm(s) ×Gbb(s) = s3(0.02398s + 1.713) (5)
– 530 –
Authorized licensed use limited to: Pontificia Universidad Javeriana. Downloaded on November 08,2024 at 00:02:08 UTC from IEEE Xplore. Restrictions apply.
CINTI 2011 • 12th IEEE International Symposium on Computational Intelligence and Informatics • 21–22 November, 2011 • Budapest, Hungary
if
Table I show the upper and lower limits set for the 6 PID (current_iterations<max_iterations)
controller gains. The birds/particles are initialized at random
positions within these limits and are not allowed to trespass NO
during the algorithm.
Stop loop
TABLE I. THE BOUNDS IMPOSED ON PID PARAMETERS
Where a1, a2, a3, a4 are weighing factors and MP, tr, ts and ess
are peak-overshoot, rise-time, settling-time, and steady-state
error respectively. We have set a1=a2=a3=a4=1.
– 531 –
Authorized licensed use limited to: Pontificia Universidad Javeriana. Downloaded on November 08,2024 at 00:02:08 UTC from IEEE Xplore. Restrictions apply.
M. A. Rana et al. • Automatic Control of Ball and Beam System Using Particle Swarm Optimization
TABLE II. PID GAINS OBTAINED FOR THE 5 BEST PSO TRIALS
– 532 –
Authorized licensed use limited to: Pontificia Universidad Javeriana. Downloaded on November 08,2024 at 00:02:08 UTC from IEEE Xplore. Restrictions apply.
CINTI 2011 • 12th IEEE International Symposium on Computational Intelligence and Informatics • 21–22 November, 2011 • Budapest, Hungary
The main advantage for using the ITAE equation method better option for tuning PID than the conventional ITAE
over other conventional tools is that there is no requirement method of tuning.
for any graph or chart like the root locus and the bode plot.
These equations can easily be used for the gains calculation of V. CONCLUSION
up to 6th order characteristics equation. After calculating the In this paper, Particle swarm optimization algorithm is
gains from the ITAE equations we usually require a little bit successfully presented as a useful tool for optimizing the step-
tuning of the gains. response of a ball on beam control system. An analytical
approach has been used to choose the best trial among the
The ITAE performance integral is defined as:
various trials of the algorithm on the system model. Finally, the
step-response is compared with a step-response optimized
T
through ITAE equations and Fuzzy-logic Controller. The
t|e(t)| dt
ITAE = (8) Particle Swarm Optimizer out-classes the other two techniques.
0 This is mainly because this algorithm efficiently searches the
entire 6-dimensional problem space for the optimum solution.
The procedure for calculating the PID gains using the Unlike conventional methods, it provides a general and easy-
ITAE equations is as follows. These steps are carried out for to-use method for tuning any control problem, without the need
first for inner-loop and then the outer-loop: of complex analysis of the system.
Step-1: We multiply the general form of the PID controllers
with the open loop transfer function.
Step-2: The characteristics equation is compared with the
standard ITAE equations. The value of damping ratio (ζ) is
constant that is 0.6.
Using standard equations of ITAE, the PID controllers
designed for the inner and outer loop respectively can be
written as [14], [4]:
Inner loop PD controller: KP = 11; KD = 2
Outer loop PID controller: KP = 6; KI = 0.2; KD = 5
– 533 –
Authorized licensed use limited to: Pontificia Universidad Javeriana. Downloaded on November 08,2024 at 00:02:08 UTC from IEEE Xplore. Restrictions apply.
M. A. Rana et al. • Automatic Control of Ball and Beam System Using Particle Swarm Optimization
[6] Zang H., Zhang S. and Hapeshi K., “A review of nature-inspired International Conference on Natural Computation, 24-27Aug. 2007,
algorithms”, Journal of Bionic Engineering, September 2010, vol. 7, vol. 3, pp. 823-826.
Supplement 1, pp. S232-S237. [14] Amjad M. et al, “A simplified intelligent controller for ball and beam
[7] Kennedy J. and Eberhart R., “Particle Swarm Optimization”, IEEE system”, 2nd International Conference on Education Technology and
International Conference on Neural Networks, Perth – Australia, 1995, Computer, 22-24 June 2010, vol.3, pp.V3-494-V3-498.
pp. 1942-1948. [15] Cockburn J. C. and Savakis A., “DC Motor Transfer Function”,
[8] Shi, Y. and Eberhart R., “A modified particle swarm optimizer”, http://www.ce.rit.edu/~cockburn/courses/ce553_su02/labs/lab3_r1.pdf
Evolutionary Computation Proceedings, IEEE World Congress on [16] Rosales E. A., “A Ball-on-Beam Project Kit”, Department of
Computational Intelligence, Anchorage– USA, 4-9 May 1998, pp.69-73. Mechanical Engineering, Massachusetts Institute of Technology, June
[9] Clerc M. and Kennedy J., “The particle swarm - explosion, stability, and 2004
convergence in a multidimensional complex space”, IEEE Transactions [17] Hirsch R., “Mechatronic Instructional Systems Ball on Beam System”,
on Evolutionary Computation, Feb 2002, vol.6, no.1, pp. 58-73. Shandor Motion Systems, 1999.
[10] Kennedy J. and Eberhart R., “A discrete binary version of the particle http://www.ro.feri.uni-mb.si/predmeti/skup_sem/projekt1/shandor.pdf.
swarm algorithm”, Systems, Man, and Cybernetics, IEEE International [18] Wellstead P., “Ball and Beam I: Basics”,
Conference on Computational Cybernetics and Simulation, 12-15 Oct http://www.controlsystemsprinciples.co.uk/whitepaperslball-and-beam.
1997, vol. 5, pp. 4104-4108.
[19] Lee C. C., “Fuzzy logic in control systems: fuzzy logic controller -Part I
[11] Kennedy J., “Bare bones particle swarms”, Proceedings of the 2003 and II", IEEE Transactions on System, Man and Cybernetics, Mar-Apr
IEEE Swarm Intelligence Symposium, 24-26 April 2003, pp. 80- 87. 1990,vol. 20, no. 2, pp. 404-435.
[12] Mendes R., Kennedy J. and Neves J., "The fully informed particle [20] Amjad M. et al, "Fuzzy Logic Control of Ball and Beam",2nd
swarm: simpler, maybe better", IEEE Transactions on Evolutionary International conference on Electronic Computer Technology (ICECT
Computation, June 2004, vol.8, no. 3, pp. 204- 210. 2010), Kuala Lumpur, Malaysia, 22-24 June 2010, vol. 2, pp. V3-489 -
[13] Chuan L. and Quanyuan F., “The Standard Particle Swarm Optimization V3-493.
Algorithm Convergence Analysis and Parameter Selection”, Third
– 534 –
Authorized licensed use limited to: Pontificia Universidad Javeriana. Downloaded on November 08,2024 at 00:02:08 UTC from IEEE Xplore. Restrictions apply.