0% found this document useful (0 votes)
40 views5 pages

PID, Fuzzy and LQR Controllers For Magnetic Levitation System

The document summarizes a conference paper on controlling a magnetic levitation system using PID, fuzzy, and LQR controllers. The paper models the magnetic levitation system with electrical and mechanical components. It designs PID, fuzzy, and LQR controllers in MATLAB to control the position of a levitated ball by controlling the current through an electromagnet. The rise time, overshoot, and settling time of the closed-loop system are compared for each controller.

Uploaded by

Hoàng Giang
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views5 pages

PID, Fuzzy and LQR Controllers For Magnetic Levitation System

The document summarizes a conference paper on controlling a magnetic levitation system using PID, fuzzy, and LQR controllers. The paper models the magnetic levitation system with electrical and mechanical components. It designs PID, fuzzy, and LQR controllers in MATLAB to control the position of a levitated ball by controlling the current through an electromagnet. The rise time, overshoot, and settling time of the closed-loop system are compared for each controller.

Uploaded by

Hoàng Giang
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

2016 International Conference on Cogeneration, Small Power Plants and District Energy (ICUE 2016)

BITEC, Bang-Na, Thailand, 14-16 September 2016

PID, Fuzzy and LQR Controllers for Magnetic


Levitation System
1,*
Arjun C. Unni, 2A.S. Junghare, 3Vivek Mohan, 4Weerakorn Ongsakul
1,4
Energy FoS, SERD, Asian Institute of Technology, Pathumthani, Thailand – 12120.
2
Department of Electrical & Electronics Engineering, Visvesvaraya National Institute of Technology,
Nagpur, Maharashtra, India - 440010
3
Department of Electrical and Electronics Engineering, Amrita School of Engineering, Coimbatore,
Amrita Vishwa Vidyapeetham, Amrita University, India – 641112

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.

Keywords—Magnetic levitation system; PID; Fuzzy;


LQR

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

Where,L1 is the inductance of the electromagnet coil in the ‫)ݏ(ܫ‬ 1


absence of levitated object, L0 is the additional inductance = (13)
ܸ(‫ܮ )ݏ‬1 ‫ ݏ‬+ ܴ
contributed by its presence,and X0 is the equilibrium Now, the main equation of the suspended object comes by
position.The parameters are determined by the geometry and applying Newton’s second law of motion. For this single
construction of electromagnetand can be determined degree of freedom system, a force balance taken at the centre
experimentally. of gravity of the object yields
Substituting equation (2) in (1) yields ݀2 ݄
= െ݂1
‫ܯ‬ (14)
‫ܮ‬0 ܺ0 ݅ 2 ݅ 2 (3) ݀‫ ݐ‬2
݂= ൤ ൨ = ߚ൤ ൨ Applying Laplace transform, we get
2 ݄ ݄
‫ܮ‬0 ‫ܪ‬0 (4) ‫)ݏ(ܪ‬ െ‫ܭ‬1 ‫)ݏ(ܫ‬ (15)
ߚ= =
2 ‫ ݏܯ )ݏ(ܫ‬2 െ ‫ܭ‬2
By using Taylors theorem,the equation of the force is Where
linearized.
2ߚ‫ܫ‬0
߲݂ ߲݂ ߲݂ ‫ܭ‬1 =
݂ = ݂0 + ൬ ൰ ᇞ ‫ܮ‬0 + ൬ ൰ ᇞ ‫ܪ‬0 + ൬ ൰ ᇞ ݅ ‫ܪ‬0 2
߲‫ܮ‬0 ߲‫ܪ‬0 ߲݅ (5)
߲݂ and
+൬ ൰ᇞ݄
߲݄ 2ߚ‫ܫ‬0 2
Eliminating the higher order terms give ‫ܭ‬2 =
߲݂ ߲݂ ‫ܪ‬0 3
݂ = ݂0 + ൬ ൰ ᇞ ݅ + ൬ ൰ ᇞ ݄ (6)
߲݅ ߲݄ There is a sensor in the model of the system.It can be
Evaluating equation (6) using (4) and (5) yields modeled as

‫ܫ‬0 2ߚ‫ܫ‬0 2ߚ݅0 2 ܸ‫݄ ݏܭ = ݏ‬ (16)


݂ = ߚ൬ ൰+ ᇞ ݅ െ ቆ ቇ ߂݄ (7) The overall transfer function of the plant is
‫ܪ‬0 ‫ܪ‬0 2 ‫ܪ‬0 3
Where I0 is the equilibrium value. At equilibrium, the െ‫ܭ ݏܭ‬1
weight of the object is suspended by the electromagnet force ܸ‫)ݏ( ݏ‬ ‫ܮܯ‬1
‫= )ݏ(ܩ‬ = (17)
f0.The force required to maintain equilibrium f1 is ܸ(‫ )ݏ‬ቀ‫ ݏ‬+ ቁ ቀ‫ ݏ‬2 െ ‫ܭ‬2 ቁ
ܴ
‫ܮ‬1 ‫ܯ‬
݂1 = ݂ െ ݂0 (8) Real time system is designed in such a way that, the current
produced in the electrical system is proportional to the voltage
Combining equations (7) and (8) gives given.It is experimentally verified that the proportionality
constant is 1. Also, sensor gain is not there since voltage to
2ߚ‫ܫ‬0 2ߚ‫ܫ‬0 2 position and vice-versa is done in input and output sides.
݂1 = ቆ ቇᇞ݅െቆ ቇᇞ݄ (9)
‫ܪ‬0 2 ‫ܪ‬0 3

Now we are considering the electrical system. The voltage


equation of the electromagnetic coil is

݀݅
ܸ = ܴ݅ + ‫)݄(ܮ‬ (10)
݀‫ݐ‬

Assuming that the suspended object remains close to its


equilibrium position

‫ܮ = )݄(ܮ‬1 + ‫ܮ‬0 (11)

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.

݀݅ III. CONTROLLER DESIGN


ܸ = ܴ݅ + ‫ܮ‬1 (12)
݀‫ݐ‬ Without a controller, when we give voltage to the
electromagnet, the steel ball will either fall down or go and
By taking Laplace transform we get stick to the electromagnet. So, we use a PID, fuzzy logic and
LQR controllers which successfully control the voltage given
to the electromagnet and thereby controlling the ball in steady
state after the transient time.
2016 International Conference on Cogeneration, Small Power Plants and District Energy (ICUE 2016)
BITEC, Bang-Na, Thailand, 14-16 September 2016

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’.

Fig. 6. Structure of a fuzzy logic system

Fig. 3. Schematic diagram of PID controller

Fig.7. Membership plot of input variable ‘error’

Fig. 4. Position of the ball using a PID controller

Fig.8. Membership plot of input variable ‘change of ‘error’

Fig. 5. The real time response of maglev with PID controller


Fig. 9. Membership plot of output variable ‘output’
B. Fuzzy logic controller
AnFuzzy logic System (FLS) is a rule-based system that
implements a nonlinear mapping between inputs and outputs.
2016 International Conference on Cogeneration, Small Power Plants and District Energy (ICUE 2016)
BITEC, Bang-Na, Thailand, 14-16 September 2016

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. ݀‫ݐ‬

Substituting (23) into (22) yields,

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)

Where, ‫ ܴ = ܭ‬െ1 ‫ܲ ܶܤ‬


Fig. 11. The real time step response of maglev with fuzzy logic
controller ‫ ܲ ܶܣ‬+ ܲ‫ ܣ‬+ ܳ െ ܲ‫ ܴܤ‬െ1 ‫ = ܲ ܶܤ‬0 (26)
C. Linear Quadratic Regulator(LQR)
A system can be expressed in state variable form as,
‫ݔ‬ሶ = ‫ ݔܣ‬+ ‫ݑܤ‬ (18)
with x(t)ѮRn, u(t)ѮRm.
Assuming here that all the states are measurable and seek to
find a state-variable feedback (SVFB) control,
‫ = ݑ‬െ‫ ݔܭ‬+ ‫ݒ‬ (19)

gives desirable closed-loop properties. The closed-loop system


using this control becomes
Fig .12. Simulation result of error in position ofthe ball for a
‫ݔ‬ሶ = (‫ ܣ‬െ ‫ ݔ)ܭܤ‬+ ‫ ݔ ܿܣ = ݒܤ‬+ ‫ݒܤ‬ (20)
step input using LQR
With ‫ ܿܣ‬the closed-loop plant matrix and ‫ )ݐ(ݒ‬the new
command input.
2016 International Conference on Cogeneration, Small Power Plants and District Energy (ICUE 2016)
BITEC, Bang-Na, Thailand, 14-16 September 2016

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.

You might also like