Linear and Nonlinear Controllers Applied to Fixed-Wing UAV

This article presents a comparison of controllers which have been applied to a fixed-wing Unmanned Aerial Vehicle (UAV). The comparison is realized between classical linear controllers and nonlinear control laws. The concerned linear controllers are: Proportional-Derivative (PD) and Proportional-Integral-Derivative (PID), while the nonlinear controllers are: backstepping, sliding modes, nested saturation and fuzzy control. These controllers are compared and analysed for altitude, yaw and roll by using simulation tests.


Introduction
The number of applied control theories used for UAVs has increased in recent years due to the large number of applications that they can realize. Some of these applications are focused in dangerous missions such as monitoring disaster areas, localization of victims, infrastructure inspection for inaccessible locations, tasks of surveillance, photography, etc. All these applications are obviously related to one important UAV characteristic: the avoidance of risk to pilots and crew when flight conditions have low visibility or take place in bad weather [1].
A basic part of UAV control depends of the obtained dynamic model, which allows us to analyse the system behaviour. The aerodynamic model obtention is very important in the study of UAVs given that these vehicles have a very high risk of damage, even if the ground is only located a few metres below the vehicle, as small oscillations could lead the UAV to crash. For the above reason, the controller must be applied experimentally once several simulations have been tested in order to adjust the controller parameters [2].
The flying qualities of UAVs are just as important as for piloted aircraft. Although envelope boundaries may not be quite the same, they will be equally demanding. Thus, the theory, tools and techniques described in [2] or [3] can be applied to the analysis of the flight dynamics of fixedwing UAVs.
The control methodologies that have used in this paper were selected once we had chosen the aerodynamic model, such control laws are: PD and PID [4], sliding modes [5], nested saturation [6], backstepping [5], [7] and fuzzy logic [8]. The model equations describe the decoupled dynamics of the airplane [2], then each controller is applied in order to control the movements of attitude, yaw or roll. The main objective of this paper consists of adopting general model equations of a fixedwing in order to apply and analyse the performance of the basic controller methodologies.
The paper organization is as follows. Section 2 presents the mathematical model of the airplane. Section 3 deals with the control laws applied to the airplane. In Section 4, the results obtained by simulations are presented. Finally, Section 5 presents the conclusions and future work.

Airplane model
In order to obtain the model equations, by omitting any flexible structure of the UAV, the fixed-wing UAV is considered as a rigid body. Also we do not consider the curvature of the Earth, it is considered as a plane, because the UAV will only fly short distances -then with the previous consideration it is possible to apply Newtonʹs laws of motion.

Longitudinal dynamics
The parameters involved in the longitudinal dynamic model (1)-(5) are shown in Figure 1. These allow analysing the movement toward the front of an airplane [9], particularly the altitude control: where V is the magnitude of the airplane speed,  describes the angle of attack,  represents the flight-path angle and  denotes the pitch angle. In addition, q is the pitch angular rate (with respect to the y -axis of the aircraft body), T denotes the force of engine thrust, h is the airplane altitude [9] and e  represents the elevator deviation. The aerodynamic effects on the airplane are obtained by the lift force L and the drag force D . M is the pitching moment which acts on the airplane, m denotes the total mass of the airplane, g is the gravitational constant and yy I describes the component y of the diagonal of the inertial matrix. The value of angle of attack is obtained by using the following relation      [3]. The lift force L , the drag force D and the pitching moment M are defined as [9]: where q denotes the dynamic pressure, S represents the wing platform area and c is the mean aerodynamic chord. D C , L C and M C are the aerodynamic coefficients for drag force, lift force and pitch moment respectively. The lateral dynamic generates the roll motion and, at the same time, induces a yaw motion (and vice versa), then a natural coupling exists between the rotations about the axes of roll and yaw [10]. In our case, it is considered that there is a decoupling of roll and yaw movements. Thus, each movement can be controlled independently. Generally, the effects of the engine thrust are also ignored [10]. In Figure 2, the yaw motion is represented, which can be described with the following equations:

Lateral dynamic
where  represents the angle of yaw and r denotes the yaw rate, with respect to the centre of gravity of the airplane. N is the yawing moment and zz I represents the inertia in the z -axis. r  is the rudder deflection. x V corresponds to the speed of the airplane in the longitudinal x -axis, y V is the speed in the lateral yaxis, x F describes the thrust force in the longitudinal xaxis and y F denotes the component of the resultant lateral force on the y -axis. The equations related to the above forces and the yaw moment are [3]: where 0 x C , y C y n C are the aerodynamic coefficients involved for the lateral dynamics. These coefficients are obtained by considering small angles and with a low airplane speed.
The following equations describe the dynamics for the roll motion: where p denotes the roll rate, L is the rolling moment, xx I represents the inertia for the x -axis and  describes the roll angle. The aerodynamic effects on the airplane are obtained as they are obtained for the yaw motion. In Figure 3, it is observed that a  represents the deviation of the ailerons. In the case of the roll moment, this corresponds the expression L L qSbC  , where b is the wing span of the airplane and L C represents the aerodynamic coefficient of the roll moment [3].

Controllers design
In this section, we describe the linear and nonlinear controllers that have been designed in order to control the fixed-wing UAV.

Altitude control
In order to design the altitude control law, we consider the equations that define the longitudinal dynamics, except equation (1) which defines the linear longitudinal velocity, because it is considered a constant velocity. We also define the error as ( ) in order to design the linear and nonlinear controllers, and it denotes the difference between the desired altitude d h with respect to the current altitude ( ) h t . The control signal for the PID is [11]: While for the PD [11], the control signal is given by: where pl k , vl k and il k are the control gains related to the controllers PD or PID, and , , l h    (we will use  and  in the next linear controllers). These gain values, for the simulation results, have first been estimated by the second method of Ziegler-Nichols, and then we did a series of fine tunings in order to get the desired response [4].
For sliding mode control we consider 2h x q  and 1e d x      . The respective sliding manifold is given by k is a nonnegative constant gain. The sliding mode control is obtained as: The nested saturation controller is proposed to globally asymptotically stabilize a chain of n integrators with one input [6]. By applying a transformation over (3) and (4), where 1h x M  , we have that: where 1h k , 2h k and 3h k are nonnegative constant parameters of the controller. Finally, by following the method of [6], the nested saturation control can be written as: b is a positive constant value (bound) and where 1, 2, 3 n  and , , l h    (we will use  and  in the next nested saturation controllers): In [9] we propose a backstepping technique used only for equation (2), where the angle  is considered as the output to be controlled, and where the reference value is denoted by ref  . Then, (2) can be written as: and by using the backstepping methodology [5], [9], we can obtain the next control input: where 1h k , 2h k and 3h k denote nonnegative constant gains.
For the case of the fuzzy controller, the membership functions of the altitude error h e are shown in Figure  4, while the membership functions related to the altitude rate error vh e are done in the Figure 5 [8]. We consider three input cases: when the inputs are negatives (N), zero (Z) or positives (P). To obtain the output, we have used the "max-min" inference [8], which we will also use to control the yaw and roll motions. For the membership functions of the output, given by the Figure 6, we have considered the cases: negative large (NL), negative small (NS), zero (Z), positive small (PS) and positive large (PL). The Table 1 contains the respective rules.

Yaw control
In order to design the control laws for this movement, we only consider the equations that define the yaw motion, then we exclude (11) and (12)  , a  , 1 b  are nonnegative constants. Now, the calculated control law is given by: where the function sgn( ) sgn( ) s s   was defined before. The nested saturation control is realized by using the same procedure that has been described for the altitude control. Let us consider 1 ( ) x e t    , 2 x r   and 3 x N   , then the coordinates transformation for the yaw dynamics is: where 1 k  , 2 k  , 3 k  are the nonnegative constant gains.
The nested saturation control is given by The backstepping controller has been designed by taking (9), as an approximation of a single degree of freedom of yaw model [10], then we can write r nr n r as the integrator backstepping [5], the new system to be controlled is then given by: where the control input is obtained as The fuzzy controller is now generated by using seven membership functions for the inputs (angle and rate errors) and an equal number of membership functions for the output. The Figures 7 and 8 correspond to the input signals of the position error pl e , where and , l    (we will use  and  in order to identify the corresponding error in the Table 2) and the rate error vl e respectively. Figure 9 corresponds to the output and all the cases have been defined as: negative large (NL), negative medium (NM), negative small (NS), zero (Z), positive small (PS), positive medium (PM) and positive large (PL). The same nomenclature is used for the fuzzy controller related to the roll control. In Table 2, we show the rules that have been used for the controllers of yaw and roll motions.

Roll control
In order to design the attitude linear and nonlinear control laws for the roll movement, we consider the equations that only define the roll motion, then we exclude (18) and (19) because they link the lateral and longitudinal linear velocities generated by roll angle.
For the development of the roll control strategy, the same general structures as those used for the PID and PD controllers presented previously in (20) and (21) The obtained control law is: For the nested saturation control, we consider 1 ( ) . The transformation of the roll dynamics is given by: where 1 k  , 2 k  and 3 k  are nonnegative constant gains. The nested saturation control is: The backstepping controller has been designed by taking (16) as an approximation of a single degree of freedom of the roll model [10], then we can write , and by defining the integrator backstepping as 2 x u    , the new system to be controlled is: Following the backstepping methodology presented in [5], the controller is finally obtained as: Concerning the fuzzy control strategy, seven membership functions are used for the input and output roll control. Figure 10 and Figure 11 show the membership functions that have been used as input signals for the position error pl e , and the rate error vl e , respectively. The membership functions for the output roll control are shown in Figure 12.

Simulation Results
This section presents the simulation results that has been obtained for each one of the cases under analysis. Figure 13 shows a constant signal corresponding to an altitude reference of 15 metres, in addition the response of each one of the controllers is presented. Figure 14 shows the controller output signal that is applied to the aircraft in order to obtain the desired altitude. The used gain values for the linear controllers are shown in Table 3, and the gains for nonlinear control simulations are shown in Table 4, Table 5 and Table 6. In Figure 13, we can see that all signals accomplish the objective within 20 seconds. The PID controller reaches the desired altitude faster than the PD controller -the PD control shows a good response, but it is slower at reaching the desired altitude and applies almost the same pair or torque as the PID controller.

Altitude movement
The nested saturations signal reaches the desired altitude faster than the other controllers. The sliding modes and backstepping controllers produce very similar responses. The difference is given by the evidence of chattering in the sliding mode control. The fuzzy control presents an oscillatory torque. For this movement, we conclude that the nested saturation control has a better response and it applies a small torque in comparison with the sliding modes and backstepping controllers, but with very small variations. In Figure 15, a zoom of the three output signals related to the sliding modes controllers are shown in order to visualize the chattering.

Yaw movement
The gains applied for the yaw controllers are presented in Table 3 for the PID and PD controllers, and the gains for nonlinear controllers are shown in Table 4, Table 5 and Table 6. Figure 16 shows a yaw reference of 10 o , as well as the responses of the six controllers. Figure 17 shows the applied moments that we need to apply in order to obtain the desired angular movement. Since some of the controllers in Figures 14, 17 and 20 seem to have a low or even zero applied torque, we have dedicated Figure 18 to realize a zoom to those controllers in order to study their performance.
We can see that the PD control has a steady-state error of 0.0006 o . The PD and PID signals converge to the desired reference angle within 14 seconds. For the case of the fuzzy controller, the angular displacement converges to the reference value faster than the PD and PID controllers, by applying a low torque (Figure 18).
The backstepping converges quickly to zero torque and it can also be seen that the controller signals converge to the desired reference angle within 10 seconds, without steady-state error and with a very small overshoot in the nested saturation control. The sliding modes and backstepping controllers converge to the reference value in a damped form, but with different slopes in the transient response. In Figure 17, we can see that sliding modes control applies a lower torque than nested saturations and backstepping controllers in order to reach the desired angle. However, the sliding mode control has the well-known chattering in its control signal ( Figure  15).  Figure 19 shows a reference signal of 10 o as well as the six controller responses. The Figure 20 shows the roll moments that have been generated for stabilizing the roll dynamics. The PD and PID controllers have no steadystate error and they converge to the desired angle in 8.5 seconds with a low torque (Figure 18). We can see that the backstepping controller has a small steady-state error of 0.0004 o , the controllers reach the reference within 14 seconds with a buffered form. The nested saturation control has a very small over shoot. The applied torques for nested saturations and backstepping are large, the sliding modes control and fuzzy control applies a lower torque in order to converge to a desired value, compared with the other controllers, however the sliding modes control produces chattering in its control signal ( Figure  15). The controllers' gains for the linear controllers are presented in Table 3 and for nonlinear controllers are presented in Table 4, Table 5 and Table 6.

Conclusion
In this paper, we have realized a comparison of six controllers for the flight of a fixed-wing airplane. Based on the 3D decoupled motion simulation results, it is concluded that for each movement (altitude, yaw and roll) there is a specific controller that has a better performance with respect to the others.
The sliding modes and backstepping controllers produce acceptable responses for the altitude control, but they generate very high torques. The fuzzy controller shows good performance, since it combines a good response with low torque for each one of the three dynamics: altitude, yaw and roll. Concerning the PD controller, it has an undesirable steady-state error in yaw dynamics.
On the other hand, the PID controller produces an acceptable response in the three movements.
Taking into account the results obtained from the other nonlinear controllers, it is concluded that the nested saturation has one of the better performances in altitude, it combines a good response with low torque to reach the desired altitude, except in yaw and roll where it produces an acceptable response, but with large torque. The sliding modes and backstepping controllers produce an acceptable response in altitude control, but generate a very high torque.
The sliding modes controller has an acceptable performance in yaw and roll movements, with lower torques in comparison with nested saturations and backstepping, but with a high frequency chattering. For the roll and yaw dynamics, the nested saturations has a acceptable performance, but it produces high torques in order to converge to the desired values and small overshoots. The backstepping for the yaw and roll dynamics performs well, but it generates a high output moment.
It is worth mentioning an interesting behaviour encountered for the fuzzy controller case. It was found that, by adding more membership functions, it is easier to control the yaw and roll motion. Initially, we only considered three membership functions for the position and rate errors, and with five output functions. When that number was increased, this controller provided better responses. From the simulations results, we can observe that the choice of a controller for stabilizing the flight of a fixed-wing airplane is not a trivial problem. This is because the airplane is very unstable for certain movements of the ailerons, stabilizers and elevators. The airplane considered in our problem has a low wing, so we can consider it an acrobatic airplane with higher nonlinearities in its system.
The mathematical model that defines the aerodynamic behaviour of the fixed-wing UAV contains many important factors that should be considered when designing a more suitable controller. One of these important factors is related to the aerodynamic coefficients.
Our future work will concentrate on the development of a radio-controlled airplane with embedded systems in order to validate the previous results and on the design of robust linear controllers.