Stabilization of the Magnetic Levitation System

: This paper contributes toward research on the control of the magnetic levitation plant, representing a typical nonlinear unstable system that can be controlled by various methods. This paper shows two various approaches to the solution of the controller design based on different closed loop requirements. Starting from a known unstable linear plant model—the ﬁrst method is based on the two-step procedure. In the ﬁrst step, the transfer function of the controlled system is modiﬁed to get a stable non-oscillatory system. In the next step, the required ﬁrst-order dynamic is deﬁned and a model-based PI controller is proposed. The closed loop time constant of this ﬁrst-order model-based approach can then be used as a tuning parameter. The second set of methods is based on a simpliﬁed ultra-local linear approximation of the plant dynamics by the double-integrator plus dead-time (DIPDT) model. Similar to the ﬁrst method, one possible solution is to stabilize the system by a PD controller combined with a low-pass ﬁlter. To eliminate the offset, the stabilized system is supplemented by a simple static feedforward, or by a controller proposed by means of an internal model control (IMC). Another possible approach is to apply for the DIPDT model directly a stabilizing PID controller. The considered solutions are compared to the magnetic levitation system, controlled via the MATLAB/Simulink environment. It is shown that, all three controllers, with integral action, yield much slower dynamics than the stabilizing PD control, which gives one motivation to look for alternative ways of steady-state error compensation, guaranteeing faster setpoint step responses.


Introduction
The magnetic levitation system represents a typical nonlinear unstable system. Since it presents several interesting problems for control, there exists numerous educational laboratory models that can be used for verifying control algorithms, demonstrating their properties. The most used are products from Quanser [1], Humusoft [2], Googol [3], LD Didactic Group [4], and Inteco [5].
The paper presents and compares two possible solutions to the magnetic levitation plant control problem.
The first method is based on the knowledge of the transfer function of the linearized system (1) derived, considering parameters given by the manufacturer [21]. It starts with stabilizing the given unstable system. In the next step, the dynamics of compensation of the emerging disturbances are specified. By neglecting the fast stable mode of transients, the design procedure can be made simple and robust, similar to model-based PI control [22]. The controllers designed by the first approach make it possible to measure the input-output steady-state characteristic (IOSSCH) of the system, expressing the dependence of the output variable of the system on the input in steady states ( Figure 2). While the analytically derived transfer function of the system results in a linear dependence of the output from the input at steady states, the measured dependence shows non-linear properties of the system. It indicates that, in an effort to accelerate transients by this approach, we would have to deal with the limited accuracy of the linear model. Although the proposed control meets most of the above requirements, it will be relatively slower in terms of transient speed.
Therefore, to verify the plant dynamics, the second group of possible approaches begins with identifying the system. The authors of [10] have already pointed out several aspects that are important in the effort to achieve the fastest possible (and sufficiently smooth) transients at the input and output of the system. In view of the non-linearity of the system, in the second set of approaches, it is preferred to approximate the system's dynamics by means of the simplest second-order transfer function of a double integrator with a transport delay (DIPDT, double integrator plus dead time). Such an ultra-local model, typical of today's popular robust control approach with active disturbance rejection control (ADRC) [23][24][25][26][27], avoids the need to approximate nonlinear system feedback. A similar simplification is used by another method working with finite impulse response (FIR) filters. Due to omitting identification of internal plant feedback, it is also called model-free-control (MFC). Its application can lead to an intelligent proportional-derivative (iPD) controller [28][29][30][31]. After determining the DIPDT plant model, simple proportionalderivative (PD) controllers can be used for the stabilizing controller design [31,32]. When supplemented by low-pass filter design and combined with static feedforward (using inversion of the measured IOSSCH), it is possible to get control processes that are already very close to the performance limits given by the available hardware. To deal with possible disturbances (including the model imperfections), the proportional-integral-derivative (PID) controllers (supplemented again by the design of low-pass filters [33]), or internal model control (IMC) controllers may be added to the basic loop with a stabilizing PD controller [34]. However, the achieved controllers with integral (I) action again show much slower dynamics than the simple stabilizing PD controller with the offset compensation by static feedforward.
The rest of the paper is structured as follows. Section 2 briefly describes the magnetic levitation system. In Section 3, a simplified controller design is presented that, after stabilizing the system and neglecting the fast stable mode of transients, can be denoted as a model-based PI controller design. In Section 4, three different controllers are presented, based on the simplest plant approximations by the time-delayed double-integrator plus dead-time (DIPDT) model.The achieved results are discussed and summarized in the Conclusions. The main contribution of the article can be considered the analysis and experimental verification of several possible features of the design of the rapid nonlinear and unstable process of magnetic levitation, with regard to the most frequently placed requirements. It follows that, all used controllers with I action finally give dynamics, which is significantly slower than with simple stabilizing PD controllers. This provides an incentive for further work to explore new alternatives, to eliminate permanent control-error without significantly reducing the dynamics of the setpoint responses.

Magnetic Levitation Plant
The paper deals with the control of the magnetic levitation plant CE152, provided by Humusoft ( [2], see Figure 1). This educational laboratory model enables demonstrating control problems associated with nonlinear unstable systems. The aim is to stabilize and control the ball position. The company originally supported communications via the MF624 A/D card [35]. To get new degrees of freedom, the MF624 card was substituted by the low cost solution based on the Arduino Due board [36]. The plant is controlled via the MATLAB/Simulink simulation environment that enables running simulations in an external mode. The support for Arduino Due is available thanks to third-party add-ons, called Simulink Support Package for Arduino Hardware.
The literature offers several models that describe the dynamic behavior of the magnetic levitation system. In addition to nonlinear models [37], simplified linear models could also be found.Very often, they are described by the third order system with three time constants (see, e.g., [12,[38][39][40]). However, after a more detailed analysis, it can be found that one time constant (electrical) can be neglected in comparison to other two time constants, which are approximately the same in its value, but one pole is positive and one negative. This can be confirmed by the second order models of the Humusoft magnetic levitation plant, published in [6,41] or [13]. Therefore, the magnetic levitation model can be replaced practically in the whole controlled range (approximately 0.1-0.9), which is given by the used sensor (its range is transformed to the so-called 1MU), by the transfer function The correctness of this model is also confirmed by the comparison of the measured input-output characteristic and the characteristic corresponding to the model (1) (Figure 2). Both shapes are very close to each other. Their displacement is due to the asymmetry of the gravitational force not taken into account by the transfer function of the system (1).
As mentioned, the electrical time constant considered in other publications is neglected, because it is small enough compared to the mechanical time constant.

Weighted PID Controller Design
As it is possible to see, the transfer function describing the ball movement (1) is unstable. The first step in designing the controller is to stabilize the system. Its desired closed-loop behavior can be expressed using the second order transfer function The considered structure of the control scheme is shown in Figure 3. The transfer function C 1 (s) represents a controller providing stabilizing feedback that for (2) can be written in general form Considering a 2 = 0, we get a PD controller, whereby the parameter β can be expressed as Transfer function M(s) can be reduced to the 1st order by the suitable choice of time constants τ 2 τ 1 , when This can be achieved, e.g., by defining τ 1 = ρT and τ 2 = T/ρ where ρ is a sufficiently big value. Then, After stabilizing the system, it is possible to proceed to the design of the controller C 2 (s), which will ensure the required behavior of the entire control structure under impact of disturbances.
Since the transfer function (6) is first order, the desired closed loop transfer function F(s) can also be selected as a first order function Correspondingly, in such a model-based design, the transfer function of the controller remains feasible. Considering (10) a (6), It is obvious that this is the structure of the PI controller the gain of which can be influenced by the choice of λ. For λ = ρT je K C = 1/K. The considered control structure ( Figure 3) still contains one block and it is the first order filter Q(s) Its aim is to ensure filtering of the measured signal.

Experimental Results
The whole design was accomplished considering parameters in Table 1. These parameters lead to the following values β = 0.588, a 0 = 1.177 a, a 1 = 0.027 s. For λ = ρT = 0.036 s, the controller parameters are K C = 0.588 a, T I = 0.036. In the experiment, the sampling period was 1 ms and the time constant of the filter Q(s) was equal to the sampling period. A corresponding transient and control signal is shown in Figure 4. The advantages of this approach are its simplicity, high robustness, and low sensitivity to measurement noise.

Multiple Real Dominant Pole Controller Design
The multiple real dominant pole (MRDP) controllers rely on the DIPDT model of the magnetic levitation plant F(s) with parameters identified in [10], by means of step responses, as F(s) = K m s 2 e −T m s ; K m = 7000; T m = 0.002 s (16)

PD Controller Design by the Triple Real Dominant Pole Method
The considered control structure is shown in Figure 5. In this case, the stabilizing PD controller will be combined with a second order low-pass filter Then C(s) = C 0 (s)Q 2 (s) In the controller tuning, its two time constants T f will be considered by the modified half-rule method [33,42], as an amendment to the total dead-time by an equivalent filter dead-time T e T d = T m + T e ; Thus, it can be omitted from further derivations. The control structure segments with the transfer functions C 1 (s), C 2 (s), and C 3 (s) will be omitted by choosing C 1 (s) = 1 and C 2 (s) = C 3 (s) = 0.
The PD control combined with a DIPDT plant yields a closed loop transfer function As shown, e.g., in [31,32], for the characteristic polynomial a triple-real-dominant-pole (TRDP) s o corresponds to a tuning, satisfying conditions: follows the TRDP as where appropriate, the triple closed-loop time constant can be used to characterize the speed of the responses. The corresponding optimal PD controller tuning can then be specified by the gains To compensate the dominant input disturbance caused by the gravitation force, and leading to a significant steady-state error, a simple static feedforward can be used based on the inverse IOSSCH, given as u f f = f −1 (r), where y ss = f (u ss ) is IOSSCH. In the simplest case, it may be approximated by the slope K 1 and the offset K 2 . These values can be found after approximating IOSSCH by straight-line dependence and determining its slope (K 1 ) and y-intercept (K 2 ).
Another alternative is to use static feedforward via inversion of the measured IOSSCH approximated by a lookup table in MATLAB/Simulink. In such a case, in the control structure in Figure 5, the block K 2 is omitted and the block K 1 replaced by the inverse IOSSCH (see Figure 6). The corresponding step responses in Figures 7 and 8 show much faster responses than with the first method. The steady-state control error can be eliminated by a more accurate inverse IOSSCH approximation for lower reference signal values, extended possibly by gain-scheduling, modifying the K m value, depending on the reference setpoint r. However, when the circuit properties change (e.g., by increased coil temperature), the used control structure is not able to change its properties, and a permanent error may reappear again.

IMC Control of the Stabilized Plant
Based on the plant stabilized by the above PD controller, several approaches can be proposed. From the real dominant pole and the time constant (25) and (26), it is possible to get a stabilized closed-loop approximation which may then be used by the IMC control structure in Figure 5 with C 3 (s) = 1, with the plant model and the controller C 1 (s) = (1 + T o s) 3 (1 + T c s) 3 ; C 2 (s) = S so (s) = represents a filtered inversion of S so (s) with the required closed-loop time constant T c . Since the transfer function (28) represents just an approximation of the loop stabilized with the PD controller, in order to get reliable results, it is necessary to choose For the model parameters (16) T o = T m /(2 − √ 2) = 0.0034 s, and the choice T c = 0.1 s, the resulting transients in Figure 9 guarantee zero permanent control error, but with regard to the requirement (30), they are significantly slower than when using just a stabilizing PD controller. The method could also be modified in such a way that the design of the IMC structure would be based on the transfer functions of the stabilized circuit identified experimentally, e.g., by using some step-response-based method.

Direct PID Controller Design
Approximation of the plant dynamics by the DIPDT model (15) with the parameters (16) can also be used for a direct PID controller design, yielding To get a feasible transfer function with a satisfactory noise attenuation, it has to be combined with a second order filter To avoid output overshooting in step responses, the controller should be extended by a pre-filter (see Figure 10) To achieve uniform starting points of comparison, we again implement the design of optimal parameters using the multiple real dominant pole method. Following [33], to get a four-tuple real dominant closed loop pole s o (time constant T o ) the controller parameters should be chosen as The filter dynamics can again be considered by an equivalent delay (20). The PID controller proportional gain K C is now significantly higher than K p0 of PD controller (27), which, together with increased derivative gain K D = K C * T D = 0.505/(K s T d ), lead to increased sensitivity to the measurement noise and plant model imperfections of the transients in Figure 11.
Compared to the dominant closed-loop time constant To = 1.707T d of the circuit with PD controller, the dominant time constant T o = 2.404 is now 1.41 times larger and also due to the increased order of the dominant pole the transients will be significantly slower. Thus, also in this situation, the comparison with a simple stabilizing PD controller shows that it might be interesting to examine its use in combination with some alternative permanent control error elimination, allowing achievement of faster transients, which was not possible when using existing hardware. Figure 11. Transients corresponding to the PID controller, according to Figure 10 with a direct PID design based on the DIPDT model (15) with the parameters (16), and the equivalent dead-time (20) modified to get a better approximation for lower setpoint values.
Simulation verifications show that, in order to achieve improved performance with this design method, the sampling period should be significantly reduced.

Conclusions
This paper illustrated two different approaches to the control of the magnetic levitation plant based on different linear plant models.
The first one, based on the transfer function of the underdamped second order model, shows a method that is very easy for use. Connection of controllers C 1 (s) and C 2 (s) to one block would result to the weighted PID controller. The output of the presented design procedure is the resulting controller structure, controller parameters (K C , T I , T D ) as weights of signals. The use of a more complex filter and the use of a PID controller instead of a PI controller in the direct branch of the scheme could lead to faster transient responses. Thereby, the position sensor properties (response time ≈ 1 V/1 ms) would act as limiting factors of the control structure. Under control with integral action, elimination of these limitations would only be possible by increasing the flow of information from the process by using a shorter sampling period, which was not experimentally possible with the existing hardware.
Similar results have been achieved by considering two alternative controllers with integral action based on the DIPDT model, identified in [10]. Otherwise, the speed of transients can only be increased by simpler PD control without I-action, at the cost of a possible permanent steady-state error. Such a conclusion raises the question as to whether the elimination of the permanent control error cannot be achieved in combination with a stabilizing PD controller, and some other method that would not lead to such a significant slowdown of processes. Funding: This research was funded by the following grants-APVV SK-IL-RD-18-0008 platoon modeling and control for mixed autonomous and conventional vehicles: a laboratory experimental analysis, VEGA 1/0745/19 control and modeling of mechatronic systems in e-mobility, and KEGA 030STU-4/2021 building of mechatronic laboratory using smart technologies.
Institutional Review Board Statement: Not applicable.