Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/272171376

Hardware in Loop, real time implementation of Fractional Order PID


controller on Magnetic Levitation System

Conference Paper · December 2014


DOI: 10.13140/2.1.3151.9521

CITATION READS

1 537

4 authors, including:

Amit Chopade M.V. Aware


Visvesvaraya National Institute of Technology Visvesvaraya National Institute of Technology
6 PUBLICATIONS   104 CITATIONS    114 PUBLICATIONS   955 CITATIONS   

SEE PROFILE SEE PROFILE

Some of the authors of this publication are also working on these related projects:

Direct torque control of five-phase induction motor View project

Analysis and Implementation of Fractional order PID Controller for Linear and Non-linear Systems View project

All content following this page was uploaded by Amit Chopade on 13 February 2015.

The user has requested enhancement of the downloaded file.


Hardware in Loop, real time implementation of Fractional
Order PID controller on Magnetic Levitation System

Amit S. Chopade1, Jonathan Laldingliana2, A. S. Junghare3, and M. V. Aware4


1 Department of Electrical Engineering, VNIT Nagpur, amit.chopade4@gmail.com
2 Department of Electrical Engineering, VNIT Nagpur, jona_xz0@yahoo.com
3 Department of Electrical Engineering, VNIT Nagpur, asjunghare@eee.vnit.ac.in
4 Department of Electrical Engineering, VNIT Nagpur, mvaware@eee.vnit.ac.in

ABSTRACT

Magnetic Levitation System (MLS) a multi-variable, non-linear and unstable system, is


basically an electromagnetic system which levitates ferromagnetic objects in space. This paper
presents an application of Fractional Order PID (FOPID) controller to control the position of levitated
object in MLS 33-210 (MagLev). Fractional order PID (FOPID) controller has five control variables to
control the complicated process by using smaller control effort compared to conventional PID
controllers. For implementation of FOPID controller, the fractional order differentiator and integrator
have been realized via integer order approximation. The performance analysis of the realized FOPID is
compared with integer order PD, PID controllers and results are presented. It is observed that FOPID
controller is able to efficiently control the MLS rather than conventional controllers.

Keywords: Magnetic Levitation System (MLS), MagLev, Fractional Order PID (FOPID),
Proportional Integral Derivative (PID).

1. INTRODUCTION

The magnetic levitation is a phenomenon based on principle of electromagnetism, to levitate a


ferromagnetic object by the magnetic force induced due to the electric current flowing through the
coils around a solenoid [1]. The system is naturally non-linear, unstable and is under the influence of
electromagnetic fluctuations. The electromagnetic force is nonlinear giving rise to difficulties to get
closed-loop stability. The constant current in the electromagnet makes it difficult to maintain any kind
of control over the position of the object.
Since it eliminates energy loss due to friction, MLS technology has been receiving much attention
now a days. Applications of magnetic levitation system are increasingly getting into diverse areas
including: frictionless bearings for inertial instruments, vibration isolation table, centrifuges, turbines
and high speed maglev trains mentioned in the literature[2],[3].The MLS is a dynamic system and its
synergetic system integrates sensors, drivers and controls making it a challenging control problem.
The MLS is both inherently nonlinear and open-loop unstable, this has led to the use of feedback
control to stabilize the system.
The control of magnetic levitation has evolved over the years from the linear control to nonlinear
controls. For the control of maglev system, traditional controllers such as PI, PID, fuzzy controller and
other controllers have been widely used in literature. Here, MLS is controlled by non-conventional
control technique known as a fractional-order PID control. This idea of fractional calculus application
to control theory is described in literature [4] and its advantages are proved as well.
In this paper, the control algorithm is implemented in simulation and in real time platform using
Advantech PCI 1711 card and 33-301 analogue control interface on the MLS 33-210 (Feedback
Instruments), to realize hardware in loop control system.The controllers are designed on MATLAB
software using SIMULINK modeling tool and the performance of the realized FOPID has been
compared with the integer order PID controllers.
Symposium on Advances in Control & Instrumentation (SACI-2014) 24-26 November 2014, Mumbai
2. MAGNETIC LEVITATION SYSTEM MODEL

The MagLev system is the steel body levitation by means of the electromagnetic field counteracting
the force of gravity. The applied control is voltage, which is converted into the current via a driver
embedded within the unit. The current passes through an electromagnetic coil, and creates the
corresponding magnetic field in its vicinity. The mechanical-electrical model of a MagLev is presented
in figure (1). The MagLev setup consists of a connection interface panel with a mechanical unit on
which coil is mounted. An infra-red sensor is attached to the mechanical unit and steel sphere is
levitated in space [3]. Usually, MagLev models are nonlinear, that means at least one of the states (i –
current, x– ball position) is an argument of a nonlinear function. The nonlinear model equations are
derived, referring to the figure (1). Figure (2) shows the control system of the MagLev. The transfer
function of the MagLev system is to be converted to linear form, for the design of controller.

Figure 1: Maglev Model Figure 2: Maglev Control System

The nonlinear model of the MLS relating to the ball position ‘x’ and the coil current ‘i’ is given in
equation (1).
𝑖2
𝑚𝑥 = 𝑚𝑔 − 𝑘 𝑥 2 (1)
𝑖 = 𝑘1 𝑢 (2)

Where, k is a constant depending on the coil (electromagnet) parameters (8.24×10-5kg), m is the


mass of the sphere (20×10-3kg), g is the gravitational force (9.8 m/s2), 𝑘1 is the input
conductance(0.3971/Ω). A relation between the control voltage ‘u’ (0,5V) and the coil current ‘i’ (0,3A)
is given in equation(2). MagLev is equipped with an inner control loop providing a current
proportional to the control voltage that is generated for the control purpose. The single line diagram
of the close loop control system is shown in figure (3).

Figure 3: Single line diagram of closed loop system

Equations (1) and (2) constitute a nonlinear model, which is simulated in SIMULINK. The bound for
control signal of the system is set to [-5V ... +5V].
2.1 Linearization of Maglev Model:

The non-linear form of the maglev model is to be linearize for the proper analysis of the
system. The linear form of the model is obtained from the equation (1) as follows:

𝑥 = 𝑔 − 𝑓 𝑥, 𝑖 ,
𝑖2
𝑓 𝑥, 𝑖 = 𝑘 𝑚 .𝑥 2 (3)

The equilibrium point is calculated by assuming 𝑥 = 0,

𝑔 = 𝑓(𝑥, 𝑖) ⇒ 𝑖0 𝑥0 (4)

Linearization is carried out around the equilibrium point of 𝑥0 = −1.5𝑉 (the position is expressed
in volts), 𝑖0 = 0.8𝐴. Using series expansion method, the equation (5) is obtained.
𝜕𝑓 (𝑖,𝑥) 𝜕𝑓 (𝑖,𝑥)
𝑥=− ∆𝑖 + ∆𝑥 (5)
𝜕𝑖 𝑖0 ,𝑥 0 𝜕𝑥 𝑖0 ,𝑥 0

By the application of Laplace transform over the equation (5), the equation (6) is so obtained.

𝑠 2 ∆𝑥 = −(𝐾𝑖 ∆𝑖 + 𝐾𝑥 ∆𝑥) (6)

Equation (6) is further simplified as mentioned.


∆𝑥 −𝐾
∆𝑖
= 𝑠 2 +𝐾𝑖 (7)
𝑥

2𝑚𝑔 2𝑚𝑔
Where, 𝐾𝑖 = 𝑖0
and 𝐾𝑥 = − 𝑥0

3. FRACTIONAL ORDER PID CONTROLLER

The idea of FOPID controller comes from the application of fractional calculus. The fractional
order PID controller generalizes the integer order PID controller and expands it from point to plane.
This concept of expansion adds more flexibility to controller design and we can control our real world
processes more accurately with smaller control effort. The FOPID controller has five control
parameters which adds more flexibility and robustness to the system and are less sensitive to the
parameter variations of a controlled plant. Fractional order controller being infinite order, needs to be
approximated to finite dimensional system. Oustaloup's approximation method has been used for the
realization of fractional order controller. The control parameters of FOPID controller has been tuned
by the genetic algorithm optimization technique and is implemented for the FOPID controller using
FOMCON toolbox in SIMULINK (MATLAB)[12].

3.1 Fractional Calculus:

Fractional calculus is a generalization of integration and differentiation to non-integer


𝑞
(fractional) order fundamental operator 𝑎𝐷𝑡 (q ϵ R). Basic definitions of fractional calculus and
approximation of integrator and differentiator is described in literature [5], [6] , [7]. The differential
𝑞
operator, denoted by 𝑎𝐷𝑡 , is a combined differentiation-integration operator commonly used in
fractional calculus. This operator is a notation for taking both the fractional derivative and the
fractional integral in a single expression as shown in equation (8).

𝑑𝑞
𝑑𝑡 𝑞 𝑞>0
𝑞
𝑎𝐷𝑡 = 1 𝑞=0 (8)
𝑡
𝑎
(𝑑𝜏)−𝑞 𝑞<0
Where, q is a fractional number, a and t are the limits of the operation.
Grunwald–Letnikov (GL) definition:
𝑞 𝑑𝑞 𝑡−𝑎 −𝑞 𝑁−1 𝑗 𝑞 𝑡−𝑎
𝑎𝐷𝑡 𝑓 𝑡 = 𝑑 𝑡−𝑎 𝑞
= lim𝑁→∞ 𝑁 𝑗 =0 −1 𝑗
𝑓(𝑡 − 𝑗 𝑁
) (9)
Riemann–Liouville (RL) definition:

𝑞 𝑑𝑞 1 𝑑𝑛 𝑡 𝑛−𝑞−1
𝑎𝐷𝑡 𝑓 𝑡 = 𝑑 𝑡−𝑎 𝑞
= 𝛤(𝑛−𝑞) 𝑑𝑡 𝑛 0
𝑡−𝜏 𝑓(𝜏)𝑑𝜏 (10)

∞ 𝑧−1 −𝑡
𝛤 𝑧 = 0
𝑡 𝑒 𝑑𝑡 (11)
Where, n is the first integer which is not less than q i.e. 𝑛 − 1 ≤ 𝑞 < 𝑛 and Γ is the Gamma function.
The GL and the RL [8] definitions are equivalent for functions f (t) having continuous derivatives
for 𝑡 ≥ 0,where 𝑛 − 1 ≤ 𝑞 < 𝑛.
The Laplace transforms of the GL and RL fractional derivative/integral, of signal f(t) at t=0 for order r
is given in equation (12).

𝐿[𝑎Drt f t ] = s r L f t = 𝑠 𝑟 F(s) (12)

Laplace transformed equation obtained is (13).



s −λ F s = I ⍺ f t , λ = ⍺ and s δ F s = dt δ f(t) (13)

The transfer function of fractional PID controller is given by the following irrational function as in
equation (14).

C(s) = Kp + Ki sλ + Kd sµ , (λ, µ > 0) (14)

Where, Kp is the proportional constant, Ki is the integral constant, Kd is the derivative constant and λ, µ
are positive real numbers. Particular selection of λ and µ provides the classical controllers viz. PD
controller (λ =0), PI controller (µ =0) and PID controller (λ, µ=1).

3.2 Fractional-Order Approximation Method:

The fractional-order differential equations do not have exact analytic solutions, so various
approximation and numerical methods have been proposed to solve the fractional-order differential
equations. The method considered here is based on the approximation of the fractional-order system
behavior in the frequency domain. Oustaloup’s approximation method is used here, which is one of
the best known approximation method [9], [10] for the realization of fractional order integrator and
differentiator. This method is based on the approximation of a function as given in equation (15 and
16).

H s = sq , 𝑞 ∈ R ; q= [-1, 1] (15)
z
N s+ω k
H s =K k=−N s+ω p (16)
k

The approximation is valid in the frequency range (𝜔𝐿 , 𝜔𝐻 ), where 𝜔𝐿 𝑎𝑛𝑑 𝜔𝐻 the low and high
translational frequencies. Using the following set of synthesis formulae, the approximation for poles
and zeroes are obtained as follows in equation (17, 18 and 19).

ωzk = ωL ωL ωH k+N+0.5+0.5q 2N+1


(17)

p k+N+0.5−0.5q 2N+1
ωk = ωL ωL ωH (18)
−⍺
ωL 2 N ωzk
K= ωH k=−N p (19)
ωk
3.3 Genetic Algorithm Optimization:

Genetic algorithm (GA) is an optimization technique based on natural selection and evolution
process[11]. It initiates without knowledge of the correct solution and depends entirely on responses
from its environment and evolution operators to arrive at the best solution by starting at several
independent points. The search is carried out in number of parallel ways, the algorithm avoids local
minima and converges to sub optimal solutions. Hence, GA is capable of locating high performance
areas in complex domains without experiencing the difficulties associated with high dimensionality.
This algorithm consists of three fundamental operations: reproduction, crossover and mutation. These
operators work with a number of artificial creatures called a generation. GA preserves better
individual and yields higher fitness function evolution, by exchanging information from each
individual in a population. It performs the basic task of copying stings, exchanging portions of string
and changing some bits of string. Figure 4 presents the flow chart of the genetic algorithm.

Generate initial population

Evaluate fitness function

Selection of individual solution

Mating(reproduction)

Mutation

New population generated and fitness evaluated

Sufficient solution quality or No


maximum search terms reached
Yes

End

Figure 4: Flow Chart of the Genetic Algorithm

In this work, GA tool (MATLAB) is used to tune the gains and the order of the fractional operator.
The population size is taken as 100, maximum number of iterations is set as 50 and the objective
function to be minimized is the integral absolute error (IAE) corresponding to actual and desired ball
position in MagLev. The low and high translation frequencies taken for Fractional Order PID controller
are 𝜔𝐿 = 0.01𝑟𝑎𝑑/ sec 𝑎𝑛𝑑 𝜔𝐻 = 1000𝑟𝑎𝑑/𝑠𝑒𝑐 respectively, where the approximation order is 7.
The parameters obtained from the algorithm for PD controller Kp=8, Kd=0.1, for PID controller Kp=8,
Ki=1, Kd=0.1 and for FOPID controller Kp=21, Ki=12, Kd=1, λ(order of fractional order integrator)=0.5,
µ (order of fractional order differentiator)=0.9 are used to control the MLS 33-210 in offline
simulation and real time mode.

4. SIMULATION AND REAL-TIME MODEL

4.1 Simulation model:


Simulation is carried out in MATLAB to control the MLS 33-210 using PD-controller, PID-
controller and FO-PID controller. FO-PID is designed using Oustaloup’s approximation method with
the help of FOMCON toolbox [12], FOMCON toolbox consist of some fractional order controllers which
are used in SIMULINK (MATLAB). The fractional order-PID controller is shown in figure (5) and the
simulation results are presented in figure 6 (a),(b) and (c). Actual and desired ball position of
magnetic levitation system with PD, PID and FO-PID controllers is shown in table (1). From the
simulation results it is observed that by using fractional order-PID controller, the actual and desired
ball position is very close and is stable as compare to PD and PID controller. The error is calculated by
the formula as shown in equation (20).

Kp

Proportional
Gain

1 Ki 0.5 -K- 1
1/s
In1 Out1
Integral Gain
Gain Fractional integrator1

Kd 0.8 0.8
d u/dt

Derivative
Gain Fractional derivative1

Figure 5: FO-PID controller design Figure 6(a): Controlled Output of MLS using PD
controller

Figure 6(b): Controlled Output of MLS using PID Figure 6(c): Controlled Output of MLS using FO-PID
controller controller

Table 1: Actual and desired values obtained for different controllers in non-real time simulation.

Ball Position [m] Controller


PD PID FO-PID
Actual ball Max. 6.2×10-3 5.75×10-3 5.5×10-3
Position[m] Min. -4.6×10-3 -4.68×10-3 -5.2×10-3
Desired ball Max. 5×10-3 5×10-3 5×10-3
position [m] Min. -5×10-3 -5×10-3 -5×10-3
Error 14.02% 8.06% 5.66%

The steady state error is calculated as:


𝐷𝑒𝑠𝑖𝑟𝑒𝑑 𝐵𝑎𝑙𝑙 𝑃𝑜𝑠𝑖𝑡𝑖𝑜𝑛 −𝐴𝑐𝑡𝑢𝑎𝑙 𝐵𝑎𝑙𝑙 𝑃𝑜𝑠𝑖𝑡𝑖𝑜𝑛
𝑃𝑒𝑟𝑐𝑒𝑛𝑡 𝐸𝑟𝑟𝑜𝑟 = 𝐴𝑐𝑡𝑢𝑎𝑙 𝐵𝑎𝑙𝑙 𝑃𝑜𝑠𝑖𝑡𝑖𝑜𝑛
× 100% (20)

4.2 Real-time model

Real time control of MLS is carried out by interfacing the MLS mechanical system 33-210 with
the computer using ADC-DAC converter (Feedback 33-301) as shown in figure (7). For the real-time
control of MLS three types of controllers PD-controller, PID–controller and FO-PID controller are used
and results are compared for the same. The results of the real time controllers are presented in figure
8(a), (b) and (c), the actual and desired ball position is presented in table (2). From these results, it is
observed that the error when PD controller is used for MLS is 27.5%, for PID controller error is 14.7%
and in case of FO-PID controller, error is 13.04%.
PCI1711
Lab I/O Board PCI1711
Plant output Lab I/O Board
FOPID
Feedback Control signal
ADC Feedback
Fractional PID DAC
Feedback ADC Ch1
controller
Feedback DAC Ch1

voltage position
Desired
Step
& ball position [m]
Converter

voltage position
Signal
Sinus
Converter1 scope
simout
-1.5 Constant Desired
& ball position [V] To Workspace

Signal scope1

time

Clock
To Workspace1

Figure 7: Real time interfacing model in MATLAB Figure 8(a): Controlled Output of MLS using PD
controller

Figure 8(b): Controlled Output of MLS using PID Figure 8(c): Controlled Output of MLS using FO-PID
controller controller

Table 2: Actual and desired values obtained for different controllers in real- time simulation.
Controller
Ball Position [m]
PD PID FO-PID
Actual ball Max. 0.0168 0.0155 0.0132
Position[m] Min. 7.8×10-3 5×10-3 4.5×10-3
Desired ball Max. 0.0125 0.0125 0.0125
position [m] Min. 5.5×10-3 5.5×10-3 5.5×10-3
Error 27.5% 14.7% 13.04%

CONCLUSION
In this paper, a new scheme has been applied for the control of magnetic levitation system by
using fractional order-PID controller. The Oustaloup’s approximation method is employed for the
realization of FOPID controller. The parameters of integer order controller and FOPID are tuned by
genetic algorithm optimization, and further it is implemented for the controller using FOMCON
toolbox in SIMULINK (MATLAB). The performance analysis for these 3 types of controllers are
observed in simulation mode as well as in real time mode.

From the performance analysis it is observed that the FOPID controller is able to control the
plant efficiently with smaller error of 5.66% in simulation mode and 13.04 % in real time mode. It is
also observed that the actual and desired ball position in case of FO-PID are very close as compare to
other integer order PD and PID controllers. Further, the FOPID controller has better and fast response
than the integer order PD and PID controller and thus makes the system more stable.
REFERENCE
[1] Milica B. Naumoviem, Boban R. Veselic, “Magnetic levitation system in control engineering education”, UDC
681.537c, Automatic Control and Robotic Vol.7, N1, pp.151-160, 2008.
[2] John M. Watkins and George E. Piper, “An Undergraduate Course in Active Magnetic Levitation: Bridging the
Gap”, Proceeding of the 35th Southeast Symposium on System Control, pp.313-316, March 2003.
[3] Feedback Instruments Ltd., “Magnetic Levitation Control Experiments, Manual: 33-942S Ed01 122006,”
Feedback Part No. 1160-33942S.
[4] H. Gole, P. Barve, A. Kesarkar and N. Selvaganesan, “Investigation of Fractional Control Performance for
Magnetic Levitation Experimental Set-up”, proc. of International Conference on Emerging Trends in
Science, Engineering and Technology, pp. 500-504, December 2012.
[5] A. Oustaloup, F. Levron, B. Mathiew, F. Nanot, “Frequency Band Complex Noninteger Differentiator:
Characterization and Synthesis,” IEEE Transactions on Circuits and Systems I: Fundamental Theory and
Applications, 47(1):25-39, 2000.
[6] Mohammad Reza Faieghi and Abbas Nemati, “on Fractional-order PID design”, Application of MATLAB in
Science and Engineering, chapter 13, DOI: 10.5772/22657, 2011.
[7] A. Charef, H. H. Sun, Y. Y. Tsao, B. Onaral, “Fractal system as represented by singularity function”, Automatic
Control, IEEE Transactions on Vol. 37, Issue 9,Sept. 1992.
[8] J. D. Munkhammar, “Riemann-Liouville fractional derivatives and the Taylor-Riemann series”, 2004.
[9] Y. Q Chen, “Oustaloup - Recursive Approximation for Fractional Order Differentiators”, Math Works Inc,
August 2003.
[10] Shantanu Das, “Functional fractional calculus”, Springer, 2nd ed. 2011.
[11] Jun-Yi Cao, Jin Liang, Bing-Gang Cao, “Optimization Of Fractional Order PID Controllers Based On Genetic
Algorithms,” Proceedings of the 4th International Conference on Machine Learning and Cybernetics,
Guangzhou, 18-21, pp: 5686-5689, August 2005.
[12] Aleksei Tepljakov, Eduard Petlenkov and Juri Belikov, “FOMCON: Fractional-order Modeling and Control
Toolbox for MATLAB”, 18th International Conference on Mixed Design of Integrated Circuits and Systems,
Gliwice, Poland, June 16-18, 2011.
[13] Ien-Hsing Li, “Fuzzy Supervisory Control of a DSP-Based Magnetic Levitation system,” Asian Journal of
Control, Vol.9, No.1, pp. 64-67 ,March 2007.
[14] Roberto K. H. G, Associate member IEEE, Takashi Yoneyama, Fabio M.U de Araujo and Rodolfo Galati
Machado, “A simple technique for identifying a linearized model for a didactic levitation system”,0018-
9359/02 IEEE, 2003.
[15] A. Oustaloup, P. Melchior, P. Lanusse, O. Coins and F. Dancla, “The crone toolbox for MATLAB”, IEEE
International Symposium on Computer-Aided Control System Design, 0-7803-6566-6/00 IEEE, 2000.
[16] Yang Quan Chen “Fractional calculus, delay dynamics and networked control systems ” Resilient Control
Systems (ISRCS), 3rd International Symposium on Digital Object Identifier: 10.1109/ ISRCS.2010.5603932,
2010.

View publication stats

You might also like