PID, Fuzzy and LQR Controllers For Magnetic Levitation System
PID, Fuzzy and LQR Controllers For Magnetic Levitation System
Abstract—Magnetic suspension systems are highly non- The ball position in the mechanical system can be controlled
linear and unstable. Magnetic levitation system is modelled by the current through the electromagnet where the current
here and PID, FUZZY and LQR are designed to control through the electromagnet in the electrical system can be
the system. All the controllers are designed in matlab and controlled by applying controlled voltage across the
checked in real time. Rise time,peak overshoot and settling electromagnet terminals.
time are compared with each controller and result is noted
and compared.
I. INTRODUCTION
A Maglev is a system that uses magnetic field to levitate an
object in a particular position. If an object is placed very far
from the magnetic source, the magnetic field is too weak to
support the weight of the object. If placed too close, the
magnetic field becomes too strong and causes the object to
move towards the source until it makes physical contact with
the magnet. Maglev device is an example of an inherently
unstable system. Magnetic levitation system can be
categorized based on whether the force of attraction or
repulsion is used for the levitation of the ball. Here the force of
attraction of the electromagnet in the maglev is used to balance
against the gravity. The main components of the magnetic
levitation ball system are shown in Fig. 1.
The working of magnetic levitation system is as follows.
When voltage is applied to the electromagnet, the resulting
current magnetizes the coil and exerts a magnetic force on the
steel ball to attract it towards the magnet. This force when
becomes equal to the force of gravity, the ball is successfully
suspended in the required position. Theoretically, it seems very
easy because it is just a problem of finding out how much is the
gravitational force on the ball at a particular point. But without Fig. 1. Magnetic levitation system
the help of an appropriate controller, it cannot be done. Before
designing the controller, modeling of the system is done in the The magnitude of force f(x,i) exerted across an air graph by an
next Section. electromagnet through which a current i flows can be
described as
II. MODELING ݅ 2 ݀)݄(ܮ
݂(݄, ݅) = െ (1)
K. Ishaque and P. Suster [1,2] proposes that the magnetic 2 ݄݀
levitation system can be categorized into The total inductance L is a function of the distance and given
1) Electrical system by
2) Mechanical system ܮ0 ܪ0 (2)
ܮ = )݄(ܮ1 +
݄
2016 International Conference on Cogeneration, Small Power Plants and District Energy (ICUE 2016)
BITEC, Bang-Na, Thailand, 14-16 September 2016
݀݅
ܸ = ܴ݅ + )݄(ܮ (10)
݀ݐ
Also, assuming L1 is very large compared to L0, equation Fig. 2. Response of the linear Maglev model when 0 control voltage
(10) can be simplified as is applied.
A. PID Controller Error in position and change of error in position are the two
The schematic diagram of PID controller is given in Fig. 3. inputs taken as the input to the controller, whereas voltage is
taken to be the output of the controller. The membership
The transfer function of PID can be written as functions of the input and output are taken as triangular type
݅ܭ whose range can be decided by observing the response of the
ܭ = )ݏ(ܭ+ + ݏ ݀ܭ system on varying the range of each membership function.
ݏ
Fig. 7 gives the membership plot of the input variable‘ error’ ,
Step response of the system in simulation with PID controller fig 8 gives the membership plot of input variable ‘ change of
is given in Fig. 4.
error’ and fig 9 gives the membership plot of output variable
‘output’.
TABLE 1- RULE BASE To design a State Variable Feed Back(SVFB) that is optimal,
performance index(PI)is defined as
e
NB NS Z PS PB
de/dt 1 λ ܶ
න ( ݔܳ ݔ+ ݐ݀) ݑܴ ܶݑ
=ܬ (21)
NB PB PB PB PS Z 2 0
NS PB PB PS Z NS Substituting the feedback control into this yields
Z PB PS Z NS NB
1 λ ܶ
PS PS Z NS NB NB =ܬ න ܳ( ݔ+ ݐ݀ ݔ) ܭܴ ܶ ܭ (22)
2 0
PB Z NS NB NB NB
)ݐ(ݒis assumed to be zero since only internal stability
The rule base is shown in Table 1. properties of the closed loop system is considered.
The objective of optimal design is to select the feedback
gain K that minimizes the performance index J. Depending on
the design parameters of the two matrices Q (n × n matrix) and
R (m × m matrix), the closed-loop system will exhibit a
different response.Q should be always positive semi-definite
and R should be positive definite. Since the plant is assumed to
be linear and the performance index PI is quadratic, the
problem of determining the feedback gain K to minimize J is
called the Linear Quadratic Regulator (LQR).
To find the optimal feedback K, a constant matrix P is selected
Fig .10. Position of the ball of maglev using FuzzyLogic Controller
such that,
Fig. 11. gives the real time step response of maglev using ݀ ܶ
( = )ݔܲ ݔെ ܳ( ܶ ݔ+ ݔ) ܭܴ ܶ ܭ (23)
Fuzzy Logic Controller. ݀ݐ
1 λ ݀ ܶ 1
=ܬ න (( ܶ ݔ = ݐ݀)ݔܲ ݔ0) ܲ(ݔ0) (24)
2 0 ݀ݐ 2
J is made independent of K. It is a constant that depends only
on the auxiliary matrix P and the initial conditions. Solving all
the equations (20), (22) and (24), following equation can be
obtained
ܲ ܶܣ+ ܲ ܣ+ ܳ + ܭܴ ܶ ܭെ ܲ ܶܤ ܶ ܭെ ܲ = ܭܤ0 (25)
Equation (9) is known as the algebraic Riccati Comparing the real bed results of all the three controllers,
equation(ARE). from Tables 2 and 3, it is seen that, for both simulation and
The simulation result of the step response of maglev with real time results, rise time is less for PID controller,
LQR is given in Fig. 12. Percentage peak overshoot is less in fuzzy logic controller and
settling time is less in LQR control. FLC is having an extra
advantage that the exact model of the system is not required
whereas LQR requires a thorough understanding of
themathematical model it is very easy to tune FLC since it
deals with linguistic variables.
TABLE 3
Peak
Controller Rise overshoot Settling
time(s) %Mp time(s)
PID .042 34% 5.2
Fig. 13. The real time step response of maglev using LQR
LQR .166 3.1% .166
Fuzzy Logic .166 .005% 1.16
IV. CONCLUSION
1) LQR and Fuzzy logic controller are applied REFERENCES
successfully to control the ball position in the magnetic [1] K. Ishaque, Y. Saleem, S. S. Abdullah, M. Amjad, M. Rashid, S. Kazi,
levitation system in real time. “Modeling and control of magnetic levitation system via fuzzy logic
controller”, IEEE 4th International Conference on in Modeling,
2) Three different parameters of PID controller, Fuzzy Simulation and Applied Optimization, 2011, pp.1–6.
logic controller and LQR are compared. The parameters [2] P. Suster , A. Jadlovska, “Modeling and control design of magnetic
compared are rise time, percentage peak overshoot and settling levitation system”, 2012 IEEE 10th International Symposium on
time. Comparison of the simulation of the test bed model is Applied Machine Intelligence and Informatics, 2012, pp. 295–299.
given in table 2 and comparison of the real time response is [3] A. Ahmad, Z. Saad, M. Osman, I. Isa, S. Sadimin, S. Abdullah,
given as shown in Table 3 “Control of magnetic levitation system using fuzzy logic control”,
IEEE Second International Conference on Computational Intelligence,
TABLE 2 Modeling and Simulation, 2010, pp. 51–56.
[4] D. L. Trumper, S. M Olson, P. K Subrahmanyan, “Linearizing control
Peak of magnetic suspension systems”, IEEE Transactions on Control
Controller Rise overshoot Settling Systems Technology, vol. 5, no. 4, pp. 427–438, 1997.
time(s) %Mp time(s) [5] C.-F. Juang, J.-Y. Lin, C.-T. Lin,” Genetic reinforcement learning
4 through symbiotic evolution for fuzzy controller design”, IEEE
PID .068 25% Transactions on Systems, Man, and Cybernetics, vol. 30, no. 2, pp.
LQR .09 .4% .5 290–302, 2000.
Fuzzy Logic .52 .1% 1.7 [6] K.Ogata, Y.Yang, “Modern control engineering”.
[7] F. Lewis, “Linear quadratic regulator (LQR) state feedback design”,
1998.