Efficient Fuzzy Logic Controller for Magnetic Levitation Systems

*Corresponding author’s e-mail address: hrabiu.ele@buk.edu.ng doi: http://dx.doi.org/10.4314/njtd.v13i2.2 ABSTRACT: Magnetic levitation is a system of suspending a body or a complete system against gravity. Suspending a system in air against gravity without using fixed structure for supporting is highly unstable and complex. In the previous research many techniques of stabilizing magnetic levitation systems were discussed. In this paper magnetic levitation controller using fuzzy logic is proposed. The proposed Fuzzy logic controller (FLC) is designed, and developed using triangular membership function with 7×7 rules. The system model was implemented in MATLAB/SIMULINK and the system responses to Fuzzy controller with different input signals were investigated. Using unit step input signal, the proposed controller has a settling time of 0.35 secs, percentage overshoot of 0% and there is no oscillation. The proposed controller is validated with a model of an existing practical conventional proportional plus derivatives (PD) controller. The PD controller has a settling time of 0.45 secs, percentage overshoot of 7% and with oscillation. Similarly, with sinusoidal input, the FLC has a phase shift and peak response of 0^0 and 0.9967 respectively, while PD controller has a phase shift and peak response of 24.48 and 0.9616 respectively. A disturbance signal was applied to the input of the control system. Fuzzy controller succeeded in rejecting the disturbance signal without further turning of the parameters whereby PD controller failed.


I. INTRODUCTION
Magnetic Levitation is a way to suspend objects in air without any support, as if in defiance of gravity.As a child we must have seen a ping pong ball being levitated on an air stream at the output pipe of a vacuum cleaner.Magnetic levitation, also known as maglev is used in a similar way to levitate objects in air without any support, using magnetic field.Levitation is the process by which an object is suspended against gravity, in a stable position, without physical contact.For levitation on Earth, first, a force is required which is directed vertically upwards and of the same magnitude to the gravitational force, second, for any small displacement of the levitating object, a returning force is needed to stabilize it.
To design a stabilizing system for magnetic levitation, a robust controller is required.It has been established by many previous work that magnetic levitation model is highly complex and non-linear in nature Shuaibu et al. (2010).
Many approaches of developing non-linear control techniques have been presented with variety of results.One of such approach, which has shown promise for solving nonlinear control problems, is the use of fuzzy logic control, (Elreesh, 2011).It has been suggested that fuzzy logic controllers designed for this model has been proving to work properly with non-linear system.
The stable levitation can be naturally achieved in magnetic or aerodynamic forces, (Wong, 1996).Many research works were presented in literature on the simplest way of suspending an object using levitation system.Katie and Kent (2004), presented a levitation system with less complexity.Kent et al (2004) presented a levitation which uses hall effect sensor at the base of solenoid to sense the actual position of the object and damping is provided by the washer attached to the levitated object.
Liming Shi et al in 2003 andXu et al. in 2004 presented research on levitation which used four hybrid-excited magnets for levitating object, the magnets were carefully controlled in synchronism, DSP (TMS320F2407) was used by Xu et al. to control the magnets.Venghi et al (2016) presented a magnetic levitation control system in his work.They linearized the nonlinear system model is around the operating point.Two control loops, an inner current loop and an outer position loop are designed using the linear system obtained.The two controllers performed satisfactorily Hasirci et al. (2013) proposed new design topology uses only one force-generating system (motor) to produce the three forces required in a maglev system: propulsion, levitation and guidance, whereas classical maglev trains use a separate motor or permanent magnet to produce each of these forces.Moreover, the system eliminates the need for control of the levitation and guidance forces.Mabrouk et al (2013)    the levitated plate of TEAM Workshop Problem 28, is computed by the interaction between eddy current induced in the plate and the magnetic flux density.In 2005, Shaohni et al (2005), used an adaptive neuron to regulated and turn the PID parameters whereas Hung-Cheng et al ( 2006) used bio-inspired methods to control magnetic levitation system.Hung-Cheg et al ( 2006) controlled the same parameters with a genetic algorithm.
Boughrara, K., & Ibtiouen, R. ( 2013) present a new analytical method for predicting magnetic field distribution and levitation force in three configurations of high temperature superconducting (HTSC) maglev vehicles.The permanent magnet guide ways (PMG) are composed with ferromagnetic materials and NdFeB permanent magnets.The proposed analytical model is based on the resolution in each region of Laplace's and Poisson's equations by using the technique of separation of variables however the control aspect has not been mention.
Yadav, et al ( 2016) proposed an optimized proportionalintegral-derivative (PID) controller to control the ball position of the magnetic levitation system (MLS).The electromagnetic force of the MLS is controlled by sensing the position of the ball with the help of the infra-red (IR) sensors.The system performance is improved in terms of time & frequency domain by optimizing the parameters of the PID controller using grey wolf optimizer (GWO).
Shuaibu et al. (2010) presented a low complex system of levitating ferromagnetic materials using a conventional PD controller.The model of the controller developed by Shuaibu et al ( 2010) was practically implemented in the laboratory.Since the PD parameters and other parameters measured were available, this gives us the inspiration of developing a more robust and simpler controller using the same parameters.
In this paper, a robust controller using fuzzy logic is proposed.The proposed controller used the parameters setting as in Shuaibu et al. (2010) and the performance of the controller is compared with that of Shuaibu et al (2010) PD controller.The rest of the paper is organized as follows section 2 gives the mathematical model of the system.The Fuzzy logic controller design was presented in section 3. Simulation results and analysis was given in section 4 and finally a conclusion is drawn in section 5.

II. MATHEMATICAL MODELLING OF THE SYSTEM
The actuating component of the magnetic levitation system is the electromagnet which attracts the object (refer to as plant) to be levitated against gravitational force.The difference between the electromagnetic forces and the gravitational forces accelerates the plant upward or downward depending on the forces strength.The target is to balance these two forces at a certain position which is known as steady state position with other disturbances such as air and vibration which are negligible compared to the force of gravity and electromagnetic force.
Figure 1 shows the equivalent circuit model of maglev system developed by Shu'aibu et al (2010).Figure 2 shows the variation of inductor coil with position.The system was modeled using the physical laws of motion and the principle of conservation of energy, and controlled using phase-lead compensator.The model and the nominal parameters were used in order to compare the performance requirement obtained with that of fuzzy logic controller for the purpose of analysis.
The following parameters define the meaning of the terms used for obtaining the system equations.The electromagnetic force on the levitated object is found using the concept of co-energy, because the electromagnet is highly non-linear device Benjamin (1989).The co-energy (w1) is defined as in eqn (1): Shu'aibu et al. (2010).
1 (i,y) = Obtaining the magnetic force by differentiating eqn (1) and using Taylor's series, the linear equation can be approximated to eqn (2).
Equation ( 2) is in form of a linear relationship as eqn (3).m̈ =  1  ̂ +  2 ̂ (3) where K1 is in N/m while K2 is in N/A and they can be obtained experimentally when the value of Io, Yo and C are known.
For the electrical equation, it is assumed that the electromagnet coil is adequately modeled by a series resistorinductor combination.The inductor includes that of the object when suspended as described.The circuit is shown in Figure 3.
The analysis can be simplify by assuming that the system is properly designed, such that the ball (object) remains closed to its equilibrium position, that is Y0 = y.This means that L(y) = L1 + L0.
Making another assumption that the inherent inductance of the coil, L1 is much larger than the inductive contribution of the object to be suspended, Lo, gives the final eqn (4).

A. Plant Model
The plant consist of the object to be levitated, so by using Newton's Law of motion the vertical force acting on the object is given by Where m is the mass of the object, y is the displacement of the steel ball below the magnet.
Taking the Laplace transform, then:

B. Sensor Model
The sensor can be modeled to be a variable light depending resistor.A light depending resistor is used as a sensor; the position of the sensor should be tested and calibrated according to the degree of sensing or blocking.This calibration is achieved by incrementing a light or rays shield that corresponds to the object's size in the y direction and then recording the sensor output voltage.The data is given as a displacement from the bottom of the electromagnet coil down to the top of the ball.
In this configuration, the sensor is placed so as to detect the bottom edge of the levitated object.The sensor is to be used in its linear region, Benjamin (1989).The sensor should not be allowed to operate in its saturation region.Sensors like phototransistor, photodiodes or an array of photocells and a light source could also be used.A light depending resistor or photoconductive cell is simply modeled as a gain element.The relationship is given by; where α is the gain of the sensor its unit is V/m, y is the vertical distance in m, V is the voltage across the sensor in Volts.
Equations ( 2), ( 4), ( 6) and ( 7) are the four equations describing the system.A Laplace transform or state space techniques can be used to analyses the system since it has been linearzed.

C. The System Transfer Function
The transfer function of the system is assume to be the ratio of the position of steel ball below the magnet Y(s) to the current through the magnet I(s).Hence
This is because the input voltage to the magnet is proportional to its current at constant reactance, and the output voltage across the sensor is directly proportional to the position of steel ball (object) below the electromagnet.Combine the four equations that described the system and obtained the open loop transfer function as

D. Determination of System Parameters
The parameters are the constant of the magnet, the resistance and the inductance of the magnetic coil, the gain of the sensor and the steady-state current and the equilibrium position of a given mass of steel ball.After a series of experiments, the parameters obtained are given in The block diagram in Figure 4 represents the complete closed loop system.The plant is the ferromagnetic material to be suspended, the force actuator is the electromagnet and controller is the circuit that controls the suspended object.The sensor feeds back the actual position of the suspended object.

III. FUZZY LOGIC CONTROLLER DESIGN
A fuzzy logic controller has four main components as shown in Figure 5: fuzzification interface, interface mechanism, rule base and defuzzification interface.FLCs are complex, nonlinear controllers.Therefore it's difficult to predict how the rise time, settling time or steady state error is affected when controller parameters or control rules are changed.
Implementation of an FLC requires the choice of four key factors Mamdani (1977): number of fuzzy sets that constitute linguistic variables, mapping of measurements onto the support seta, control protocol that determines the controller behavior and shape of membership function.Thus, FLCs can be tuned not just by adjusting controller parameters but also by changing control rules, membership functions etc.
Rules base, inference mechanism and defuzzification methods are the sources of nonlinearities in FLCs.But it's possible to construct a rule base with linear input-output characteristics.For an FLCs to become linear controller with a control signal U = E + CE where E is "error" and CE is "change of error", some condition must be satisfied, Jantzen, (2007): 1.Support sets of input linguistics variables must be large enough so that input values stay in limits.
2. Linguistic values must consist of symmetric triangular fuzzy sets that intercept with neighboring sets at a membership value of μ= 0.5 so that for any time instant, membership values are add to 1. 3. Rule base consist of ⋀-combinations of all fuzzy sets.4. Output linguistic variables must consist of singleton fuzzy set [  ,1] positioned at the sum of the peak positions of input fuzzy sets. 5. ⋀ should be multiplication and defuzzification method must be "center of gravity" (COGS).
It can be seen that seven linguistic variables are used to map each of the input and each of the output variables, therefore we will have 7 × 7 = 49 fuzzy rules as indicated in Table 2 below: The Table shows the position of "error", "change in error" as well as the "output" of each linguistic variable.The rules are summarized in Table 2.
The last stage of fuzzy controller design is defuzzification.This research in particular, makes the use of centre of area defuzzification method, simply because, it is widely used in fuzzy logic control applications.In this research MATLAB/SIMULINK tool box release 13 is used.The design is based on Mandani.Triangular membership function is used as shown in Figure 6.The centre area method or centre of   gravity method is used as given in eqn (12).Figure 6 shows the overall controller design using fuzzy logic algorithm.
where U(k) is the controllers output (i.e.crisp control applied to the process input).Zj is the maximum of j-th membership function for j-th rule, and μ_j is the weighted factor of the j-th For the purpose of comparison, a PD Controller was incorporated in the simulink implementation as shown in Figure 6; this will enable us to compare the performance of the phase lead compensator with the FLC.
As describe in Section II, this control strategy involves determining a control signal that will cause the plant (process) to satisfy certain physical constraints and at the same time minimize the chosen performance index.The error change has not been discussed or given in Shuaibu et al (2010).

IV. RESULTS AND DISCUSSION
In the simulation analysis, the PD controller proposed by Shu'aibu (2010) and the proposed FLC in this paper are subjected to the same input signal and disturbances.The system responses from both FLC and Phase lead compensator for a step input signal are plotted on the same graph for the purpose of comparison as shown in Figure 7.It can be observed that the FLC gives faster response and zero overshoot compared to the phase lead compensator.
Similarly, Figure 8 shows the output response of the system for FLC and phase lead compensator with a sinusoidal input signal.Tables 3 and 4 show the calculated performance indices of the controllers.For the magnetic levitation system considered in this work; the fuzzy logic controller (FLC) generally shows better performance in term of settling time and maximum overshoot than the phase lead compensator (PD).However, PD has a shorter rise time.
From Table 4 it can be seen that the FLC gives a reasonable result without a phase shift, the steady state error is 0,33 which is small when compare with PD controller.However, the PD controller has a smaller peak response of 0.9616 as shown in Table 4 with a very high steady state error of 3.84.
The two controllers were tested with varying distance through simulation.The results were analyzed for the Maglev system with the Fuzzy logic controller and PD controller for different positions of the ball.The positions were set at 0.1m, 0.3m and 0.5m respectively.Figures 9, 10 and 11 show the plots of position versus time and control signal versus time for all the three different positions.the three positions respectively.The Fuzzy controller has no percent overshoot with a rise time 0.25s and a settling time 0f 0.35s whereas the PD controller has percent overshoot of 7% with rise time of 0.15s and settling time of 0.45.This shows that the proposed controller is better in terms of overshoot and settling time.
From the simulation results, it can be seen that the position converges to any set value within the range of 0.1m to 0.5m.Hence, the controlled system is robust to changes in the step input magnitude.Also it can be seen that from the simulation results there is no change in percent overshoot, rise time and settling time when the position is varied.Simulations were also carry-out using sinusoidal reference input of amplitude 1mV at different frequencies.The simulations are performed with the frequency of the reference signal set to 1Hz, 3Hz and 5Hz respectively.Figures 12, 13 and 14 show the plots of position versus time for the three different input signals respectively.The results for different frequency for the two controllers are presented in Table 6.Table 6 summarizes the results obtained from Figures 12 13 and 14.It can be seen that for the 3 Figures the fuzzy logic controller does not have any phase shift and it the minimum steady state error.However the peak responses are all the same irrespective of the signal frequency and are higher than that of PD controller.A constant phase shift, peak response and steady state error were obtained for PD controller as the signal frequency varies and the values higher than that of Fuzzy logic Controller except the peak Response.

V. CONCLUSION
In this paper, highly unstable nonlinear system was modelled and an approximate linear system of the model was obtained.Two controllers were designed to stabilize the system.Simulation results show that the designed fuzzy controller performs satisfactorily with two different input signals.FLC controller rejected the disturbance signal without further turning of the controller parameters whereas PD controller failed.Performance criteria show that FLC controller has 0% overshoot, zero degree phase shift, 0.35s settling time and 0.33% steady state error.While PD controller has 7% overshoot, 24.88 degree phase shift, 0.45s settling time and finally 3.84% steady state error.Conclusively, the simulation result shows good and desirable performance of fuzzy controller over PD controller.

Figure 2 :
Figure 2: Assumed variation of the Inductance of the coil with position Shuaibu et all (2010).

i
Electric current through the Electromagnet (A) ̂ Perturbation Current (A) Io Steady-state position Current (A) y Vertical displacement of object from Electromagnet (m)  ̂ Perturbation displacement (m) Yo -Steady-state displacement (reference point) (m) L(y) -Total inductance of the Electromagnet (H) Lo -Additional inductance due to the suspended object (H) L1 -Coils inductance in the absence of the object (H)

Figure 3 :
Figure 3: Circuit representation of a coil.

Figure 4 :
Figure 4: Block diagram for Closed Loop Control System.

Figure 8 :
Figure 8: Response for a unit step input with disturbance signal.
finite volume method (FVM) model is developed to analyze the dynamic characteristic of the motion of the electrodynamic levitation device TEAM Workshop Problem 28.The dynamic characteristic of the motion is obtained by solving the electromagnetic equation coupled to the mechanical one.The repulsive force applied to

Table 3 : Performance index for unit step input signal. Figure 6: Fuzzy Controller with Compensator.
Table 5 summarizes the results in terms of percent overshoot, rise time and settling time for all *Corresponding author's e-mail address: olubunmimokuolu@yahoo.comdoi: http://dx.doi.org/10.4314/njtd.v13i1.1