Professional Documents
Culture Documents
Abstract. This paper concerns design and implementation of PID and Fractional
Order PID (FOPID) controllers to control position of an electromagnetically suspended ferromagnetic ball in a Magnetic Levitation (Maglev) system in real time.
The Maglev system, manufactured by Feedback Instruments (Model No 33-210)
is used as a platform to test the performance of proposed controllers. Parameters
of PID and FOPID controllers are tuned by Firefly Algorithm (FA). FA is a
metaheuristic algorithm based on movement of fireflies towards more attractive
and brighter ones. PID and FOPID controllers are implemented in MATLAB and
Simulink environment inside PC. The PC is connected to the Maglev system
through Advantech card. Effectiveness of proposed controllers is tested by
checking the ability of the suspended ball to track a reference signal. Step change,
sine wave, and square wave are used as reference signals. Real time results have
revealed satisfactory transient and steady state responses over the contemporary
existing controllers. FOPID controller showed better results compared to PID.
Keywords: Magnetic levitation; PID; FOPID; Firefly Algorithm;
Introduction
1.1
In a Maglev system a ferromagnetic object is levitated against gravity and its position
is controlled using electromagnetic force of attraction [1]. Due to absence of mechanical contact frictional forces get eliminated. Hence, system efficiency get enhanced.
Magnetic levitation technology is used in various engineering applications like highspeed trains, levitation of wind turbine, personal rapid transit etc. Actual position of the
levitated object is measured by a sensor. Based on the difference between desired and
actual position of the suspended object a controller can inject suitable current to electromagnetic coil which generates required force on the ferromagnetic object to control
its position and make it able to track a reference signal [1]. Without the presence of a
controller Maglev system is inherently unstable. The relation between force, current,
and position is nonlinear.
1.2
What is Firefly Algorithm (FA) and why to tune PID and FOPID by FA?
Firefly Algorithm was based on social behavior of fireflies flying in the tropical summer sky. They communicate with each other, search for mates and prey using bioluminescence with varied flashing patterns. Mimicking the characteristics of their movement, an optimization algorithm was designed by Yang in 2010 [3]. Brightness of flashing of fireflies was taken proportional to the objective function. Details of the algorithm
will be discussed later in this paper. In [5], Firefly algorithm has been successfully used
to tune the PID parameters for a set of test plants.
Fractional order controller dynamics is governed by fractional order differential equation. Fractional order differential equation is very complex to analyze mathematically.
Hence, finding out FOPID parameters by classical mathematics is a challenging task.
Intelligent algorithm like FA, does not require to analyze or solve the internal dynamics
of the controller. Rather, it does a methodical search to find suitable values of PID
parameters
( K P , K I and K D ) and
FOPID parameters
( K P , K I , K D , and )
for
which a performance index (PI) is minimized. The PI is a measure of controller performance. It is generally a function of error signal.
As discussed in 1.1, Maglev system is an open loop unstable system. So, open loop
identification is not possible. However it can be identified by close loop identification.
Identification is carried out following the steps given in [6] and [7].
In [6] and [7] a PD controller is used to make the system stable as shown in Fig. 2.
Excitation signal r t was chosen to be a random binary sequence. Using offline real
time data in MATLAB CONTSID Toolbox, a transfer function is obtained between
r t and y t .From the block diagram of Fig. 2 eqn. (1) can be written as below.
Y (s)
G(s)
R
(
s
)
1
C
( s )G ( s )
yd 0
T (s)
(1)
C (s) (4 0.2s)
(2)
G(s) has been calculated using eqn. 1 and eqn.2 and given in eqn. 3.
G( s)
(3)
Controller Design
4.1
The transfer function of PID and FOPID controllers are given in eqn. 4 and eqn. 5
respectively with usual notations. The parameter and stands for the order of integration and derivative respectively.
K
E (s)
U (s)
K
E (s)
U (s)
4.2
KI
I K D s
s
K
KD s
(4)
(5)
J ISE
e t dt ;
2
(6)
4.3
Firefly Algorithm is a nature inspired algorithm based on the movement and flashing
characteristics of fireflies. It consists of three particular idealized rules which are based
in major flashing characteristics of fireflies [3, 4]. These are as follows:
All fireflies are unisex, so that one firefly will be attracted to all other fireflies regardless of their sex [3, 4].
Attractiveness is proportional to their brightness. Thus between any two firefly the
less brighter one will move towards more brighter one. The degree of attractiveness
is proportional to the brightness which decreases as their distance increases. If there
is no brighter one than a particular firefly, then it will move randomly [3, 4].
The brightness of the firefly is determined by the landscape of the objective function
or performance index [3, 4].
For an optimization problem, the brightness is associated with the fitness function in
order to obtain efficient optimal solutions. In this algorithm, when searching for solutions two main procedures are followed: i) attractiveness and ii) movement, which are
defined as follows:
Attractiveness.
The form of attractiveness function of a firefly is the following monotonically decreasing function [3, 4].
r
r 0e ; m 1
m
(7)
r 0 , and is the absorption parameter which controls the decrease of light intensity.
The distance rij between ith and jth fireflies, at position
governed by eqn. 8 [3, 4].
rij X i X j
Xi
and X j respectively, is
xik x jk
k 1
Where xik is the kth component of the spatial is coordinate of the ith firefly
and d is the dimension number.
(8)
( Xi )
Movement.
Movement of ith firefly which is attracted by a brighter jth firefly is governed by eqn. 9
[3, 4].
X in 1 X in 0 e
r X n X n rand () 1
j i
ij
(9)
X in and X in1 are the present and future position of a firefly respectively. The second term in eqn. 9 is used for considering a fireflys attractiveness to light intensity
seen by adjacent fireflies. The third term in eqn. 9 is used for the random movement of
a firefly in case there are not any brighter ones. The coefficient is a randomization
parameter determined by the problem of interest, while rand () generates is a vector of
Absorption coefficient ( ) 1
Initial attractiveness, (0 ) 0.2
Index of r (m) 2
The optimization process is continued until there is no significant changes in the value
of PI is found for 100 consecutive iterations or when all the generations are completed.
Optimized controller parameters are shown in Table. 3.
Table 3. Optimized controller parameters found by FA
Controller
PID
FOPID
KP
3.6947
4.06893
KI
1.7276
1.8281
KD
0.45143
0.12244
----0.4356
----0.1707
The simulated step responses of the system using PID and FOPID tuned by FA is shown
in Fig. 4.
Fig. 4. Simulated step responses using PID and FOPID controllers tuned by Firefly algorithm
4.4
Designed PID and FOPID controllers in sec 4.3 are implemented in real time using
MATLAB and Simulink environment through digital computer which is connected to
the Maglev mechanical unit through Advantech Card. An additional MATLAB
toolbox, Fractional Order Modelling and Control (FOMCON) is installed inside Simulink environment to generate fractional order transfer function of FOPID controller
[8]. Due to large initial error integral action at initial stage may increase the control
signal to a very high value. It can cause a high overshoot and can also make the system
unstable. Even it can push the ball beyond the sensor operating region. Hence, in the
first 15 sec only PD controller is used to stabilize the ball. After 15 sec integral action
is turned on to reduce steady state error.
In the simulated step responses in Fig. 4 FOPID controller tuned by FA shows the
better result (overshoot 0.528% and settling time 0.327 sec) than that of PID (overshoot
0% and settling time 0.783 sec). Although in terms of overshoot PID is better but 0.582
% overshoot is negligible in case of FOPID. Moreover due to very short settling time,
tracking of a reference signal will be better in case of FOPID. Real time results in Fig
5 to Fig. 10 clearly indicate that FOPID controller tuned by FA is working much better
than PID controller in terms of tracking of a reference signal.
Fig. 5. Real time response using PID controller tuned by FA with step change as reference input.
(Only PD controller is applied for 1st 15 sec)
Fig. 6. Real time response using PID controller tuned by FA with square wave signal as reference
input. (Only PD controller is applied for 1st 15 sec)
Proposed controllers in this paper work better than the system inbuilt PID controller
[6] designed by the manufacturer, in terms of tracking a reference signal. In [9] FOPID
controller is designed for a magnetic levitation system by minimizing various performance indices like ISE, ITSE, IAE, ITAE using classical optimization technique. But
real time results in [9] contains much higher overshoot (10% to 15 %) and settling time
(8 to 10 sec.) than this paper.
Fig. 7. Real time response of the system using PID controller tuned by FA with sine wave signal
as reference input. (Only PD is applied for 1st 15 sec).
Fig. 8. Real time response of the system using FOPID controller tuned by FA with step change
signal as reference input. (Only FOPD is applied for 1st 15 sec)
Fig. 9. Real time response using FOPID controller tuned by FA with square wave signal as reference input. (Only FOPD is applied for 1st 15 sec).
Fig. 10. Real time response using FOPID controller tuned by FA with sine wave signal as reference input. (Only FOPD applied for 1st 15 sec)
Results justify that Firefly Algorithm is a suitable and reasonably simple tool to tune
PID and FOPID controllers parameters. Although several tuning procedures are available for PID controller but most of them are applicable for linear system only. However,
number of techniques to find FOPID controller parameter is very limited till date, due
to its fractional order dynamics. FOPID works better than PID due to its extra two degrees of freedom in terms of non-integer order of derivative and integration. Comparisons with literatures also justify that FOPID controllers tuned by Firefly Algorithm
works better than several existing controllers. Step change, square wave and sine wave
are used as reference signals in this paper. A more complex reference signal like random signal will be used in future. The robustness of the controller due to variation of
system parameters and external disturbances is not tested which may be taken into account in future.
References
1. I. Ahmad, and M. A. Javaid, Nonlinear model & controller design for Magnetic levitation
system, 9th WSEAS international conference on Signal processing, robotics and automation, 2010, Cambridge, UK.
2. I. Podlubny, L. Dorcak, and I. Kostial,On fractional derivatives, fractional-order dynamic
systems and PID controllers, 36th IEEE Conference on Decision and Control, 1997, San
Diego, US.
3. X. S. Yang, Firefly Algorithm in Nature Inspired Metaheuristic Algorithm, 2nd ed., UK
Luniver Press, 2010, ch 10 pp.81-89
4. A. H Gandomi, Xin-She Yang, and A.H. Alavi, Mixed Variable Structural Optimization
using Firefly Algorithm, Computers and Structures, ELSEVIER, vol. 89, pp 2325-2336,
2011.
5. O. Bendjeghaba, S. I. Boushaki and N. Zemmour, Firefly algorithm for optimal tuning of
PID controller parameters, Fourth International Conference on Power Engineering, Energy
and Electrical Drives, 2013, Istanbul, Turkey.
6. http://www.feedback-instruments.com/products/education/control_instrumentation/magnetic_levitation_system (Manual of Maglev system Model No 33-210)
7. L. Majhi, M. Borah and P. Roy, Fractional Order System Identification of Maglev Model
from Real-Time Data, IEEE International Conference on Advanced Communication Control and Computing Technologies, 2014, Ramanathapuram, India.
8. A. Tepljakov, E. Petlenkov, and J. Belikov, A Flexible MATLAB Tool for Optimal Fractional-order PID Controller Design Subject to Specifications, in Proceedings of the 31st
Chinese Control Conference, Hefei, Anhui, China, 2012, pp. 46984703.
9. H. Gole, Harshit, P. Barve, A. A. Kesarkar, and N. Selvaganesan, Investigation of fractional
control performance for magnetic levitation experimental set-up, International Conference
on Emerging Trends in Science, Engineering and Technology (INCOSET), 2012, Tiruchirappalli, India.