Intelligent Controller Design for Quad-Rotor Stabilization in Presence of Parameter Variations

Thepaper presents themathematicalmodel of a quadrotor unmanned aerial vehicle (UAV) and the design of robust Self-Tuning PID controller based on fuzzy logic, which offers several advantages over certain types of conventional control methods, specifically in dealing with highly nonlinear systems and parameter uncertainty.The proposed controller is applied to the inner and outer loop for heading and position trajectory tracking control to handle the external disturbances caused by the variation in the payload weight during the flight period. The results of the numerical simulation using gazebo physics engine simulator and real-time experiment usingAR drone 2.0 test bed demonstrate the effectiveness of this intelligent control strategy which can improve the robustness of the whole system and achieve accurate trajectory tracking control, comparing it with the conventional proportional integral derivative (PID).


Introduction
The payload variation has been playing an important role in the field of transportation.The control for the unmanned aerial vehicles (UAV) becomes more challenging when it involves the payload variation over time.With the increasing popularity of autonomous UAVs in the field of military and civilian such as surveillance, disaster monitoring, rescue mission, firefighting, and package delivery [1], where carrying and transporting external payload is essential to complete the mission successfully, the safe and fast transportation of fragile or dangerous payloads by UAVs has become an interesting and important topic for the recent researchers in the field.The control of such UAVs requires the UAV stability and constant performance with the changing payload weight during the flight.But these UAVs are inherently unstable, nonlinear, and multivariable with complex and highly coupled dynamics [2].It is also very sensitive to unmolding dynamics, parametric uncertainties, and external disturbances.Thus, it makes the control design for UAVs with payload variation very critical.The critical design of such controllers leads the field of control theory to introduce new intelligent types of controllers [3].
Recent researches on the same field show different control methodologies.Bouabdallah and Siegwart present the real-time tests with an integral backstepping controller for an autonomous vehicle [4] and Boudjedir et al. mentioned an Adaptive Neural Control technique at the presence of sinusoidal disturbance [5] which is tested only in a simulation environment.Even though there exists another controller depicting the adaptive nature using sliding mode, control in the presence of external disturbances is described in [6], but it holds the simulation environment only.The work in [7] describes a Fuzzy PID for quadrotor with space fixedpoint position control in a real-time flight test.Kim and Lee extend their control idea to nonlinear attitude stabilization and tracking control for an autonomous hexarotor vehicle [8].A new approach is taken in the field of control by the design of an Intelligent controller for unmanned quadrotor [9] which seems to be promising.But the discussed works lack the analysis of the payload weight variation effects and the performance of the UAV in presence of such variations on the weight.This phenomenon is an integral part of the environments like mountains or unstructured areas for real UAV applications where UAV needs to drop the payload gradually without landing.The most practical example to view the importance of such system is the application in firefighting.Other applications like package delivery and mail delivery involve maximizing the number of delivery within an area where package or mail drop from air helps to make delivery easier.In hazard situations like fire control, such system can be used as continuous spray of water or fire control gases.The application also extends to the field of agriculture with medicine spray in a crop field.
It is extremely painful that there exists a few successful research focused on payload weight variation and its effect on the UAV performance.These studies include a fixed wing UAV that has been used for payload dropping mission [10].It lacks the stationary flight capability which leads the researcher to focus on Vertical Take-Off and Landing (VTOL) vehicles such as quadrotor UAV which offers the ability to fly in any direction and even to stop their movement staying hovering above a specific target.
In [11] a robust adaptive control is designed for quadrotor payload add and drop applications in simulation environment.Another research presented a payload drop application of unmanned quadrotor helicopter using Gain-Scheduled PID and model predictive control techniques in real-time experiment [12] but the work analyzes the effect only in altitude.Muhammad presented the simulation work with the PID controller for payload drop of a quadrotor UAV [13].To handle such complex UAV systems to unload package or to drop payload without landing, a robust flight controller is needed which must be intelligent enough to keep the UAV stable in different circumstances.The intelligent controller must adapt itself in a short duration of time with the sudden changes in the payload which enable the UAV to be stabilized.The design of such controllers aims to avoid the damage of the system and guarantees the safety operation for the surrounding environment and people present.
This work studies the effects of payload weight variation and analyzes the behavior of the UAV in a 3-dimensional space (, , ) along with the attitude (roll, pitch, and yaw angles) instead of the single axis  (altitude) consideration of most of the present works.The work contributes to the design of a robust intelligent self-tuning PID controller based on fuzzy logic to ensure the trajectory tracking performance in the presence of payload weight variations.The proposed control idea is tested both in the simulation as well as in realtime environment.
The paper introduces the existing research works which are similar to the topic of the paper, the pros and cons of such control ideas, the problem definitions, and the proposed idea in Section 1.The next part describes the dynamic model of the quadrotor in Section 2 and the controls development is presented in Section 3. Section 4 presents the simulation environment and asymptotic tracking results obtained in that environment which is further extended to real-time environment and the real flight test results are presented in Section 5. Finally, the paper concludes with the promising result and uses of proposed idea in near future to handle payload variation on a UAV effectively.

Description and Dynamics of the Quadrotor
The work uses a quadrotor, AR Drone 2.0, that was unveiled at CES Las Vegas 2012.It comes with 720p camera and the onboard sensors (like ultrasonic altimeter and 3-axis In order to design a flight controller, one must first understand the quadrotor movements, its dynamics, and consequently its dynamic equations.This understanding is necessary not just for the design of the controller, but also to ensure that the simulations of the vehicle behavior are closer to the reality when the command is applied.
The quadrotor is classified in the category of the most complex flying systems given the number of physical effects that affect its dynamics, namely, aerodynamic effects, gravity, gyroscopic effects, friction, and moment of inertia.The schematic configuration of a quadrotor we adopted in this study is shown in Figure 1.Four rotors are usually placed at the ends of two orthogonal axes.The rotation for two propellers needed to be in a clockwise direction while the other two are in a counterclockwise direction.The modeling of flying robots is a delicate task as the dynamics of the system are strongly nonlinear and fully coupled.In order to understand the model dynamics developed in this work, the working hypotheses are given below [14]: (1) The structure of the quadrotor is assumed to be rigid and symmetric.
(3) Thrust and drag forces are proportional to the square of the rotors speed.
(4) The center of mass and origin of the coordinate system related to the quadrotor structure coincide.
To evaluate the mathematical model of the quadrotor, we use two reference frames, a fixed frame linked to the ground called inertial frame R b and another mobile frame R m with its origin at the center of mass of the quadrotor.By varying the rotor speeds, the thrust forces F i=1⋅⋅⋅ 4 can be changed which results in the six principal motions as follows: (1) Roll rotation  followed by translation along   (2) Pitch rotation  followed by translation along   (3) Yaw rotation  (4) Translation along   (the altitude).
Let  = [, ]  ∈  6 be the generalized coordinates for the quadrotor where  = [, , ]  denotes the absolute position in the inertial frame R b , and  = [,,]  is the vector consists of three Euler angles ,  and . = [Ω 1 , Ω 2 , Ω 3 ]  denotes the vector containing angular velocities of roll, pitch, and yaw with respect to the body-fixed frame R m .The rotation matrix from body frame to earth frame can be obtained as follows: where (⋅) and (⋅) are abbreviations for sin(⋅) and cos(⋅) functions, respectively.Using the Newton-Euler formulation, the rotational and translational dynamics are written in the following equation with the corresponding parameters presented in Table 1:  where and   ( = 1, 2, 3, 4) is the virtual control input defined as follows:

Control Development
The work develops a self-tuning PID controller for position and heading trajectory tracking control to deal with the mass variance of the quadrotor when the payload is gradually changed.

Design of PID Controller.
The proportional integral derivative (PID) controller is designed to ensure the trajectory tracking capability of {} and {, , } along the desired yaw angle trajectory {  } and {  ,   ,   , } position as illustrated in Figure 2.
The based control laws of PID controller for position and heading take the following form: where and  .,  .,  . are parameters tuned without payload onboard. 1 and  1 are virtual control inputs used to generate the desired roll   and pitch   angles as illustrated in Figure 2: 3.2.Fuzzy Logic for Self-Tuning of PID.Fuzzy logic is a tool for reasoning propositions that can be manipulated with mathematical precepts.It has been suggested by researchers that measurements, process modeling, and control can never be exact for real and complex processes.Also, there are uncertainties such as incompleteness, randomness, and ignorance of data in the process model [15].The seminal work of Zadeh introduced the concept of fuzzy logic to model human reasoning from imprecise and incomplete information by giving definitions to vague terms and allowing construction of a rule base (Zadeh, 1965(Zadeh, , 1973)).Fuzzy logic can incorporate human experiential knowledge and give it an engineering flavor to model and control such ill-defined systems with nonlinearity and uncertainty.The fuzzy logic methodology usually deals with reasoning and inference on a higher level, such as semantic or linguistic.Fuzzy logic requires knowledge in order to reason which is provided by a person who knows the process or machine (the expert).One of the most important components of fuzzy logic is membership function.Membership functions group input data into sets, such as temperatures that are too cold, motor speeds that are acceptable, and distances that are too far.The fuzzy controller (see Figure 4) assigns the input data a grade between 0 and 1 based on how well it fits into each membership function [16].
Mathematically a fuzzy set is described as a set  in .The set  is characterized by a membership function   () associated with each point in , a real number in the interval [0, 1], with the values of   () at  representing the grade of membership of  in .
The function that characterizes the fuzziness of a fuzzy set  in , which associates each point in  with a real number in the interval [0, 1], is known as membership function.
Fuzzification and Defuzzification.The process that allows converting a numeric value into a fuzzy input is called fuzzification.
Defuzzification is the reverse process of fuzzification.Mathematically, the defuzzification of a fuzzy set is the process of conversion of a fuzzy quantity into a crisp value.This is necessary when a crisp value is to be provided from a fuzzy system to the user.
Inference Mechanism.Inference is the process of formulating a nonlinear mapping from a given input space to output space.The mapping then provides a basis from which decisions can be made.The process of fuzzy inference involves all the membership functions, operators, and if-then rules [16].

Self-Tuning of the Designed PID Controller.
Traditional PID designed in Section 3.1 comes with a lot of limitations.For example, its three parameters are tuned for a specific operating condition such as with constant payload or without payload.Therefore, such mass uncertainty may significantly affect the fly control performance.To solve this problem of designed PID, a self-tuning mechanism based on fuzzy logic is developed which has the capability of adjusting the parameters of designed PID online which enables the previously developed PID to handle the sudden or gradual change of the payload weight.We know that the weight change practically has a big and inevitable effect not only in the altitude stability of the quadrotor but also in - position.More specifically, in the hovering condition, a quadrotor with its onboard load is seen as a heavy body [13], thus requiring more upward thrust to attain the desired altitude.Once the payload is dropped or gradually changed, the quadrotor will reach a higher altitude, thus, producing overshooting on its desired height.The self-tuning intelligent PID controller must monitor this overshoot and quickly compensates for this and return the quadrotor to its desired altitude by lowering the upward thrust by slowing the speed of the brushless DC motor (BLDC) or in the opposite way when the payload is added to compensate the undershoot.
The self-tuning mechanism is designed for automatictuning of each of PID controller parameters so that the system becomes robust to the mass uncertainty.The inputs to the fuzzy mechanism are error and change in the error.It produces the output of the PID parameters "  ", "  ", "  " as presented in Figure 3.

Design of Membership Function (MF).
The work designed five triangular membership functions nl, ns, ze, ps, and pl which represent negative large, negative simple, zero, positive simple, and positive large for each input variable (see Figure 5) and seven triangular membership functions pvs, ps, pms, pm, pml, pl, and pvl for each output variables (see Figures 6-8).Based on experience, 25 fuzzy rules are defined for all possible combinations of the inputs.The "centroid method" is used for defuzzification.The three-dimensional surface of chosen fuzzy rules for the controller design is shown in Figures 9-11.Fuzzy controller is made of "if-then" rules.The selected rules for the quadrotor control process are shown in Tables 2-4.The equation for the control algorithm is given as where the control signals self-tuning proportional, selftuning Integral, and self-tuning derivative are  where   ,   and   are scaling factors; hence, three fuzzy controller outputs are Therefore, the self-tuning control input can be written as

Simulation Setup and Results
Simulations have been conducted using robot operating system (ROS) interfaced with Matlab/Simulink and gazebo physic engine simulator as illustrated in Figure 12, in order to verify the efficiency of the proposed self-tuning PID controller for heading and position control and benchmark with a regular PID.Firstly PID parameters are tuned in normal case quadrotor without payload; from Figures 13-15, we can see that the proposed self-tuning controller gives us very good result in terms of trajectory tracking performances.In the next section to demonstrate the effectiveness of the proposed controller against adverse condition, like payload weight variation, we    need to do some experimental tests; we change the weight gradually and then we analyze the effect of this change in the position tracking performance and we compare it with conventional PID.

Experiment Setup and Results
In this section to validate the position and heading trajectory tracking performance experiment tests (the experimental video is available at the URL https://www.youtube.com/channel/UC6eedfqCWGpj1YqANGdzfIg) are implemented on the Ardrone 2.0 testbed as presented in Figure 16.Firstly the quadrotor is on the ground with initial payload of 20 g onboard; after takeoff the quadrotor was ordered to follow square trajectory, and then during the fly maneuver we change gradually the weight by adding external load till we reach the maximum load supported by our system which is about 60 g; from Figures 17-21 we can see that the the self-tuning PID algorithm based on fuzzy logic that automatically adjust the parameter gain within rage   ,   ∈ [0.4 3],   ∈ [0.1 2.5] is able to make the quadrotor reach the desired trajectory, without overshoot and with  slightly oscillating motion compared to the conventional PID controller system which presents about 19 cm of overshoot in the altitude and position, because the control parameters   = 1.5   = 0.8   = 0.3 are tuned in the initial case with constant payload.

Conclusion
This paper presents a self-tuning PID control algorithm to achieve quadrotor aerial vehicle's performance with a variable payload.The comparison between the conventional PID and self-tuning PID base on fuzzy logic has been conducted; the result shows that both control methodologies are acceptable in the case of no variation in the payload weight, experimental results demonstrate the superiority of the proposed self-tuning PID comparing to the PID in case of variable

Figure 1 :
Figure 1: Quadrotor configuration frame scheme with body-fixed and inertia frames.
Quadrotor dynamics PID position controller  des  des

Figure 5 :
Figure 5: Membership functions designed for the inputs.

Table 2 :
Fuzzy rule for   .

Table 3 :
Fuzzy rule for   .

Table 4 :
Fuzzy rule for   .