PID controller enhanced with artificial bee colony algorithm for active magnetic bearing

To reduce the effect of non-linearity in air gap control in active magnetic bearings (AMB). The PID controller for the AMB is proposed in this study, which is optimized with a reformative artificial bee colony (RABC) algorithm. The RABC algorithm balances the exploitation and exploration capabilities of the ABC algorithm by introducing globally optimal solutions and improved food source probabilities. Simulation with six benchmark functions validates the proposed algorithm, and the results reveal that the RABC algorithm has higher search accuracy and faster search speed than previous ABC algorithm versions. The experimental results show that RABC-PID outperforms the other four approaches and has greater robustness when compared to traditional PID, PSO-PID, DE-PID, and GA-PID. Meanwhile, the RABC-PID controller makes the AMB system more stable.


Introduction
The active magnetic bearings (AMB) were widely used in new motors because of their characteristics. The AMB rotor was suspended in space by electromagnetic force, thus eliminating mechanical contact between the rotor and stator (Genta 2005;Molina et al., 2021). From the analysis, it can be obtained that the suspended rotor was an unstable nonlinear system in the open-loop state (Wang et al., 2020). Therefore, in traditional maglev controller design, the system is usually linearized around the equilibrium position. However, when the suspension air gap changes, e.g. when the suspension air gap increases, the traditional local linearization was no longer applicable, and therefore the design of the controller can be difficult (Lum et al., 1996).
For the design of AMB controllers, Sahinkaya implemented a robust controller for AMB systems in a computationally inexpensive manner without compromising the robust performance . Yang introduced a new scheme with a tandem winding topology providing good performance and high reliability for the design of AMB controllers (Yang et al., 2021). Molina proposed a nonlinear controller to achieve accurate 3D trajectory tracking of the rotor AMB (Molina et al., 2021). Sahinkaya et al. designed the controller for the AMB system by determining the bounds of dynamic response to reduce the computational cost of CONTACT He Wang wanghe@ustl.edu.cn the controller . Saha minimized the temporal energy consumption of the input by applying a relatively new optimal control method, the pseudospectral method (PSM). Since AMB was a nonlinear system, the implementation of the classical optimal control strategy becomes challenging. Therefore, PSM first transforms the optimal control problem for non-uniform nodes into a nonlinear programming problem ). Ren proposed an active levitation control system consisting of an AMB rotor and a fuzzy logic controller (FLC) based on the interval type 2 (IT2) model. The controller was designed to compensate for system uncertainty through the proper design of the IT2 membership function, resulting in fast and stable suspension (Ren et al., 2020). Cao proposed a new controller design procedure for AMB systems that is based on sliding mode control (SMC) and neural network (NN) control. The stability of the AMB system needs further improvement (Cao et al., 2019). In the field of industrial control, PID controllers were very widely used. The PID controller has the advantages of a simple algorithm, high reliability, and better robustness, which can further improve the stability of system. Therefore, the PID controller was used for the AMB system controller in this paper. However, for some systems with nonlinearities, the traditional PID tuning method was difficult to meet the requirements of high precision control. Today, general methods to optimize PID parameters include sliding mode control, swarm intelligence (SI) methods, improved PID structures, etc. Sliding mode control has the advantage of being robust and does not require an accurate control object model, which was suitable for AMB control (Vischer et al. 1993;Noshadi et al., 2015;Incremona et al., 2016). However, conventional sliding mode control suffers from the problem of high-frequency jitter near the stabilization point, which may excite unmodeled highfrequency components in the system, thus reducing the stability of the AMB and weakening its ability to resist dynamic load perturbations (Henzel et al. 2011;Wajnert et al. 2009). Levant proposed a higher-order sliding mode theory to reduce the dithering problem of conventional sliding mode control (Levant et al. 2014). Saha proposed an adaptive integral third-order sliding mode control (AITOSMC). The controller suppresses the bias in the rotor and rejects the systematic uncertainty and unknown disturbances present in the five-degree-of-freedom AMB system ). There are many methods for SI algorithms to optimize the controller parameters of AMB systems; genetic algorithms (GA) (Sahinkaya et al. 2018;Yadav et al., 2021), particle swarm optimization (PSO) (Gupta et al., 2020;Humaidi et al., 2020), and others had been developed one after another. Shata et al. presented an AMB system design based on fractional order PID (FOPID) controller to enhance the dynamics and stability of the system (Shata et al., 2018). Improving the PID structure is too tedious. The exploitation capability and exploration capability of intelligent algorithms in parameter optimization of PID controllers need further improvement.
The ABC algorithm is a SI optimization algorithm, proposed by Karaboga, to simulate the process of honey bee foraging (Hussain et al., 2020). The algorithm is easy to implement control with few parameters and has good optimization performance. Therefore, the contributions of this paper are as follows: (1) The RABC algorithm is proposed to improve the exploitation capability and exploration capability of the ABC algorithm.
(2) The PID controller based on the RABC algorithm (RABC-PID) is proposed to apply to the AMB system and verify the effectiveness of the RABC-PID.
The rest of the paper is organized as follows. Section 2 presents the AMB system model. Section 3 introduces the basic steps of the ABC algorithm and the optimization search process, the RABC algorithm, and the superiority of the RABC algorithm verified by six standard test functions. The principle of the RABC to optimize the parameters of the AMB PID controller and the whole optimization process are presented. Experimental simulations are performed in Section 4 to verify the superiority of the RABC algorithm by comparing it with the other four methods. The RABC algorithm-optimized PID controller further improves the stability of the AMB system. Section 5 concludes the whole paper.

Active magnetic bearing system model (AMB)
In this paper, the existing AMB platform in the laboratory is selected, which is a multi-degree-of-freedom system consisting of axial bearings and radial bearings (Jarroux et al., 2021). There is one degree of freedom in the axial direction, and the single degree of freedom solenoid suspension in the axial direction is the basis of the AMB, so this paper mainly considers the axial system as shown in Figure 1. The axial system of this AMB is composed of a solenoid consisting of a coil, a rotor connected to a thrust disc, etc. The entire bearing is placed vertically, and when the rotor thrust disk is suspended, the suction of the electromagnetic force interacts with the gravity of the rotor system. At this time, the signal from the sensor is processed by the controller and then powered to the electromagnet after the chopper circuit, which causes the electromagnet to generate suction.
In Figure 1, G is the gravitational force of the rotor system, F is the electromagnetic force of the system, F d is some disturbance force present in the system, z 0 is the axial air gap width, and z 1 is the thrust disc displacement offset. The suction force of a single electromagnet can be given as Equation (1).
Its kinematic equation can be expressed as Equation (2). In the equilibrium position F = G = mg where μ 0 is the magnetic permeability in the air; i 0 is the current at stable operation; i 1 is the control current of the system; N is the number of turns of the electromagnet coil; S is the magnetic pole area; B is the magnetic field strength of the electromagnet; m is the rotor mass; g the acceleration of gravity. From the above equations, the mathematical model of the electromagnet levitation system is formed, and after linearizing it at the equilibrium point position, the linearized equation expression equation of the system can be given as where k z is the displacement stiffness factor, which can be given as Equation (3) where k i is the current stiffness factor, which can be given as Equation (4) From this, the transfer function of the system can be given as Equation (5) It can be obtained that the system is unstable, and to make the system stable, a closed-loop controller must be added, and the PID controller usually used in suspension systems is used in this paper.

Artificial bee colony algorithm
The optimization search process of the algorithm can be as follows: Step 1: The ABC algorithm is divided into three search phases, namely: the employed bee phase, the following bee phase, and the scouting bee phase.
The initial phase is the initial solution space through Equation (6).
where i = 1, . . . ,SN, j = 1, . . . ,D.SN denotes the population size, D denotes the problem dimension, rand (0, 1) is a random number between 0 and 1, and X j max and X j min denote the upper and lower bounds of the jth dimension of an individual, respectively.
Step 2: The employed bee generates a candidate solution by Equation (7).
where k ∈(1, . . . . , SN) is a randomly selected indicator for different i, which means that there is only one randomly selected solution in generating the new candidate solution; j ∈ (1, ... , D) is a randomly selected indicator, which means that only one dimension has changed between the new candidate solution and the old one. ϕ j i is a random number uniformly distributed on [−1, 1].
For the candidate solution V generated by the employed bee and the original solution X, the greedy selection criterion is used for merit-based updating, which can be given as the probability formula as follows.
where fit i denotes the adaptation value of the ith food source.
Step 3: Individual followers choose to follow the corresponding hired bee according to the probability selection formula and mine around it again.
Step 5: If the honey bee does not find a better food source after a limited number of Limit, the food source is reselected by Equation (6).
Step 6: If the end condition is satisfied, the final required optimization parameters are obtained, and if not, they enter step (2). One of the steps (6) is mainly to improve the index of the algorithm population diversity, this operation can make the probability of the population search for the optimal value to be improved.

Optimization of the artificial bee colony algorithm
The ABC algorithm suffers from under-utilization of solutions in the search phrase, slow convergence speed, and easy to fall into local optimal solutions. Because of its random search characteristic, the ABC algorithm has a better exploration ability but a lesser exploitation capacity. A reformative artificial bee colony algorithm (RABC) is proposed in this study. For the problem of the poor exploitation ability of ABC algorithm, an ideal solution idea is suggested. When updating the location of the food source, the algorithm determines the global optimal bee location and its food source location. The bees are allowed to refer to the global bee with the best food source and move to the food source with better quality when the colony is updated, and the global optimal is updated as the colony is constantly updated, allowing the bees to use the optimal food source as a reference when acquiring food source information and improving the exploitation capability of algorithm to some extent. Equation (7) for the employed bee searching food sources is changed to the following equation: where X j i,best is the global current optimal food source. When some of the better food sources and the optimal food sources are close in quality, it will lead to a lower probability of following bees to follow the food source with the best quality. For some poor quality food sources, due to the random selectivity of the following bees, they have the opportunity to follow instead, leading to a slowdown in finding the best quality food source, which then shows a slow convergence in the algorithm. Because of this, this paper proposes to use the current optimal food source for the colony as a reference to make the following bees more inclined to choose a high-quality food source and improve the speed of finding the optimal food source for the colony. Thus the probability P i that the following bee follows the nectar collecting bee changes from Equations (8) to (10).
where fit max is the fitness value of the optimal solution. Both employed and following bees use Equation (9) to update the food source so that a portion of the information of bee is exchanged with the globally optimal bee, ensuring that the bee is not disturbed by the locally optimal bee but also that the bee follows the globally optimal bee to a better food source. Following bees were more likely to follow hired bees that had better quality food sources and consequently exploited high-quality food sources when using Equation (10) to determine the quality of food sources.

Function simulation verification
To test the effectiveness of the RABC algorithm, the same ABC, GABC (Zhu et al. 2010), GBABC (Zhou et al., 2016), and IABC (Qin et al., 2021) algorithms are tested for comparison experiments on six benchmark functions. The basic characteristics of the benchmark functions are given in Table 1. The dimension D of the test function is set to 50, the number of populations SN is set to 100, the limit Limit is set to 50, the maximum number of cycles MaxCycle is set to 5000, and the number of algorithm runs is 30. The experimental results are as follows.
The experimental results for the six benchmark functions, including the mean and standard deviation, are given in Table 2. Comparing the standard deviations of the five algorithms in Table 2, it is found that the RABC algorithm is the smallest for all of them. This shows that the stability of the RABC algorithm is the best among the five methods. Comparing the average values of the five methods in Table 2, it is found that the RABC algorithm is the closest to the optimal value for all of them. This illustrates that the RABC algorithm has the highest search accuracy. Figure 2 depicts the benchmark function convergence graph. The RABC method surpasses the basic artificial bee colony algorithm and the other three modified artificial bee colony algorithms in terms of convergence speed and search accuracy, as seen in the graph. The results of the experiments show that RABC performs better in terms of optimization. In conclusion, the RABC algorithm's usefulness is proved.

PID controller based on RABC algorithm (RABC-PID)
The RABC algorithm is used to optimize the PID parameters, which is essentially a parameter optimization problem with a specific objective function, i.e. finding the ideal values in the parameter space of the K p , K i , and K d variables to improve the system's control performance. Figure 3 depicts the control block diagram of AMB system.
The RABC algorithm optimizes the PID parameters by using the system error as the evaluation function of RABC algorithm, i.e. the fitness function input, calculating the value of the fitness function, and then adjusting the three PID parameters based on the fitness of the function to optimize the control performance of system. PID parameter optimization is the search for an optimal set of PID parameters to give the system dynamic performance such as fast response, small overshoot, and short regulation time, so a performance index is needed to measure the performance of the system. For a PID control system, there are four main criteria for comprehensive performance evaluation: integral of squared error (ISE), integral of time-weighted squared error (ITSE), integral of absolute error (IAE), integrated time absolute error (ITAE) (Zhang et al., 2014).
The Integrated time absolute error (ITAE), which combines the speed, stability, and accuracy of the system, is widely used as a comprehensive performance indicator for optimizing PID controllers for AMB systems. ITAE can be given as To prevent the control from being too large, the weighted integrated time absolute error (WITAE) is proposed. The ITAE performance index is used as the minimum adaptation function for parameter selection, and the squared term of the control input is added to the objective function [28]. WITAE can be given as where J 1 , J 2 are the weights and WITAE is the adaptation value. Once the overshoot is generated and the penalty function is applied, the integral of absolute error (IAE)is added to Equation (12). WITAE can be given as where J 3 is the weight value, J 3 J 1 . Usually, J 1 = 0.999, J 2 = 0.001, and J 3 = 100.
The fitness function is given as where the higher the value of fit i is, the higher the probability that the food source will be selected for search. The RABC algorithm to optimize the PID controller parameters flow is shown below Step1: Determine the range of values of K p , K i , and K d , the initial population size of the swarm algorithm, and the number of iterations.
Step2: In the search space, the locations of N nectar sources are randomly generated.
Step3: The employed bees search for new nectar sources in the vicinity of the nectar source according to Equation (9), and select the old and new sources according to the greed principle.
Step4: The adaptation degree fit i of each nectar source is calculated according to Equation (14), and the following bees are selected to follow the employed bees according to Equation (10).
Step5: Followers continue to search around the nectar source, calculate the fitness of the new nectar source and compare it with the source, if the fitness of the new source is good, then exploit the new source; otherwise, continue to exploit the source.
Step6: Determine whether the exploitation degree of the same nectar source is greater than the Limit, if it is, then the hired bees are transformed into scout bees and generate new nectar sources in the search space according to Equation (6). otherwise, continue to recruit the following bees to exploit the original nectar sources.
Step7: Record the current S 1 , S 2, and S 3 , which represent the three PID parameters respectively.
Step8: Determine whether the loop reaches the maximum number of iterations, if so, output the current S 1 , S 2 , S 3 as PID controller; otherwise, return to Step4 to continue execution.

Performance indicators of the control system
In control systems, the unit step response of the system is generally used to define the indicators of the transient performance of the system, usually four, rise time t r , peak time t p , spend time t s , and overshoot σ %.

Simulation verification
The RABC has better optimization performance by RABC algorithm balancing the exploitation capability and exploration capability of the basic ABC algorithm. In this paper, four intelligent algorithms and the traditional Z-N method are used to optimize the PID parameters of the AMB system controller. It is verified by simulation in Matlab. k i = 8, m = 0.25, k z = 5. The transfer function of the AMB system can be given as the following equation.
The RABC algorithm is compared against three intelligence algorithms: PSO, DE, GA, and the traditional Z-N approach, to evaluate its optimization performance. The appropriate configuration parameters of each method are determined after simulated verification in Matlab. Each algorithm's parameters were set as follows: c 1 = c 2 = 2, initial value of w is 0.9, w max = 0.9, w min = 0.4, v max = 1, v min = −1, population size SN = 50, and 50 iterations are used in the PSO method. P c = 0.7 for algorithm crossover, P m = 0.3 for variance, SN = 50 for population size, and 50 iterations. The population size SN of the RABC method is 50, the number of limitations is 50, and the number of iterations is 50. The parameters of the PID controller for the AMB system optimized by the traditional Z-N method are K p = −1.5658, K i = −1.6789, and K d = −0.2987.  The experimental results are as follows. The unit step response curve in Figure 4 shows that the RABC algorithm has no overshoot, and the rise time, spend time, and peak time of the RABC algorithm is the shortest compared to the other three intelligent methods and the traditional Z-N method. The other kinds of intelligent algorithms and the traditional Z-N method have a large overshoot, and the rise time, spend time, and the peak time is relatively long. This indicates that the RABC algorithm works best to optimize the PID controller parameters. From the unit step response convergence curve in Figure 4, it can be seen that the RABC algorithm converges fastest and has the highest convergence accuracy in the AMB system. This also proves that the RABC algorithm works best to optimize the PID controller parameters.
From Table 3, it is clear that the adaptation values obtained by the RABC algorithm in optimizing the PID controller parameters are smaller than those obtained by the other four optimization algorithms. This also fully  illustrates that the RABC algorithm is more accurate than the other four optimization algorithms.
From Table 4, it is clear that the PID controller of the AMB system optimized by the RABC algorithm has a fast response, no overshoot, short spend time, and can enter the steady-state zone quickly, reflecting a better control effect. In summary, the PID controller optimized by the RABC algorithm has a better control effect. Figure 5 shows the bode diagram without any controller. From Figure 5, it can be seen that the bode diagram from the AMB system does not cross 0 in the phasefrequency before the amplitude-frequency reaches its  peak, and the phase frequency crosses 0 when the corresponding phase margin is negative, so the system is unstable. Figures 6-10 show the bode diagrams for adding traditional PID, RABC-PID, PSO-PID, GA-PID, and DE-PID controllers, respectively. From Figures 6-10, it can be seen that the AMB system is converted to a stable system after adding the PID controller. Comparing the five Figures, when the phase frequency crosses 135°comparing the five graphs shows that the amplitude margin of the PID controller system optimized by the intelligent algorithm is significantly larger than that of the PID controller system optimized by the traditional Z-N method, which indicates that the PID parameters optimized by the  group intelligent algorithm are better than those optimized by the traditional Z-N method. Comparing the four intelligent algorithm plots when the phase frequency crosses 135°shows that the amplitude margin of the system with the RABC-PID controller is significantly larger than that of the system with the other three controllers. This fully illustrates that the stability of the magnetic bearing system with the RABC-PID controller is significantly better than that of the AMB system with the other three controllers. Table 5 shows the magnitude margin values corresponding to the five methods. In engineering control practice, it is generally hoped that the amplitude margin value is greater than 6. From Table 5, we can see that the traditional Z-N method cannot meet the requirements, and the other four intelligent algorithms can meet the requirements. Table 5 shows that the magnitude margin of the RABC-PID controller system is significantly larger than that of the plus four other controller systems. Specifically, the magnitude margins of the RABC-PID controller system are 92.25%, 57.72%, 57.57%, and 55.21% larger than those of the traditional PID, PSO-PID, GA-PID, and DE-PID controller systems, respectively. This fully illustrates that the stability of the AMB system with the RABC-PID controller is significantly better than that of the AMB system with the other four controllers.

Conclusion
In this paper, the RABC algorithm is applied to the optimization of PID controller parameters for AMB, and the new control algorithm is tested by simulation. The final experimental results prove that the PID controller with the RABC optimization algorithm has a significant reduction in rising time, peak time, spend time, and overshoot, and is optimized for accuracy and convergence compared with the traditional Z-N, POS, DE, and GA algorithms. Meanwhile, the AMB system applies the RABC-PID controller to enhance the stability of the system.

Data availability statement
Data sharing is not applicable to this article as no new data were created or analysed in this study.

Disclosure statement
No potential conflict of interest was reported by the author(s).