Tracking control of an unmanned aerial vehicle using cascade configuration of fuzzy logic controllers in presence of windflaw

In this study, an unmanned aerial vehicle (UAV), quadrotor particularly, with six degree of freedom (6-DOF) is modeled and a novel arrangement of fuzzy logic controller (FLC) are designed to control quadrotor’s attitude and altitude. The UAVs are high nonlinear in terms of dynamic equations and are in class of under-actuated systems with six degree of freedom and four propeller’s speed as inputs. So, designing an appropriate controller is the main challenge in UAV’s applications. The controller architectures is composed of three FLCs. A MIMO FLC is implemented to control angles and altitude which is fed by two first output controllers, namely desired roll and pitch angles. Then, an octagonal helix path is constructed in such a way that an octagonal schema is generated in X-Y plane and is developed in vertical direction. By applying the windflaw to the system as a disturbance, which is blew in three directions, namely x, y, and z, the performance of designed controller is investigated. Finally, results are presented to show the controller performance for tracking purpose in presence of a wind as disturbance.


Introduction
*In the last few years, scientists and researchers are interested in under-actuated systems, systems with fewer independent control actuators than degree of freedom to be controlled. Quadrotor is an under-actuated system since it has 6-DOF (position (x, y, z) and angles (roll, pitch, and yaw)) and four control input (four propeller's speeds). So, it is difficult to design efficient controller for quadrotor . Each of the rotors on the quadrotor helicopter produces both thrust and torque. Given that the front and rear motors both rotate counter-clockwise and the other two rotate clockwise, the net aerodynamic torque will be zero. Early designs of quadrotor were performed in the 1907's by Louis Charles Bréguet (1880-1955 and then were developed by Étienne Edmond Oehmichen  and George de Bothezat (1882-1940. With advances in technology, quadrotors were extended in smaller size. Two model-based control techniques are applied to quadrotor by bouabdallah et al. (2004); a classical approach PID assuming simplified dynamics and a newer technique LQ (linear quadratic), based on more complete model . Pounds et al. (2006) are developed X-4 flyer with an onboard embedded attitude controller to stabilize flight. Also, a linear SISO (single input-single output) controller was designed to regulate flyer attitude (Pounds et al., 2006). In 2008s, a nonlinear model of an underactuated quadrotor aerial robot is derived, based on Newton-Euler formalism, and back-stepping based PID control strategy is implemented for the derived model by Mian and Daobo (2008). A robust control methodology for a quadrotor mechanism is developed by Sangyam et al. (2010). Also, a conventional proportional-integral-derivative (PID) controller and self-tuning PID based on fuzzy logic are compared and analyzed (Sangyam et al., 2010). A fuzzy control is designed and implemented to control a simulation model of the quadrotor with the desired values of the height, roll, pitch and yaw are considered as the inputs, is presented by santo, et al, (2010). A design of a controller based on the block control technique combined with the super twisting control algorithm for trajectory tracking of a quadrotor helicopter is presented by Luque-Vega et al. (2012). A nested loops control architecture in implemented by Nagaty et al. (2013). A nonlinear Backstepping controller is implemented for the inner stabilization loop and the reference trajectories for the inner loop controller to reach the desired waypoint is generated by the outer loop controller. Moreover, to ensure boundedness of the reference trajectories, a PD controller with a saturation function is used for the outer loop (Nagaty et al., 2013). In (Rabhi et al., 2011) an algorithm based on robust fuzzy logic controller to ensure stabilization of the quadrotor is proposed. Also, other control methods are performed to control the quadrotor parameters, For instance, Lyapunov theory Salazar-Cruz et al., 2005), linear quadratic regulator (LQR) , dynamic feedback (Mokhtari and Benallegue, 2004;Mistler et al., 2001), neural networks (Tarbouchi et al., 2004, reinforcement learning (Waslander et al., 2005), and visual feedback (Guenard et al., 2008;Hamel et al., 2005).
In the following sections, the basic conceptions of the quadrotor movement are described since the FLC rules are depended to these maneuver descriptions. Then, in modelling section, the dynamic model of the quadrotor with 6-DOF is derived through robotic methods to implement the quadrotor system in MATLAB Simulink. Then, a novel arrangement of FLC is designed to control attitude and altitude of the quadrotor. An octagonal helix path is constructed in such a way that an octagonal schema is generated in X-Y plane and is developed in vertical direction constructed to validate the controller performance. Finally, simulation results are presented in result section.

Basic concept
The main advantages of the quadrotors are high maneuverability and vertical takeoff and landing (Alexis et al., 2011). All maneuvers are supplied through four basic maneuvers as shown in Fig. 1. These maneuvers and resultant movement are used to design FLC so that the quadrotor is stabled in the air (section 3). • Throttle movement: This movement is provided by increasing (decreasing) four propeller speeds simultaneously by the same amount (Fig. 1a). The quadrotor is raised, when the resultant forces of the propeller speeds are more than the gravity, and is moved down, when the resultant forces of the propeller speeds are less than the gravity. Also, the amount of Δω is enough small while the model of quadrotor eventually be influenced by strong nonlinearities. • Roll maneuver: This maneuver is provided by increasing (decreasing) the left propeller speed and decreasing (increasing) the right one (Fig. 1b). It leads to a torque with respect to the x-axis which makes the quadrotor turn. Also, the overall vertical trust remains constant. • Pitch maneuver: This maneuver is provided by increasing (decreasing) the front propeller speed and decreasing (increasing) the rear one (Fig. 1c). It leads to a torque with respect to the y-axis which makes the quadrotor turn. Also, the overall vertical trust remains constant. • Yaw maneuver: This maneuver is provided by increasing (decreasing) the right and left propeller speeds and decreasing (increasing) the front and rear ones (Fig. 1d). It leads to a torque with respect to the y-axis which makes the quadrotor turn. Also, the overall vertical trust remains constant.

Mathematical model
In this section, mathematical model of the quadrotor with 6-DOF is derived through robotic and Newton-Euler method. Some assumption is considered to derive dynamic equations of the model. Two frames have to be defined: • The earth inertia frame (E-frame), • The body-fixed frame (B-frame).
The equations of motion are more conveniently formulated in the body-fixed frame because of the following reasons (Bresciani, 2008): • The inertia matrix is time-invariant. • Advantage of body symmetry can be taken to simplify the equations. • Measurements taken on-board are easily converted to body-fixed frame. • Control forces are almost always given in bodyfixed frame.
A generic 6-DOF rigid body is defined as (Eq. 1): where ξ is the generalized velocity vector with respect to E-frame, v is the generalized velocity vector with respect of B-frame and J is the generalized matrix (Fig. 2).

Fig. 2:
The inertia Frame (E) and the body frame (B) (Rodić and Mester, 2011) ξ is composed of the quadrotor linear Γ (m) and angular Θ (rad) position vector with respect to Eframe as (Eq. 2): Similarly, υ is composed of the quadrotor linear V ( ) and angular ω ( ) position vector with respect to B-frame as (Eq. 3): The rotation R and the transfer T matrices are defined as (Eqs. where C = cos k , S = sin k , t = tan k.
The dynamic of a generic 6-DOF rigid body is obtained by Eq. 6: Therefore it is possible to rewrite Eq. 6 in matrix form, as (Eq. 8): M ν + C (ν) ν = Λ Where, M and C are system inertia and Corioliscentripetal matrix, both with respect to B-frame, respectively. The overall propeller's speed Ω ( ) and the propeller's speed vector are defined as (Eq. 9): where, Ω ( ) is the front propeller speed, Ω ( ) is the right propeller speed, Ω ( ) is the rear propeller speed and Ω ( ) is the left propeller speed.
The action of the movement vector on the quadrotor dynamics is shown as (Eq. 10): Where, l (m) is the distance between the center of the quadrotor and the center of propellers. U , U , U and U are the movement vector components introduced in the previous section. The movement matrix E is shown as (Eq. 11): It is possible to describe the quadrotor dynamics as (Eq. 12): By rearranging Eq. 12 it is possible to isolate the derivate of the generalized velocity vector with respect to B-frame υ as (Eq. 13): Eq. 16 shows the previous expression not in a matrix form, but in a system of equations. where, the propeller's speed input are given through the Eq. 17.
The Eq. 17 states the quadrotor dynamics in the body fixed frame. Eq. 18 shows Eq. 16 not in matrix form, but in system equations.

Fuzzy logic controller design
Fuzzy logic has been developed since 1965 by Zimmermann (2010). FLCs are used to control nonlinear systems special in a case of dynamic equations are complicated and only some information in system behavior is available. However, other model based controllers are depended on dynamic equations on the system. Moreover, the performance of the controller and stabilization of the system are independent of the uncertainties of the system, since fuzzy logic controller is designed regardless of the dynamic model and system parameters Moezi et al., 2016;Moezi et al., 2014). Therefore, the controller is robust against uncertainties (Zakeri and Farahat, 2015).
In this study, a novel arrangement of FLCs is proposed to control the Quadrotor system. One MIMO FLC is designed to control roll, pitch, and yaw angles and altitude of the quadrotor. Two FLCs are also designed to feed third controller by suitable roll and pitch angles through controlling x and y position. So, there are two parallel FLCs which are connected to third FLC. The Takagi-Sugeno-Kang model is used to implementing FLC in following steps: • Determining FLCs input: In all three controllers the error and error rate are considered as input in FLCs, which are determined by subtracting desired values from actual values. The error and error rate of x and y are considered as the controllers input for the two first FLCs, respectively. The error and error rate of roll, pitch, and yaw angles and altitude of the quadrotor are considered as the third FLC input. • Determining FLCs output: As mentioned, the third FLC is fed by the two first FLCs by appropriate roll and pitch angles. So, the outputs of two first FLCs are roll and pitch angles. The third FLC is connected to the system directly. As stated before, four propeller's speeds are considered as the system input, therefore, these angular speeds are considered as FLC outputs.
• Determining membership functions (MFs): Also, the general schema of the MFs is shown in the Fig. 3.   Fig. 3 Totally, the relation of MFs and fuzzy rules for two first controllers is shown in Table 1. Since the relation of MFs and fuzzy rules are hard to show in table form, the third FLC is presented earlier by formula.
The FLCs configuration dealing with mentioned inputs and outputs and wind as a disturbance are shown in the Fig. 4.

Path planning
In this section, path generating procedure is presented and an octagonal helix path is developed. First, an octagonal schema is constructed in x − y plane and then is extended in vertical direction, for making octagonal helix path, which is shown in Fig.  5.

Simulation results
In this section, the behavior of system in presence of wind as a disturbance is presented by applying a -3 -2 -1 0 1 2 3 0 0.5 1 novel configuration of FLCs. As mentioned, an octagonal helix path is considered as desired signal. Then, a wind disturbance is applied to the system input by sinusoidal function. The schematic of the system in presence of disturbance is shown in the Fig. 6. The sinusoidal wind applying to the system is determined as shown in Eqs. 25-27.

Conclusion
In this study, the dynamic mode of the quadrotor with 6-DOF is derived and simulated in MATLAB Simulink. The main contribution of this research is focuses on the development of the FLCs with a novel configuration to control the quadrotor system. An octagonal schema is constructed in the horizontal plane and is developed in vertical direction to create octagonal helix path as a desired. Then, a performance of the controller is evaluated by simulation result for tracking purpose in the desired path. Moreover, a wind in considered as a disturbance with sinusoidal function. According to the results, the proposed arrangement of the controllers are effective and the system is imitated the desired path in presence of the sinusoidal wind as a disturbance.