Novel Fuzzy PID-Type Iterative Learning Control for Quadrotor UAV

Due to the under-actuated and strong coupling characteristics of quadrotor aircraft, traditional trajectory tracking methods have low control precision, and poor anti-interference ability. A novel fuzzy proportional-interactive-derivative (PID)-type iterative learning control (ILC) was designed for a quadrotor unmanned aerial vehicle (UAV). The control method combined PID-ILC control and fuzzy control, so it inherited the robustness to disturbances and system model uncertainties of the ILC control. A new control law based on the PID-ILC algorithm was introduced to solve the problem of chattering caused by an external disturbance in the ILC control alone. Fuzzy control was used to set the PID parameters of three learning gain matrices to restrain the influence of uncertain factors on the system and improve the control precision. The system stability with the new design was verified using Lyapunov stability theory. The Gazebo simulation showed that the proposed design method creates effective ILC controllers for quadrotor aircraft.


Introduction
The quadrotor [1][2][3], as a branch of unmanned aerial vehicles (UAVs), is highly favored in both military and civilian applications given its vertical take-off and landing ability, insensibility to varying environments, high mobility and stability, and easy operation modes. The quadrotor system is highly-coupled, under-actuated, and inherently non-linear, which challenges the system stability involving the microprocessor, the sensor, the mechanism, and the navigation and control algorithm. Over the past few years, much work has been completed on the modeling [4,5] and control [6][7][8] of the quadrotor UAV. The concept was introduced as early as 1907. Since then, the theoretical and experimental research results on the aspects of posture balance and perfect trajectory tracking have been extensively reported, such as adaptive control [9], fuzzy control [10], optimal control [11], and loop shaping theory [12]. Bouadi et al. [13] used a sliding mode control algorithm based on the reverse step to control the aircraft and derived the attitude angle from the higher-order nonholonomic constraints, but the change in the position loop was not used as feedback in real time. Shakev et al. [14] applied the linear feedback method to achieve the steady control of the quadrotor aircraft but did not consider aerodynamic interference. Courbon et al. [15] used novel navigation and positioning to control the quadrotor aircraft in position and attitude control.
The quadrotor UAV was chosen in this study as the research object. We attached importance to the UAV model and the control algorithm to improve the robustness and stability of the system. Considering uncertainty and random disturbance in the process of aircraft flight, we used the iterative learning control (ILC) method to improve system robustness. The ILC [16][17][18] method has a simple and clear form, and can also compensate for uncertainty, nonlinearity, coupling, modeling error, and other

Model for The Quadrotor UAV
The quadrotor model is described in this section. E = {X e , Y e , Z e } is the inertial coordinate system, B = {X b , Y b , Z b } is the body coordinate system, Φ = [ϕ, θ, ψ] T represents the Euler angle, and the rotation matrix from the inertial frame to the body frame is: cos ψ cos θ cos ψ sin ϕ sin θ + cos ϕ sin ψ sin ϕ sin ψ − cos ψ cos ϕ sin θ − cos θ sin ψ cos ϕ cos ψ − sin ψ sin ϕ sin θ sin ψ cos ϕ sin θ + sin ϕ cos ψ sin θ − cos θ sin ϕ cos θ cos ϕ According to Newton's law of motion and the Euler equation, the dynamic equation of the quadrotor can be expressed as F = m ..

P
(2) where F is the external force on the quadrotor, m is the mass of the quadrotor, M is the rotational torque of the airframe, H is the angular momentum of the body under the inertial coordinate system, l represents the distance from the motor shaft to the center of the body, J r represents the inertia of the motor, f i (i = 1, 2, 3, 4) represents the lift provided by the i-th rotor, and b and d represent the lift and drag coefficients of the rotors, respectively. J represents the inertia matrix of the airframe, K dm represents the coefficient of rotational resistance moment, and K dt represents the coefficient of translational resistance. According to the structural characteristics of the quadrotor UAV, J, K dm , and K dt can be expressed as diagonal arrays: Sensors 2019, 19, 24 3 of 11 P = [x, y, z] T represents the position of the quadrotor centroid in the inertial coordinate system and Ω = [p, q, r] T represents the rotational angular velocity around three axes in the body coordinate system, expressed as .. . where and ω i is the rotational angular velocity of the rotor of the i-th rotor. I x , I y , I z represent the axial inertial moment of the aircraft in the x, y, and z directions, respectively. Equations (5) and (6) describe the centroid translational motion and the body rotation motion of the quadrotor UAV, respectively. The following relationship exists between the Euler angular velocity and angular velocity in the body coordinate system: When the quadrotor is hovering or flying at low speeds indoors, we define vectors as U = [u 1 u 2 u 3 u 4 ] T . u 1 , u 2 , u 3 , u 4 represent the lift torque, roll torque, pitch torque, and yaw torque of the aircraft, respectively, and are defined as: The following simplified model of the quadrotor UAV can be obtained: where x, y, z, ϕ, θ, ψ represent the longitudinal displacement, lateral displacement, height, roll angle, pitch angle, and yaw angle of the aircraft, respectively, and g is the gravitational acceleration. The physical parameters for the quadrotor are provided in Table 1. The quadrotor aircraft relies on the four rotors to generate lift and torque, enabling lifting, yaw, roll, pitch, lateral, and transverse movements. Its four propeller crosses are driven by four direct current (DC) motors, and motion in space is achieved by changing the speed of the four DC motors. The structure diagram of the quadrotor aircraft is shown in Figure 1.  cos cos To facilitate the formula derivation, we simplified the aircraft model. The state variable is

ϕ), and the virtual input is
The mathematical model of the quadrotor was rewritten into an equation of the state format: where U 5 = (cos φ sin θ cos ψ + sin φ sin ψ) and U 6 = (cos φ sin θ cos ψ − sin φ cos ψ). We divided the whole system into six relatively independent channels: height control, horizontal X-axis control, horizontal Y-axis control, roll control, pitch control, and yaw control. The mathematical model of the height channel can be obtained by Equation (10): The desired height is z d = x 5d and the tracking error is e 5 = x 5d − x 5 . We defined the Lyapunov function as V 5 = e 2 5 /2, and the derivative of the Lyapunov function is: x 5d − x 6 (12) x 5d + k 5 e 5 , k 5 > 0 is parameter of control system and α 5 is the virtual control input. Equation (12) can be simplified as: We defined the new Lyapunov function as V 6 = V 5 + e 2 6 /2, and the derivative of this formula can be written as: So, we obtained this formula where U 1 = ( .. x 5d +g−(k 5 +k 6 )e 6 +(1−k 2 5 )e5)m cos x 11 cos x 9 , and the same is true for the other control channels, all k * > 0 are parameters of control system.
x 11d + (k 11 k 12 + 1)x 11d (16) Sensors 2019, 19, 24 6 of 11 The system model of the quadrotor aircraft is simplified as: is the input matrix, and C is the output matrix.

Controller Design for Quadrotor UAV
The designed iterative learning control algorithm in Figure 2 is    and u = u x u y u z u ψ u θ u ϕ T . The three iterative learning gain matrices are expressed as

Controller Design for Quadrotor UAV
The designed iterative learning control algorithm in Figure 2 is where    Table 2. In these figures, PB is positive big, PM is positive middle, PS is positive small, NB is negative big, and ZO is zero. The rules of the controllers are expressed in Table 2 with all the possible combinations. Based on the control experience of the four-rotor aircraft, the fuzzy rules were established according to the output error of the system and the adjustment of the parameters. The membership function of the fuzzy controller is shown in Figure 3.  The fuzzy controller in this paper has three parameters ς m , γ m , and η m as the output.
, z d (t) and x k (t), y k (t), z k (t) represent the expected position coordinates and the actual position coordinates of the quadrotor aircraft of the k-th iteration, respectively. ψ d (t), θ d (t), ϕ d (t) and ψ k (t), θ k (t), ϕ k (t) represent the desired attitude angle and the actual attitude angle of the quadrotor aircraft in the k-th iteration, respectively. The fuzzy rules table is shown in Table 2. In these figures, PB is positive big, PM is positive middle, PS is positive small, NB is negative big, and ZO is zero. The rules of the controllers are expressed in Table 2 with all the possible combinations. Based on the control experience of the four-rotor aircraft, the fuzzy rules were established according to the output error of the system and the adjustment of the parameters. The membership function of the fuzzy controller is shown in Figure 3.

Controller Design for Quadrotor UAV
The designed iterative learning control algorithm in Figure 2 is

Convergence Analysis
In this section, the convergence condition of the controllers for the quadrotor aircraft system is given and proved.
Moreover, an approximation to the value of y k (t) → y d (t) , obtained long before exact termination should occur, is often sufficient. Therefore, the following iteration termination criterion is chosen: where ε > 0 is a strict accuracy bound. After k iterations, it is possible to obtain an approximation y k (t) to y d (t) from the iteration procedure. Under the action of the proposed algorithm in Equation (18), when k → ∞ , we obtained the conclusion of this theorem y Proof. The error variables are . e k (t) = .
Then, the norm of both sides of Equation (24) can be obtained: . e k+1 (t) Multiplying both sides of Equation (14) by e −λt to compute the λ-norm, we obtain: where ρ = ρ + b 1 1 − e −λt /λ + b 2 1 − e −λt 2 /λ 2 . We found a sufficiently large positive number λ, so we obtained ρ < 1. Therefore, we could reasonably choose a group control parameter in order to reach the conclusion of this theorem lim k→∞ . e k λ = 0.

Gazebo Environment Simulation
To demonstrate the tracking performance and robustness of the proposed ILC law, the overall system was tested using Gazebo simulations. The modeling of the Gazebo simulation does not depend on the mathematical model of the quadrotor itself or any special graphics package and can simulate various dynamic relationships between spatial objects in virtual space, which has the advantages of other simulation software. The physical parameters of the whole quadrotor system are shown in Table 1. The parameters of the fuzzy control laws are listed in Table 2. The simulation time is 45 s. The desired helical trajectory is P d = [t/2 cos(t/2) t/2 sin(t/2) t/10]. The external aerodynamic interference during the quadrotor flight is: d f = [0.1 sin(0.1πt) 0.15 cos(0.1πt) 0.12 cos(0.1πt)]. Figure 4 presents the model of the quadrotor aircraft in the Gazebo simulation environment. Figures 5 and 6 show the three-dimensional (3D) trajectory tracking the result of the quadrotor. We can see almost asymptotic convergence toward the actual tracking trajectory after 10 iterations. Simulation results for each direction of the reference trajectories and initial conditions showed better tracking results. The fuzzy PID-ILC demonstrated remarkable performance in terms of control and stability of the system compared with the conventional PID-ILC algorithm. The maximum tracking errors in the x, y, z, ϕ, θ and ψ directions from iteration to iteration are depicted in Figure 7. Figure 8 shows the tracking errors in the last iteration controlled by both fuzzy PID-ILC and traditional PID-ILC. The fuzzy PID-ILC performed much better than the PID-ILC in terms of the convergence speed and tracking error reductions. In the presence of wind disturbances, there are smaller errors for the motions in all three directions controlled by the fuzzy PID-ILC. These results show the importance of fuzzy control. Therefore, the fuzzy PID-ILC algorithm has indicated its capability to solve the trajectory-tracking control problem experienced by quadrotor UAVs.
Multiplying both sides of Equation (14) by t e λ − to compute the λ -norm, we obtain: We found a sufficiently large positive number λ , so we obtained 1 ρ <  . Therefore, we could reasonably choose a group control parameter in order to reach the conclusion of this theorem lim 0 k k e λ →∞ =  .

Gazebo Environment Simulation
To demonstrate the tracking performance and robustness of the proposed ILC law, the overall system was tested using Gazebo simulations. The modeling of the Gazebo simulation does not depend on the mathematical model of the quadrotor itself or any special graphics package and can simulate various dynamic relationships between spatial objects in virtual space, which has the advantages of other simulation software. The physical parameters of the whole quadrotor system are shown in Table 1. The parameters of the fuzzy control laws are listed in  Figure 4 presents the model of the quadrotor aircraft in the Gazebo simulation environment. Figures 5 and 6 show the three-dimensional (3D) trajectory tracking the result of the quadrotor. We can see almost asymptotic convergence toward the actual tracking trajectory after 10 iterations. Simulation results for each direction of the reference trajectories and initial conditions showed better tracking results. The fuzzy PID-ILC demonstrated remarkable performance in terms of control and stability of the system compared with the conventional PID-ILC algorithm. The maximum tracking errors in the , , , , and x y z ϕ θ ψ directions from iteration to iteration are depicted in Figure 7.

Conclusion
The novel fuzzy PID-ILC algorithm was successfully applied to the trajectory tracking of a quadrotor UAV. A simple fuzzy law to tune the PID-ILC gains was developed. The PID-ILC algorithm adjusts and produces a group of the optimal input compensation for each iteration so that the overall error is reduced and converges to a minimized tracking error. By comparing the results of the Gazebo simulation, fuzzy PID-ILC demonstrated its remarkable capability to not only maintain the stability of the system and reduce the shaking and concussion of the system but also to achieve perfect tracking of the trajectory. Future research directions will include applications of the fuzzy iterative learning algorithm for the selection of the controller parameters.