Design of PID Controller for Magnetic Levitation System using Harris Hawks Optimization

In most real-time industrial systems, optimal controller implementation is very essential to maintain the output based on the reference input. The controller design problem becomes a complex task when the real-time system model becomes greatly non-linear and unstable. The proposed research aims to design the finest PID controller for the unstable Magnetic Levitation System (MLS) using the Harris Hawks Optimization (HHO) algorithm. The MLS is a highly unstable electro-mechanical system and hence the design of the controller is a complex task. The proposed work implements one Degree of Freedom (1DOF) and 2DOF PID for the system. In this work, the essential controller is designed with a two-step process; (i) Initial optimization search to find the P-controller (Kp) gain to stabilize the system and (ii) Tuning the integral (Ki) and derivative (Kd) gains to reduce the deviation between the reference input and MLS output. The performance of the proposed controller is validated with the servo and regulatory operations and the result of this study confirms that the proposed method helps to get better error value and time domain specifications compared to other available methods.


INTRODUCTION
Even though considerable advancements are happened in the controller structures and implementation methodology, the current industrial sector still uses the traditional/modern form of the PI/PID controllers to control the closed loop industrial systems [1][2][3][4]. The main advantage of the PID controller compared to the existing system includes, (i) Simple and reliable structure, (ii) Easy to tune and retune the parameters, (iii) Implementable in hardware/software form, (iv) Adaptability and interoperability and (v) Robustness [5,6].
In the literature, a number of traditional and soft-computing based PID controller design procedures are proposed and implemented by the researches for a class of systems [7,8]. The earlier works on the controller design confirms that the designing the controller for unstable system is very complex compared to the stable processes and the complexity also will increase with increase in the system's complexity [9][10][11][12][13][14][15].
Most of the real systems will exhibit the non-linear and unstable behavior and based on the operating region, it can work as complete or semi-stable system. When the operating region is varied, its stability also will be affected and hence, it is necessary to implement an optimally designed PID to provide essential stability to the system even though the conditions of the system are changing due to uncertainties [16][17][18].
The proposed research work aims to design the 1DOF and 2DOF PID controllers for the chosen system using the Harris Hawks Optimization (HHO) [19]. The HHO is a recently developed nature inspired optimization search based on the hunting behavior of the Harris Hawks and the traditional HHO uses the Lévy flight (LF) strategy to find the finest solution with lesser iterations. Due to its merits, the HHO is widely adopted by the researchers to discover finest solutions for a class of optimization problems [20,21] and this work considered the HHO to identify the finest values of Kp, Ki and Kd for the benchmark Magnetic Levitation System (MLS) [22][23][24].
MLS is an electro-mechanical system, in which an electromagnet is used to position the ferrous material (an iron ball) based on the reference input. In this system, the designed PID controller is permitted to adjust the electromagnetic force to positions the metal ball in a prescribed position. Designing a controller using traditional method is highly tedious and hence, the HHO based methodology is implemented in this system to design the controller. In this work, initially the 1DOF PID is designed with a two-step procedure and then a 2DOF PID is implemented by changing the controller structure of the 1DOF PID.
All the experimental investigations are implemented using MATLAB software and the experimental result of this study confirmed that, even though there is a considerable difference in reference tracking with 1DOF and 2DOF structures, the disturbance rejection operation seems to be identical for both the controller structures. The result of this research work confirms that the proposed controller helps to achieve a better result compared to the PID designed using Genetic-Algorithm (GA), Particle-Swarm-Optimization (PSO), Bacterial-Foraging (BFO), Firefly-Algorithm (FA), Bat-Algorithm (BBA) and Jaya-Algorithm (JA) [22,23].
The other sections of this research work are presented as follows; Section 2 describes the problem formulation, Section 3 presents the methodology, Section 4 and 5 depicts results and conclusion respectively.

PROBLEM FORMULATION
In the literature a considerable number of real time industrial systems are existing and whose values to be controlled based on the need to achieve better result [25]. Designing the optimal controller is one of the essential tasks in closed-loop systems and finding the controller parameters needs complex computation, if the system to be controlled is highly non-linear and unstable in nature.
The structure of the benchmark MLS is depicted in Figure 1 and the task is to design the PID to control the input current to the electromagnet; which helps to position the ball based on the set-point. The MLS consist a power source, electromagnet, an iron ball and a non-contact type optical position sensor to sense the current position of the ball. The ball is to be perfectly positioned in the air when g * m F  . Where 'F' is the magnetic force by the electromagnet, 'm' is the mass of the ball and 'g' is gravitational constant. The main task is to vary the coil current (i) of the magnet till g * m F  is achieved. The mathematical model of the system can be obtained as follows. Let us consider, X denotes the distance, Xg is distance between center of ball to ground, Xm distance between the ball and magnet, L and R are the inductance and resistance of the coil, X0 is the equilibrium position of ball and L0 is the additional inductance to maintain the ball position. For these values, F=m*g can be represented as in Eqn. (1) The modeling procedure is cleanly depicted in the earlier works [22][23][24]. Eqn. (3) depicts the state-space model of the system and by considering the essential modeling parameters, the state-space model of the system is attained and its value is depicted in Eqn. (4). The transfer function model of this system is depicted in Eqn. (5) and from this equation, it can be noted that the existing MLS is an unstable system; since, the transfer function model has a right hand pole as shown in Figure 2. Hence a finest PID is to be implemented to bring the system from the unstable condition to the stable condition around the operating region. The state space model in equilibrium is The following parameters are adopted to model the system; M = 0.05kg, g = 9.81m/s 2 , L = 0.01H, R = 1Ω, c = 0.0001, X01 = 0.012m, X02 = 0m/s, and X03 = 0.84m. The state space model is The transfer function model is In this work a PID controller depicted in Eqn. (6) is considered to place the ball based on the set-point; In the proposed work, the N is fixed as 10 and the finest value of controller gains, such as K p , are computed using the HHO algorithm.

RESEARCH METHOD
This section presents the methodology proposed in this work with appropriate diagrams. The main task considered in this research is to optimize the PID values using the HHO algorithm. The basic closed loop structure with the proposed methodology is depicted in Figure 3.  Initially, the HHO algorithm is assigned with its initial parameters and based on assigned Objective Function (OF), this method identifies the optimal controller values. In this work, the HHO algorithm, arbitrarily alters the controller parameters till the OF is satisfied. The proposed work is implemented in the following methods; (i) Initially finding the finest value of P to stabilize the system, (ii) Finding the I and D parameters to improve the response of the MLS and (iii) Finding the pre-filter value to further improve the performance of the closed loop system. In this work, the optimal values for the controllers are identified and the performance of the system is validated using set-point tracking and disturbance rejection operations.

Controller implementation
The main task is to design the best controller for the chosen system, which minimizes the error e(t). Normally, the controller output can be defined as in Eqn. (7); where u(t) is the controller output. During this task, the overall performance of the proposed work is maintained with the OF and in this work, Eqn. (8) is considered to monitor the optimization task; where, p M is the overshoot, ISE is integral square error, IAE is integral absolute error and T is simulation time in sec. The parameters w1, w2 and w3 are the priority weights for the OF constraints and in this work, the following values are assigned; w1=1, w2=0.5 and w3=0.5. The HHO algorithm continuously alters the PID values till ) PID ( J min is reached. In this work, the traditional (1DOF) PID and the modern form (2DOF) PID is designed for the considered system.

Harris Hawks optimization algorithm
HHO algorithm is a recent nature inspired algorithm proposed in 2019 [19]. The mathematical model of this algorithm is developed by considering the hunting strategy followed by a group of hawks and this algorithm considered a weighted search with simulated exploration as well as exploitation parameters. The essential information regarding the HHO can be found in the earlier works [20,21].
The pictorial representation of the HHO is depicted in Figure 4 and in this work; the task is to catch the prey (optimal solution) when the iteration increases. Fig 4(a) depicts the hard besiege operation, in which a hawk will change its position from P(t) to P(t+1) and catch the prey (Prabbit) . Fig 4(b) shows the soft besiege process, in which a hawk is having lesser chance to catch the prey and hence it will move to the next possible  Kadry) locations (Y or Z) and will try to catch the prey from Y or Z by using the Levy Flight (LF) strategy. Other essential information regarding the HHO algorithm can be accessed from literature. This algorithm balances both the exploration and exploitation processes and helps to achieve the finest solution with better accuracy. All the algorithm parameters are assigned as in the basic code existing in [26]. In the proposed work, the following initial algorithm parameters are used;

Implementation
Implementation of the HHO algorithm for the PID design problem can be defined with the following basic flow-chart as depicted in Figure 5. The various stages in the PID tuning process with the proposed scheme is depicted in Figure 5 and the HHO search is continued till the finest value of the PID is achieved. Initially, the HHO is initialized with a one-dimensional (1D) search to identify the Kp which stabilizes the MLS. After stabilizing the MLS, then a 2D search is immediately implemented to find the Ki and Kd, which refines the output by minimizing the OF. During the filter design process, once again a 1D search is implemented to find the Tf. The search boundary for the controller parameters are assigned between zero and a negative value (since, the enumerator term in equation (5) is negative) and the assigned value is as follows; The attained controller is separately implemented with PID, filter PID, I-PD and filter I-PD controller structures and the performance of the system is verified with reference tracking and disturbance rejection operations.

RESULTS AND DISCUSSION
This section of the research presents the experimental results attained with the MATLAB software. Initially, the conventional PID controller is designed with the proposed methodology with an assigned setpoint value. The state-space model depicted in Eqn. (4) is considered for this process and the attained values of PID gains are then considered for the performance assessment. The controller values existing in the earlier research works [22,23] also considered to confirm the superiority of HHO designed PID. Figure 6 depicts the servo and regulatory response for the MLS with proposed and existing PID controllers and from the response and from Table 1 values, it can be observed that, proposed controller helps to achieve a better overshoot and ISE compared to the alternative approaches Further, the IAE obtained with BBA is superior and the PID designed with the HHO is close to the IAE of BBA. In order to find the overall performance of the proposed approach, a glyph-plot is constructed as in Figure 7 and this figure confirms that, the achieved ) PID ( J min is very small in the proposed approach compared with the alternatives. This result confirmed that the 1DOF PID implemented in this section outperforms the other methods existing in the literature.   Fig. 7 Glyph-plot to identify the overall performance of the PID After designing the 1DOF PID with the proposed technique, the 2DOF PID is then implemented by finding the pre-filter co-efficient using a 1D search with an assigned search boundary of Further, the structure of PID is modified to implement the I-PD structure which helps to attain a smooth reference tracking compared to the traditional PID. The results presented in Figure 8 and Table 2 confirms that, proposed 2DOF PID helped to get an improved performance compared to the traditional PID. When the PID is used along with the pre-filter, its overall performance such as time domain values and the error values are improved. Also the I-PD and filter I-PD structures also provided better results compared to the traditional PID implemented on the MLS.  The above experimental results confirm that the proposed 1DOF and 2DOF PID controllers helped to achieve a better result on the considered MLS system. In future, the proposed methodology can be considered to design a fractional order PID controller for the MLS system to get the enhanced reference tracking and disturbance rejection operations.

CONCLUSION
Designing the PID controller for a non-linear and unstable system is a complex task compared to the stable system. This work implemented the 1DOF and 2DOF PID controller for the MLS using the HHO  Kadry) algorithm. In this work, the controller design procedure is implemented as follows; (i) For the 1DOF PID, initially the P-controller is tuned to stabilize the system and then the I and D controllers are immediately tuned to satisfy the ) PID ( J min and (ii) During the 2DOF PID implementation, a 1D search is then implemented to find the optimal filter value which helps to convert the existing 1DOF structure into 2DOF structure. The results attained with both the 1DOF and 2DOF with the proposed tuning methodology confirms that this approach helped to achieve a better result compared to the existing methods. Compared to the considered controller structures, the Filter I-PD with the finest parameters (Kp=-88.1664, Ki=-4.8526, Kd=-4.1075, Tf=0.8633) helped to achieve better values of ISE (1.893) and IAE (5.188). In future, the performance of the considered benchmark MLS can be improved by designing a fractional order PID with the HHO algorithm.