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,
[email protected] 2 Department of Electrical Engineering, VNIT Nagpur,
[email protected] 3 Department of Electrical Engineering, VNIT Nagpur,
[email protected] 4 Department of Electrical Engineering, VNIT Nagpur,
[email protected]
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. 𝜕𝑓 (𝑖,𝑥) 𝜕𝑖 𝑖0 ,𝑥 0
𝑥=−
∆𝑖 +
𝜕𝑓 (𝑖,𝑥) 𝜕𝑥 𝑖0 ,𝑥 0
∆𝑥
(5)
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)
𝑥
Where, 𝐾𝑖 =
2𝑚𝑔 𝑖0
and 𝐾𝑥 = −
2𝑚𝑔 𝑥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). 𝑑𝑞 𝑞 𝑎𝐷𝑡
𝑑𝑡 𝑞
= 1 𝑡 (𝑑𝜏)−𝑞 𝑎
𝑞>0 𝑞=0 𝑞 0)
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
H s =K
s+ω k N 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 p
ωk = ωL ωL ωH K=
ωL
ωH
−⍺ 2
k+N+0.5+0.5q
2N+1
(17)
k+N+0.5−0.5q
2N+1
(18)
ωzk N k=−N
p
ωk
(19)
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 maximum search terms reached
No
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, PIDcontroller 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
0.5
Ki
In1
Integral Gain
1 Out1
Gain
Fractional integrator1
0.8
Kd Derivative Gain
-K-
1/s
d u/dt
0.8
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 controller
Figure 6(c): Controlled Output of MLS using FO-PID controller
Table 1: Actual and desired values obtained for different controllers in non-real time simulation. Ball Position [m] Actual ball Position[m] Desired ball position [m] Error
Max. Min. Max. Min.
Controller PID 5.75×10-3 -4.68×10-3 5×10-3 -5×10-3 8.06%
PD 6.2×10-3 -4.6×10-3 5×10-3 -5×10-3 14.02%
FO-PID 5.5×10-3 -5.2×10-3 5×10-3 -5×10-3 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 Plant output
FOPID
Feedback ADC
PCI1711 Lab I/O Board Control signal Feedback DAC
Fractional PID controller
Feedback ADC Ch1
voltage position
Feedback DAC Ch1
Desired & ball position [m]
Step Converter voltage position Sinus
Signal scope
Converter1
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(b): Controlled Output of MLS using PID controller
Figure 8(a): Controlled Output of MLS using PD controller
Figure 8(c): Controlled Output of MLS using FO-PID controller
Table 2: Actual and desired values obtained for different controllers in real- time simulation. Controller
Ball Position [m] Actual ball Position[m] Desired ball position [m] Error
PD
PID
FO-PID
Max.
0.0168
0.0155
0.0132
Min. Max. Min.
7.8×10-3 0.0125 5.5×10-3 27.5%
5×10-3 0.0125 5.5×10-3 14.7%
4.5×10-3 0.0125 5.5×10-3 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”,00189359/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.