Fractional PI λ D Controller Design for a Magnetic Levitation System

: Currently, there are no formalized methods for tuning non-integer order controllers. This is due to the fact that implementing these systems requires using an approximation of the non-integer order terms. The Oustaloup approximation method of the s α fractional derivative is intuitive and widely adopted in the design of fractional-order PI λ D controllers. It requires special considerations for real-time implementations as it is prone to numerical instability. In this paper, for design and tuning of fractional regulators, we propose two methods.The ﬁrst method relies on Nyquist stability criterion and stability margins. We base the second on parametric optimization via Simulated Annealing of multiple performance indicators. We illustrate our methods with a case study of the PI λ D controller for the Magnetic Levitation System. We illustrate our methods’ efﬁciency with both simulations and experimental veriﬁcation in both nominal and disturbed operation.


Introduction
The magnetic levitation system is a highly relevant area of control design. It is because these systems have many varied uses such as in minimal friction bearings, high-speed maglev passenger trains, levitation of wind tunnel models, vibration isolation of sensitive machinery, levitation of molten metal in induction furnaces, and the levitation of metal slabs during manufacture, see [1]. Research on this topic has led to the development of efficient magnetic bearings (see [2]) and flywheels for space satellite low earth orbits, hybrid electric vehicles (see [3]), and many stationary applications. An important direction of research in this area is also an active magnetic bearing, which was described in their works by among others-Srinivas (see [4]), Uzhegov (see [5]), and Kandil (see [6]).
A very important area of the research about the active magnetic levitation system is control structure. They are naturally unstable, so they require control. Many researchers considered this topic (see [1]) and Joo and Seo (see [7]) designed linearizing feedback control for the magnetic levitation system to PID controllers. The comparison of this approach with Takagi-Sugeno fuzzy control (see [8]). Baranowski and Piątek (see [9]) presented a cascade variant of the linearizing feedback. Bloch (see [10]) discussed real-time neural feed-forward control. Piątek (see [11]) designed and implemented quick linear control for active magnetic levitation systems based on FPGA circuits.
Research on the control of magnetic levitation using non-integer (fractional) systems was one of the first attempts by Piłat (see [12], where a non-integer order PD controller was considered. Tepljakov et al. (see [13,14]) described the problem of fractional-order PID controller design for a model of a magnetic levitation system. The latest research focuses on the digital implementation of non-integer controller for a real plant; this topic was considered by Chopade et al. [15], Rojas et al. [16] and Ananthababu et al. [17]. Pandey et al. (see [18,19]) proposed an anti-windup fractional PID controller for magnetic levitation. Roy et al. (see [20]) presented a comparative study between the Sliding Mode Controller and Fractional Order Sliding Mode Controller when applied to a magnetic levitation system. Swain et al. (see [21]) presented real-time implementation of fractional order PID controllers for a magnetic levitation.
Most of these results that are simulated based or experimental are hard to replicate or use not precisely for fractional approximations, which makes the fractional part debatable.
Contributions of this paper are: • we propose two different methods of controller parameter selection for the active magnetic levitation system, • and we provide experimental verification of both design methods.
This paper is organized as follows. Section 2 presents a brief introduction to the mathematical model of the magnetic levitation laboratory system. In the next section, the authors present a non-integer PID controller and proposed two methods of tuning these parameters. In Section 4, the authors show an example of using a proposed method for construction of a PI λ D controller for the laboratory magnetic levitation system. The next section describes the implementation of the controller in real-time systems. The results of the experiments are described in Section 6.

The Mathematical Model of the Magnetic Levitation Laboratory System
The magnetic levitation system (see Figure 1) consists of the electromagnet, the ferromagnetic sphere (which we will be calling "ball"), the current driver, and the position measurement system consisting of the light source and the light sensor.  [22]. The light sensor measures the degree under which the light source is covered. The electromagnet is driven by a current driver.
The mathematical description of the system will be based on Newton's second law, where x 1 (t) is the ball position, measured as the distance from the electromagnet, x 3 (t) is the electromagnet coil current, and x 2 (t) is the ball velocity. Ball speed can by calculated from value of force generated by the electromagnet, m is the mass of the ball, and g is the gravitational acceleration. The velocity of ball is given by formula (see [1,23]):ẋ where a and b are positive constants. Parameters a and b were determined by analysis of a series of steady state points of the system with a closed stabilizing feedback loop. The exponential function was fitted into these points through a least squares minimization. For details, see [23]. The coil current in the system usually is influenced by many factors like changes in inductance, velocity, and others. However, our system includes a current driver, which has its own feedback loop. This solution is very popular (see [24]) because it leads to either lower order or simpler model structure.
In an optimal situation, the driver should allow full current control; however, in real situations, it introduces its own dynamics. For the system considered, these dynamics can be sufficiently modeled by a first order dynamical system given by the following equation: where u(t) is the control voltage, k s is the gain of current controller, T s is the time constant of the current driver, and i s is the zero error of current driver. Let us introduce state space vector x given by which can be used to formulate the model of the system as the following system of first order differential equations: All variables and parameters used in the model are described in Table 1. We use exponential approximation for the electromagnetic strength formula. A detailed discussion of such choice can be found in [25]. Table 1. Variables used in the mathematical description of a laboratory magnetic levitation system.

Variable Name
Descritpion Value It is a known fact that the linear controller can operate properly in the neighborhood of a chosen steady state. Performance of classical PID can be strongly improved, if the appropriate reference control value corresponding to a reference value is added to the generated control signal. The authors tested this solution with different types of non-integer PID controllers, see [26][27][28]. The constant value added to the control signal we can calculate by formula: and x 1r is the desired position of the ball. The control loop of the described system was presented in Figure 2.

Method of Tuning of a Non-Integer Order PID Controller
One of the major tasks in the implementation's field of the fractional PID controller is the formulation rules of tuning them. In this section, first we describe the concept of the PID controller with a fractional integrator, and then we propose two approaches of tuning it. The first one relies on introducing a fractional integral to a stabilizing PD controller and studying stability margins via the Nyquist criterion. The second one uses simulated annealing and multiple performance indicators. Both approaches are support methods requiring appropriate selection by the user.

Non-Integer PI λ D Controller
Podlubny (see [29]) proposed a generalization of the PID controller, namely the PI λ D µ controller, involving an integrator of order λ and a differentiator of order µ. As can be observed, when λ = 1 and µ = 1, we obtain a classical PID controller, similar to when λ = 0 and µ = 1 give PD, λ = 0 and µ = 0 give P, λ = 1 and µ = 0 give PI. All these classical types of PID are the particular cases of the fractional PI λ D µ . However, the PI λ D µ is more flexible.
For laboratory active magnetic levitation systems, we used controllers by structured PI λ D. In the time domain, the equation for this controller's output has the form: where C 0 D −λ t is the Caputo derivative of order −λ with respect to time, which is equivalent to the fractional integral of order λ, and: In addition, the transfer function formula is given by the equation:

Analytic Tuning Method with Nyquist Stability Criterion
This section describes the analytically procedure for determining the settings of the PI λ D µ . They base the developed procedure on the Nyquist characteristic. The procedure of determining the PI λ D µ controller settings can be performed by the following steps: 1. Determine the system work point. 2. If the system is nonlinear, calculate the linearized system of the work point. 3. Determine the stability region for the integer part of the controller. For example, if you want to create a controller PID µ , you must calculate the stability region of a PI controller. 4. Use a Nyquist criterion to determine the order of a non-integer order part of the regulator and this gain for a reasonable stability margin.
The advantage of this method is that we have an analytical description of the properties of the system-on the basis of which we can easily determine the stability area, gain, and phase margin. The most important disadvantage of this approach is that, for more complex systems, it can be difficult or not applicable.

Tuning by Simulated Annealing
Simulated annealing is a probabilistic technique for approximating the global optimum of a function. This algorithm uses a meta-heuristic to approximate global optimization in a large search space for an optimization problem-for problems where finding an approximate global optimum is more important than finding a precise local optimum in a fixed amount of time.
The advantage of this method is the ability to define any quality index for optimization, and there is no need to analytically determine the properties of the system. This method also allows the design of the regulator to bend known control characteristics. The disadvantage is the time needed to perform the optimization.

Construction PI λ D for Magnetic Levitation Systems Using the Analytic Method
To perform the calculations and simulations, the following assumptions have been made: Regulator must work for frequency bound between 10 −4 and 10 3 Hz.

•
Order of approximation use for implemented non-integer elements must have value 5.
Based on assumptions, we can determine the work point of the system as: In the next step, we calculate the transfer function of the linearized system in the work point: where v, n have the form: Then, we designed a classical PD controller which will stabilize the system. The stability region can by described by equation: Finally, a stability analysis based on the Nyquist criterion was performed. The Nyquist plot of the designed ideal (non-approximated) non-integer controller is presented in Figure 3 with a dashed line. Fractional controller parameters for these systems have value: K p = 100, K i = 5, λ = 0.75 and K d = 4. As we can see, these parameters fully meet the assumptions. Nyquist characteristics for a magnetic levitation system with the PI λ D controller. The controller parameters are K p = 100, K i = 5, λ = 0.75 and K d = 4. The analytical characteristics are marked by the black dashed line. The blue line represents the characteristic with the controller approximated by the Oustaloup's method with parameters: order 5 and frequency bound between 10 −4 and 10 3 . The cut-off frequency is marked in red on the chart for which the difference between the analytical system and its approximation can be observed.

Tuning of PI λ D Using Simulated Annealing
In this case, we can define the decision variables as: K p , K i , K d , λ. The tests will be conducted for the following quality indicator: 1. ISE: where e(t) = w r − x 1 (t). We use all of these qualities' indicators because have different properties. ISE is one of the most used quality indicators. Since it is simple to use, it provides good results and in many cases can be calculated analytically. Its disadvantage is that it favors large errors, which means that, in the tuning process of the controller, errors at the beginning of the control process will have a greater impact on this process.
The ITSE quality indicator eliminates the problem of large fluctuations at the ends of the optimization horizon by multiplying the square of the control error by time. It is possible because the big value of errors at the beginning of the control process is leveled by multiplication by the small value of time; the same thing happens at the ending phase of the control process when the small value of errors are multiplied by the big value of time. This eliminates a significant influence of the error from the initial control phase on the value of the quality indicator.
ISEDES takes into account the rate of change of the error value, which allows for taking into account the dynamics in the optimization process. However, it has the same problems as quality indicator number 1.
IAE is presented, which treats all error values in the same way. However, its major disadvantage is that it can only be used in simulation environments because the analytical form of its solution does not exist. For more details, see [26,27,30,31].
Optimization start points have the following values: Simulation initial value: • x 1 = 9 mm-since the system is inherently unstable, the starting point must be around the setpoint. • x 2 = 0 m/s-the sphere has no initial velocity. • x 3 = 0.1008-value determined by Formula (6).
The optimal PI λ D settings for the system are collected in Table 2. Position states of the magnetic levitation were shown in Figure 4. When analyzing the charts, we see that in all cases the system stabilizes around the set value in less than 0.1 s. In all cases, you can see that there is a slight fix error. In the case of quality indicators 1 and 2, there is also a noticeable overshoot in the initial phase of the control process of magnetic levitation.
It is also visible in the values of the quality indicators collected in Table 2. Note that, for the quality indicators 1 and 3, the values of the Kp, λ, and K d parameters are similar. The highest values were also obtained for the indicators defined in this way. On the other hand, for the indicators defined with Formulas (2) and (4), the values of the λ and K d parameters are similar. Additionally, it should be mentioned that the value of λ is similar in all cases.
How can we see that the best result has been achieved when the quality indicator has form IAE? It should be noted that all quality indexes values are very close to each other. For this reason, the controller settings for the test in to laboratory system were selected values from IAE. Table 2. Result of tuning system using simulated annealing. The values of the λ parameter are similar in all cases. The ITSE indicator sets the highest gain for proportional and integral parts of the regulator. In contrast, the IAE indicator sets much lower gains on these parts, but similar gains on the derivatives. It does not change the fact that the quality indicators assume values from a similar range. The ISE and ISEDES indicators set a similar gain of proportional and derivative parts. On the other hand, ISEDES is a weaker integrator gain and therefore gives the worst final value of the quality indicator. (a) ISE:   (c) ISEDES:  Result of the tuning system using simulated annealing for differing quality indicators. As can be seen in the case of Figure 4a,c, the controller allows the system to slightly overshoot. In these cases, the system also reaches the set point the fastest. In other cases, the system does not have any overshoots and moves slower to the operating point. However, the process is therefore smoother.

Time Domain Oustaloup Approximation
The controller was implemented with the time domain Oustaloup method. This method was based on the classical Oustaloup approximation method, where fractional-order operator G(s) = s α can be approximated by (see [32]): where: The proposed approach is to realize every block of the transfer function (16) in the form of a state space system. Those first order systems will then be collected in a single matrix resulting in full matrix realization. This continuous system of differential equations will then be discretized. The time domain approximation has formulas: This can be written in vector matrix notatioṅ or in briefẋ = Ax + Bu What can be immediately observed is that the matrix A is lower triangular. This is an extremely important in the case of this problem, as all its eigenvalues (poles of transfer function (16) are on its diagonal, so there is no need for eigenvalue products, which would lead to rounding errors. This is why discretization of (21) should have a structure preserving property.
The implementation of the algorithm requires the discretization of the control system designed in a continuous time domain. For preserving the stability attributes of the system in the discrete time domain, as supposed, the Tustin method also known as the bilinear transform for triangular matrix, has been chosen (see [33]). For more details about performance of time domain Oustaloup and realization fractional systems in real-time systems, see [28,[34][35][36][37].

SoftFrac
The SoftFrac package was used to implement the regulators. SoftFrac gives Matlab user functionality to create a state-space system and transfer function fractional model of the non-integer dynamic element s γ based on approximations: Oustaloup (see [32]), time domain Oustaloup (see [38]), and LIRA (see [39]). The state-space fractional model class (ssf) inherits from standard state-space model class (ss) and have all of the functionality of this class, while the transfer function fractional model class (tsf) inherits from a transfer function model.
Because the SoftFrac library uses inheritance mechanism in implementation, the user can use all functionalities of parent classes ssf and tsf. In particular, the user can use this realization for Simulink simulation, system behavior analysis, and easy plotting of dynamic characteristics. In addition, we have added to the classes a construction method for easy conversion between those types, from ssf to tsf and vice versa.

Experiment Results
The controller performances for the magnetic levitation system has been investigated based on results from tuning methods in the following experiments: 1. Introducing the ball into the magnetic field from below, near the working point by hand. Then, we waited for the ball's position to stabilize at the working point. 2. The experiment begins when the sphere is at the working point. It consists of knocking the sphere out of position by means of strokes.
The laboratory magnetic levitation system consists of: electromagnet, ferromagnetic sphere-position sensor, and current sensor power interface. The position measurement is done by the light source and sensor.
We can see in Figure 5 that the distance is measured from electromagnet to ball. The position measurement is based on the amount of light falling on the detector. The composition of the laboratory stand on which the experiments were carried out included: PC, magnetic levitation plant (see [22]), and RT-DAC/PCI process board (see [40]) developed by INTECO. The computer on which the experiments were conducted used the Matlab 2015b version with the MATLAB/RT-CON real-time library installed. This computer used Windows 7 Professional, 64 GB RAM operating memory, and Intel Core I5 3.2 GHz.
RT-DAC/PCI I/O is a multifunction analog and digital I/O board dedicated to real-time data acquisition and control. The board contains a Xilinx FPGA chip. These boards can be reconfigured to introduce a new functionality of all inputs and outputs without any hardware modification. By default, the configuration version board accepts signals from systems and generates PWM outputs, and is equipped with the general purpose digital input/outputs (GPIO), A/D and D/A converters, timers, counters, frequency meters, and chronometers. The boards can be applied: • using one of ready-to-use configurations distributed with the boards, • using a new customer-specified configuration.
In this approach, the n = 5 order of the non-integer order integrator approximation has been selected in the range ω ∈ 10 −4 , 10 3 with sampling time of 0.001 second.
Experiments have been conducted to validate the robust properties of the designed controller. The discrete Oustaloup approximation has been implemented in a real-time environment with the use of a RT-DAC process board and a MATLAB/RT-CON real-time library.

Analytic Method
In Figure 6a, one can find the stabilization position process in point 10mm. As can be seen, PI λ D controller stabilizes the system position in 1.5 s.
The second experiment, presented in Figure 7a, shows the disturbance rejection for the controller. The system has been disrupted at about 2.5 s, 3.7 s, and 5.0 s.

Results of Tuning by Simulated Annealing
In Figure 6b, we see the stabilization position process for a regulator with settings from the tuning process. As can be seen, this controller needs more time to stabilize the system position, about 8 s.
The second experiment, presented in Figure 7a, shows the disturbance rejection for the controller. The system has been disrupted at about 2.5 s, 5 s, and 7 s. It should be noted that the regulators in both cases cancel the disturbance very well. This shows the high level of robustness of the regulators.
As shown in Figure 6, the regulator based on the SA method for the process of reaching the operating point has less overshoot than the regulator based on the analytical parameter selection criterion, while Figure 7 shows that both controls are designed to withstand disturbances in the same range.

Conclusions
Control design for the magnetic levitation system, while known, is still useful as a benchmark for both control quality and implementation purposes. The main issue that is known with fractional controllers is the problem of infinite memory. Direct implementation of fractional integrals (or derivatives) require either the summation of a series of signal samples with increasing length and varying coefficients or computing convolution integrals with singular kernels on expanding intervals. Both approaches are not practical, which is why approximations are required. In this paper, we have shown that implementing fractional controllers in real-time unstable systems is possible through fixed step realization based on time domain matrix representation. We have also studied the methods of tuning such controllers.
Initial attractiveness of optimization based approaches is unfortunately unsubstantiated by results. Minimizing the integral performance indicators can be realized by simulated annealing and, for example, Simulink created nonlinear models. The controllers obtained this way are, however, rather fragile, and problems with low frequency approximations of integrals lead to steady-state errors.
A more attractive approach is to use analytically based methods, such as the one we have proposed. In typical cases of such designs, the open loop system is stable, so one can use Bode plots for easy characterization. In the case of unstable systems like magnetic levitation, it is not possible. Here, we propose a different approach-designing a stabilizing integer order PD controller, and then introducing fractional integrals using a Nyquist criterion to keep stability margins. Such controller will of course have worse dynamics but should be able to compensate for incorrect identification and disturbance issues.
We are aware that our approach is not fully polished; however, it leads to a direct way for adopting fractional controllers by engineers-especially in the issue of robustness. While complicated equations of H ∞ designs might be difficult to adapt, frequency response shaping with fractional elements is much easier to understand.