Synthesis of Hybrid Fuzzy Logic Law for Stable Control of Magnetic Levitation System

—In this paper, we present a method to design a hybrid fuzzy logic controller (FLC) for a magnetic levitation system (MLS) based on the linear feedforward control method combined with FLC. MLS has many applications in industry, transportation, but the system is strongly nonlinear and unstable at equilibrium. The fast response linear control law ensures that the ball is kept at the desired point, but does not remain stable at that point in the presence of noise or deviation from the desired position. The controller that combines linear feedforward control and FLC is designed to ensure ball stability and increase the system's fast-response when deviating from equilibrium and improve control quality. Simulation results in the presence of noise show that the proposed control law has a fast and stable effect on external noise. The advantages of the proposed controller are shown through the comparison results with conventional PID and FLC control laws.


I. INTRODUCTION
Magnetic levitation system is a typical mechatronic system, it has many applications in engineering systems such as in high speed maglev passenger trains, frictionless bearings, vibration isolation of sensitive machinery, levitation the molten metal in an induction furnace and levitation the sheet metal during production. The advantages of magnetic levitation technology are non-contact, no friction, low noise, low pollution and easy maintenance [1]- [4], [64], [70]- [71], [75]- [82]. In addition, this system is also a model in research laboratories, as a test object for traditional and modern control algorithms. Magnetic levitation systems can be classified as suction systems or propulsion systems based on the direction of the magnetic force. These systems are often open-loop unstable and are described by differential equations with large nonlinear components that make it difficult to design control laws and especially when implemented on real systems. Therefore, designing a magnetic levitation position control system, when there is an external noise acting on the magnetic ball, is a necessary problem for real systems.
There have been many studies on the control of magnetic levitation systems. The PID and LQR controllers are designed in [1]- [6], [57], [58], applied on the real system for stable results, in which the LQR controller only gives good results in the vicinity of the working point. In the works [7]- [13], [33], PID and PID controllers with optimal parameters are used to control the magnetic levitation system for the guarantee, but this controller is often sensitive to the change of set value and interference. In addition, adaptive nonlinear controllers based on Backstepping [14]- [19], [61], [62], sliding mode control [20]- [27], [65]- [69], robust control methods presented in studies [28], [30], control laws associated with neural networks in studies [59], [60] have good results, but require high modeling and Control laws are often complex. In [31], optimal controllers based on dynamic adaptation are proposed and tested. The sub-optimal controller given in the study [32]- [33], [72]- [74] gives relatively good simulation and experimental results, but requires quite accurate response values, so the accompanying filters are often used. The adaptive control law when there exists noise and unknown model parameters are presented in the studies [35], [36], [63]. In the study [34] presented the method of cascade control using sequential manifolds. The control quality is clearly improved, but in the control law, there is a high-order derivative with respect to the manifolds, leading to an increase in the complexity of the control law.
In recent years, fuzzy theory has been widely applied in the field of automatic control of embedded systems and has made great strides in the field of automation control [37]- [40], [52]- [56]. The advantages of control systems using fuzzy rules are resistance to interference and lack of precise information about the system. In the studies [41]- [48], the method of designing FLC controller for magnetic levitationing system is presented. The designed controllers require the designer to have a deep knowledge of the system as well as understanding of the system's operations under the influence of noise, this controller is mainly designed in the relationship normally between position and velocity.
In this paper, a hybrid controller between the linear feed forward control and the fuzzy controller is designed. The mathematical model of the system is given, and then set up to test the results of the proposed control law in the study. The fuzzy controller is designed based on the position error and its derivative, but the composition rule table is built based on the position of the magnetic ball to calculate the effect of the force on it. Finally, the simulation results with different cases demonstrate the strong effectiveness of the proposed control law. In addition, it is also compared with other control laws to prove the control quality of this rule.
The rest of the paper is organized as follows: Part 2 presents the design of the embedded control model of the magnetic levitation system and the mathematical model of Nguyen Xuan Chiem, Synthesis of Hybrid Fuzzy Logic Law for Stable Control of Magnetic Levitation System the magnetic levitation system. Section 3 presents the design of control law for magnetic levitation system combined with fuzzy theory. Section 4 presents simulation results and related discussions. Finally, the conclusions and follow-up work of this article.

II. MAGNETIC LEVITATION SYSTEM MODEL
The model of the system that levitation the object in the magnetic field has the form as shown in Fig. 1. In the uncontrolled state, gravity acts on the ball to destabilize the system.
The voltage u is the variable input to control the electromagnetic force F to keep the ball at a certain distance xd from the electromagnet. The distance between the ball and the magnet is determined by the Hall-49e distance sensor. According to studies [32], [34], the mathematical model of the levitation system in the magnetic field has shown in (1).

III. DESIGN OF POSITIONAL STABILITY CONTROLLER FOR MAGNETIC LEVITATION SYSTEM
A. Synthesis of fuzzy logic controller for magnetic levitation system Consider the system of equations (1) when the noise d≈0, so that the system is stable at the desired operating point xd or: 1 = ; 2 = 0; 3 = √ ⁄ need a control signal to propagate straight when substituting into the system of equation (1), we get: From here to stabilize the magnetic ball at a position xd, the system always needs to supply voltage . The fuzzy controller is designed according to the Takagi-Sugeno model, including the following outputs: two inputs are the position deviation from the desired position ( 1 = − 1 ) and the error rate position ( 2 =̇−̇1 = − 2 ); one output is the control signal voltage u. The block diagram of the control system is shown in Fig. 2. Building control rules for fuzzy inference systems is always the most important step in the fuzzy controller design process. By analyzing the system behavior from the mathematical model of the system (1). We see that when the magnetic ball is below the working point, we need to increase the voltage for the magnet to pull the ball back and when at the top we need to reduce the voltage to move the ball to the working position thanks to gravitation. When the marble is located nearby at the working point, it is necessary to supply voltage to keep it at that position. The control law is built as in Table 1 with 49 composition clauses and the AND operator is chosen to perform the conditional clause matching according to Prod rule for inputs. Fuzzy controller is designed from 49 IF...THEN rules, and uses Max-Prod composition rules, univalent fuzzy and pseudo-fuzzy by center point method, because the output is singleton functions. The control rule surface space is designed when xd = 0.02 (m) has a nonlinear form as shown in Fig. 4. It is clear that the larger the non-zero error coefficient, the higher the slope of the surface and when it is far from the point balanced, the voltage supplied to the system is constant because the requirement of the real system is that the voltage is limited. for the calculation of the fuzzy controller synthesis method used the formula on equation (2).

B. Synthesis of hybrid fuzzy controller for magnetic levitation system
With the fuzzy controller synthesis method as equation (2). It is easy to see that the control signal changes when there is an error, but the error signal changes the entire voltage value of the electromagnet without discriminating between the noise and the set value. Therefore, this controller is susceptible to noise and has a slow response time when the set value changes. In order to increase the response speed and be more stable to external noise, the authors propose a combination control method between the direct transmission controller and the fuzzy controller. In which, the direct transmission controller is designed = √ to be responsible for bringing the magnetic ball to the desired position while the fuzzy controller ensures the stability of the ball under the influence of noise d. The diagram of the control structure of the system with this controller has the form of Fig. 6.
The fuzzy controller is designed with the same input form as the above controller with 2 inputs. But the output ∆u is designed with 6 language variables, with the value shown in Fig. 5. Because when the ball moves upwards, gravity has a pull towards the working point. So the complete boundary value is -3 (V) and when the ball moves below the set value, the boundary is chosen to be 5 (V). The output value is also corrected through the coefficient Ku.  Composition propositions are built as shown in Table 2. With composition rules and defuzzification methods as in section 3.1. The surface space of the proposed fuzzy control rule is shown in Fig. 7. It is easy to see that the surface space of this controller is also nonlinear. But rule selection is based on knowledge of fast acting for information related to establishment error. The controller value stops only when both the error and the error speed are in the ZE domain. The elements on the side diagonal of the table are replaced by NS and PS values to increase system responsiveness and system oscillation.

C. Synthesis of PID controller for magnetic levitation system
Continuous time PID controllers have been very popular since the early 20th century, using PID controller to correct the difference between the measured value of the system (process variable) and the setpoint value by calculating and adjust the control value at the output. The PID controller is a closed-loop controller widely used in industry. The PID controller is designed to ensure that the system is stable at the equilibrium point. The designed control law has the form in (3).
where p is the proportional gain, i is the integral gain, and d is the derivative gain.

IV. RESULTS AND DISCUSSION
In-depth numerical simulations based on computer have been performed to demonstrate the effectiveness of hybrid fuzzy control law over FLC and PID control law for magnetic levitation system. The parameters of the hybrid fuzzy control rule are selected through the parameters 2, 2 and . The parameters of the FLC through 1, 1 and the PID controller are the parameters , and . These parameters reflect the quality of the control rules of the rule rules. In this study, a set of parameters will be selected with the following values: From Fig. 8 (a), (b), (c) are the position response, ball speed pattern and control voltage in the first scenario. We can see that, all three modulation controllers guarantee the system stability to the desired position. The position of the ball is stable to the desired position but clearly in the 3 stages of xd value transfer, the hybrid fuzzy controller (uPro) gives a better response in terms of control quality. In Fig. 8 (a) at the time from 0 (s) to 3 (s), all three controllers are stable in the system, in which the hybrid fuzzy controller gives good response time and low overshoot. The PID controller has the ability to act quickly but produce a large overshoot, the FLC controller has the largest overshoot and long reach time. During this stage, all three controllers cause oscillations for the system in transient mode because the magnetic magnet has not been supplied with voltage initially. Therefore, the behavior of the system during this time period is to ensure the stability of the magnetic position. During the remaining periods when the magnet has been applied voltage by varying xd, it is clear that the system no longer behaves like this. Obviously, the PID controller has a fast action time but leads to a large overshoot, the transient time is smaller than FLC but larger than the proposed control and the system is still oscillating but with a lower frequency than the FLC controller with the first stage. The proposed controller gives small transient time, no overshoot and no oscillation compared with PID and FLC controller. The quality of the transition stages is shown in Table III. If compared with the results in the study [34], the results of the control law are also equivalent in terms of control quality indicators. In Fig. 8 (b), it can be seen that the magnetic ball velocity amplitude of the proposed controller is x2-Pro smaller than the other two controllers in the first stage. In the next stages, the speed according to the PID controller has the largest fluctuation amplitude. Figure  8c shows the response of the control signal of the three proposed rules, it is clear that the control signal of the hybrid fuzzy controller has a lower amplitude and frequency than the other two controllers. In the next stage, the oscillation frequency is smaller than the other two controllers and the amplitude of the oscillation is smaller according to the PID law. This shows the possibility that the proposed controller works well on the real system.  We can see that, all three modulation controllers guarantee the system to be stable in the desired position when there is the presence of external noise d(x)=3×random (-1,1). Recommended controller uPro ensure that the magnetic ball is stable with the minimum amplitude of oscillation and response time ( Fig. 9 (a)). Magnetic ball velocity at the moment of transition with the proposed control law x2-Pro is always minimal even in the presence of noise ( Fig. 9 (b)). Control signal uPro, has the minimum oscillation amplitude compared to the two control laws PID and FLC (Fig. 9 (c)), ensuring that the energy consumption due to noise is smaller than that of other control laws

V. CONCLUSION
The paper has successfully built a hybrid fuzzy control law for the magnetic levitation system. In which the Law of Composition is built not only on the knowledge of position and velocity, but also on the properties of the magnetic levitation system. Therefore, the proposed controller is fast acting compared to the conventional FLC controller. From simulation and experimental results, it is shown that the proposed control law ensures system stability and control quality better than other controllers when the set value changes and when there is noise acting on the ball bearings. same initial conditions. Future studies will focus on correcting the composition rule to optimize the control law, and at the same time combine neural networks and Nature-Inspired Optimization Algorithms to optimize controller parameters to increase the quality of system control.