Wind and Payload Disturbance Rejection Control Based on Adaptive Neural Estimators : Application on Quadrotors

In this work, a new intelligent control strategy based on neural networks is proposed to cope with some external disturbances that can affect quadrotor unmanned aerial vehicles (UAV) dynamics. Specifically, the variation of the system mass during logistic tasks and the influence of the wind are considered. An adaptive neuromass estimator and an adaptive neural disturbance estimator complement the action of a set of PID controllers, stabilizing the UAV and improving the system performance.The control strategy has been extensively tested with different trajectories: linear, helical, circular, and even a lemniscate one. During the experiments, the mass of the UAV is triplicated and winds of 6 and 9 in Beaufort’s scale are introduced. Simulation results show how the online learning of the estimator increases the robustness of the controller, reducing the effects of the changes in the mass and of the wind on the quadrotor.


Introduction
In recent years, new and valuable applications of unmanned aerial vehicles (UAV) have emerged in different sectors such as defense, security, construction, agriculture, entertainment, and shipping [1][2][3].These and other applications demand the design of efficient and robust controllers for those autonomous vehicles.That is why the modelling and control of these complex and unstable systems still motivate the research and interest of the scientific community [4][5][6][7][8][9][10][11].
Nevertheless, the modelling and control of quadrotor vehicles are not an easy task.The complexity comes from the randomness of the airstreams and of the exogenous forces, the high nonlinearity dynamics, the coupling between the internal variables, the uncertainty of the measurements, etc.These factors make the techniques based on artificial intelligence a promising approach for the identification and control of these systems [12].
Moreover, these intelligent strategies are especially interesting when the model parameters change while the system is working [13].For example, the total mass will undergo variations when the vehicle is performing logistic tasks, since the mass depends on the loads that are shipped.
There are few works that study the effect of the payload variation on the quadrotor dynamics and that take it into account.In [14], an adaptive control is used to mitigate the impact of the parameter variation by estimating them under guaranteed performance.In [15], least square and gradient methods are implemented for adaptive parameter estimation, which are used to update the control output to the current UAV mass and inertia moment.Recently, Wang [16] applied again the same strategy to estimate the variations in the payload and the effect of the wind gusts.
We propose to use estimators based on neural networks.They offer three main advantages with respect to other techniques: the fact that knowledge about the internal structure of the system to be estimated is not necessary, unlike other estimation techniques such as PEM (parametric error models), Hammerstein-Weiner, and Volterra; its online learning ability; and the easy parallelization.Even more, using adaptive neural networks allows the online learning of the estimation not to be so biased by the selection of the training data.This is a relevant advantage against other offline estimation methods which are very sensitive to the dataset used during the training.There are other papers more focused on a closely related problem, the UAV stabilization and path tracking when its center of gravity changes, and what happens by the manipulation of suspended loads by cables.In [17], using the flatness property, a trajectory generation method is presented that enables finding nominal trajectories with various constraints that result in minimal load swing.Also, the same authors present a very interesting cooperative control strategy to manipulate suspended loads by several quadrotors at the same time [18].In [19], a controller based on a set of connected PD regulators is used to tackle this issue.An adaptive tracking controller based on output feedback linearization is used in [20]; this controller compensates for dynamical changes in the center of gravity of the quadrotor.In [21], this issue is again addressed using the dynamic programming approach.In [22], the complexity of the aerial vehicle is incremented by considering the elasticity of the cable in the system equations.
Other studies are focused on the rejection of wind disturbances.In [23], Lyapunov-based observers are used to estimate the external force disturbances.In [24], a control strategy based on sliding mode and adaptive control techniques is proposed to deal with slow and fast timevarying wind conditions.In [25], a switching model predictive attitude controller for an unmanned aerial vehicle subject to atmospheric disturbances is presented.In [26], a nonlinear adaptive state feedback controller for thrust and torque actuation is designed, so that it guarantees global convergence of the closed-loop path following in the presence of constant wind disturbances.In [27], a sliding mode control driven by sliding mode disturbance observer (SMC-SMDO) approach is used to design a robust flight controller for a small quadrotor.
So far, the studies are mainly focused on payload variations and on wind disturbances rejection.Only few recent papers have been found that address both problems at the same time, such as in [16].This challenging issue demands further research.Furthermore, although there are some papers where neural networks are applied to model quadrotors [28,29], and to control them [30][31][32][33], these techniques have not been explored to solve this specific research problem.
Therefore, in this work, we propose the design of an intelligent control strategy based on neural networks to cope with these external disturbances, payload changes and wind, that can affect quadrotor dynamics.The final goal is to stabilize the UAV and to improve the system performance.The control strategy has been extensively tested by simulation with different trajectories.Indeed, the online learning estimator that has been implemented increases the robustness of the controller, reducing the effects produced for these variations.
The paper is organized as follows.In Section 2, the dynamic behavior of the system is described.The design of the controller and the adaptive neural estimators are presented in Section 3. Simulation results are discussed in Section 4. The document ends with the conclusions and future works.

System Model
A quadrotor vehicle is composed by four perpendicular arms, each one with a motor and a propeller (Figure 1, left).The four motors drive the lift and direction control.
The system is based on two couples of propellers opposed to each other, (1,3) and (2, 4) (Figure 1, right).To keep the balance of the system, one pair of motors turns clockwise while the other one spins counterclockwise.The increment of the speed of rotor 3 with respect to rotor 1 produces a positive pitch ( > 0), while increasing the speed of rotor 4 regarding rotor 2 produces a positive roll ( > 0).The increment of the speeds of rotors 1 + 3 with respect to rotors 2 + 4 produces a positive yaw ( > 0).

Complexity 3
Regarding the UAV modelling, in the related literature, there are typically two approaches to obtain the mathematical model of the quadrotor: the Lagrangian method and the one based on the representation of the translational and angular dynamics.As we need to develop a control-oriented model, we have used the latter, that is, the Newton-Euler method, which describes the dynamic systems in terms of force and momentum.
The Newton dynamic equation states that the sum of forces applied in a system is equal to the variation of the lineal momentum: While the mass is constant, this equation is equivalent to In our case, the forces   are the vector of forces T produced by the rotors and by the gravity, considering an Earth reference system; thus, the previous equations give the translational dynamic (3) considering the assumption  V ≫ ṁ V, implicitly assumed in other papers [33]: where  is the mass of the quadrotor in Kg,  is the rotation matrix which is dimensionless, g is the gravitational acceleration in m⋅s −2 ,  is a vector of forces in N, and  3 = [0, 0, 1]  is a unit vector which describes the rotor orientation.The Euler dynamic equation expresses that the sum of torques is equivalent to the variation of the angular moment: This sum of torques represents the vector of torques  (N⋅m) in the three axes produced by the rotors, that is, the angular dynamic of system (5) [34], considering the assumption  × (/) ≫ (/) × , also implicitly assumed in other papers [33]: where J is the inertia tensor in Kg⋅m 2 (6),  is the angular velocities vector in rad/s, and × represents the vector product: The vectors  (7) and  (8) are a function of the velocities of the propellers: where b is the thrust coefficient in N⋅s 2 , d is the drag coefficient,  is the longitude of each arm in m, and Ω 1 , . . ., Ω 4 are the velocities in rad/s of the rotors 1 to 4, respectively.
To simplify the calculations, instead of using the speed of the rotors, it is possible to define a set of control signals  1 ,  2 ,  3 y  4 as follows (9): This matrix is invertible, so it is possible to generate speed references for the rotors from a set of control signals.
Finally, from (1) to ( 9), the following system of equations is derived: The constants of (10) to (15) that are used during the simulations are listed in Table 1.The values have been extracted from [35].
In a first approach [32], a variant of the generalized learning algorithm (GLA) was used to control this system (Figure 2).The procedure was as follows.The first step is the application of the GLA algorithm to offline train the neural network in order to identify the inverse dynamic of the plant (Figure 2).Once the network has been offline trained, it is placed in cascade connection with the plant and a PID controller.In Figure 3, this control strategy is shown for the altitude variable of the UAV.Then, the configuration of the network is online refined.In order to do this, during each control interval, two processes are sequentially applied to the network (first the simulation, later the online learning): (1) Simulation: The output of the PID,   (  ), feeds one of the inputs of the artificial neural network; the Complexity  rest of the inputs are past values of the plant output,   (  −  * ).The network generates the control input,  1 (16), which is the input of the plant (Figure 3, switch in the upper position): where  is the sampling time in seconds,   denotes the configuration parameters of the network, and   means the number of inputs of the neural network.
(2) Online learning: The neural network is trained again with the current and previous outputs of the plant, in order to generate the control output,  1 , obtaining the new configuration parameters   (17).The network input dataset is made up of the past values of the plant output,   (  −  * ).The output dataset is the current value of the plant input  1 (  ) (Figure 3, switch in the lower position): In order to test the validity of this first approach, we firstly focused only on the altitude control.UAVs are normally provided with accelerometers, so it is assumed that the acceleration in the z-axis ( Z ) is available.The network must be able to simulate the control signal  1 by using acceleration measurements.
In this example,   (16) is the reference of the acceleration in the z-axis, Z  ;   is the acceleration in the z-axis in m⋅s −2 , and  1 is the control signal.Thanks to the artificial neural network, the PID does not need to include the plant gain.The network is able to learn the plant gain and work with it.In other words, with this approach, it is not necessary to know the system parameters to control it [32].

New Advanced Strategy: Controller with Adaptive Neural
Estimators.The generalized learning algorithm proposed in the previous section is especially useful when there is not any knowledge about the real dynamic of the plant (black-box system).However, when some knowledge about the system dynamics is available, even if it is not complete or accurate, it is positive to include it in some way in the controller.In this section, the system equations (( 10) to ( 15)) are introduced in the controller, and the neural networks are focused on the uncertain terms: the mass, the wind disturbance, and the nonmodelled dynamics.
The control system has been designed to track trajectories defined by tuples of three coordinates (, , ).
The model of the whole system with the controllers is shown in Figure 4.For the sake of simplicity, several ports that route the signals haven been introduced to reduce the number of lines in the diagram.
The UAV model control inputs are the four control signals,   ,  = 1, .., 4, that represent the power of the rotors.Four main controllers are defined to obtain these model inputs, the controllers of the X, Y, and Z coordinates, and another for the yaw angle.This is because the pitch and roll angles are used to track the  and  reference coordinates.The control of  is carried out by the control signal  1 .The Y controller generates the roll reference, and the tracking of the roll angle is performed by the control signal  2 .In the same way, the controller of  generates the pitch angle reference value, and control signal  3 will be in charge of getting this value.The control signal  4 is used to stabilize the yaw angle around zero.
The aim of the PIDs controllers that appear in Figure 4 is to generate the acceleration references to make the attitude error (  − ,   − ,   − ) and the tracking error converge to zero.The rest of the controllers are used to compensate the nonlinearities of the system.The PID tuning parameters have been set by trial and error and the values of the gains are shown in Table 2.
A mass estimator and a wind disturbance estimator have been added (Figure 4).They are implemented by neural networks.These estimators are used to compensate the variations of the system's mass and the influence of the wind disturbances.These adaptive neural estimators feed the inputs of the X, Y, and Z controllers.
The controllers are defined as follows.
The performance of the  controller is given by where  is the output of the  PID controller,   is the estimation of the mass in Kg, ( −1 ,  −1 ) represents the roll and pitch signals at time  −1 , and the rest of the parameters and variables have been previously defined.In (18), it is possible to see how there is a discontinuity at cos  cos  = 0 that has been taken into account.The  controller is defined by where   is the reference of the roll PID controller in rad,  is the output of the  PID controller in m⋅s −2 ,   is the estimation of the wind disturbance in the y-axis in m⋅s −2 , and the rest of the parameters and variables have been already defined.The discontinuity at  1 (  ) = 0 has been considered.
The control of the  coordinate is given by the expression: where   is the reference of the pitch PID controller,  is the output of the X PID controller in m⋅s −2 ,   is the estimation of the wind disturbance in the  coordinate in m⋅s −2 , and the rest of the parameters and variables have been already cited.Again, there is a discontinuity at  1 (  ) cos  −1 = 0.

Adaptive Neural
Estimator for Disturbances.The control scheme proposed in Figure 4 of this paper uses three different estimations: the estimation of the total mass of the system, the estimation of the disturbances in the X coordinate, and the estimation of the disturbances in the Y coordinate.These approximations, as may be observed in ( 18)- (20), feed the inputs of the different nonlinear controllers in order to reject the effect of the changes in the mass (  ) and the wind external disturbances (  and   ).These parameters that affect the dynamic of the UAV must be estimated if there are no sensors that could measure these disturbances, as it is the case.Although the estimation of each one of these variables (  ,   , and   ) has been implemented in a different function block, the inner structure of all of them is the same.They differ in some parameters of the configuration and the input and output signals.Thus, they can be jointly explained.
The estimator is based on an artificial neural network with online learning.Thus, there is one neural network to, let say, model each of the three parameters or disturbances considered.The following figure represents its generic structure (Figure 5).It is based on the diagram shown in [28], but in this case a new parameter model has been included.Furthermore, in this case, the inputs of the neural network are the outputs of the UAV, and its output are the output of the parameter model (when in [28], the output of the neural network is fed by the outputs of the UAV).
The parameter model receives the inputs and outputs of the UAV.The output of the parameter model is used as target output of the neural network during the training.The output of the proposed estimator is always the output of the neural network.The parameter model is needed because we are using supervised artificial networks and the inputs, and their corresponding outputs must be known.
We will use one parameter model for the mass, one parameter model for the wind disturbance in the x-axis, and another for the y-axis.The complete process is further explained below.
If the parameter cannot be calculated (division by zero, squared root of negative numbers, or any other singularity), that element is not included into the training dataset.
In this offline learning, the training dataset has as many elements as previous instants of time are considered.Longer time will normally produce better accuracy but will require more computational effort.The selection of the data for training is a delicate task.Indeed, the accuracy of the model depends on the data used to train the network.Another disadvantage of exclusively using offline approaches is that they do not capture the dynamics when it is changing over time [28].For these reasons, in our proposal, we use adaptive learning for the mass and wind disturbance estimators' calculation.
Once the offline learning has finished, at each instant of time, a new training element is added {target, network inputs}, as has been previously explained.The target is obtained as the output of the model and the network inputs the output signals of the UAV.This new element is used to teach the networks how to adapt its parameters according to the new input.That is, the function to estimate the parameter is continuously changing over time.
Pseudocode 1 details the algorithm which relates to offline learning, the simulation, the online learning, and how the parameters are updated.
As it has been commented before, when it is not possible to measure or to calculate the parameter with the model, the input values are not defined, or there is a singularity in the calculation, the artificial neural network of our approach is very useful to estimate the disturbance.In these situations, we could say roughly speaking that the network generates new knowledge.
Once the inner structure of the estimator has been introduced, we explain the specific configurations for the mass and the wind disturbances.

Mass Estimation
(i) Target output: The mass is approximated with the model:

Disturbance in X-Axis Estimation
(i) Target output: The disturbance is approximated with the model:

Disturbance in Y-Axis Estimation
(i) Target output: The disturbance is approximated with the model: For the three different estimators, the artificial network implemented is a multilayer perceptron (MLP) with a hidden layer.The number of neurons of the hidden layer has been set to 20.The Levenberg-Marquardt algorithm with =0.001 has been used for the training.The network is offline trained for the first 2 seconds and then the online learning is applied for the remaining 13 seconds.

Results and Discussion
Simulation results have been obtained with Matlab/Simulink software.The duration of each simulation is 15 s.The controller is offline trained during the first 2 s.Then, the online learning algorithms are applied for the remaining 13 s.The sample time  is set to 10 ms.
In the experiments, in order to simplify the system, the yaw angle is set to 0, but it could be set to any other value by the user.

Trajectory Tracking without
Disturbances.The control system has been first tested and validated with several trajectories without considering any disturbances.For each trajectory, the path followed by the UAV with adaptive neural estimators (red line), without them (yellow line), the reference (blue line), and the tracking error, are shown (Figures [6][7][8][9][10][11].The tracking error is calculated by the following equation: where   ,   ,   are the references for , , and  in   , respectively.The trajectories used to validate the controller are described by the following equations, with the corresponding parameters: Linear: Helical: Cyclic helical: Lemniscate:  Helical lemniscate: In , it is possible to observe how the tracking error decreases along the time.In t = 0, the error is high because the value of the reference starts in a very different value than the initial position of the system, that is, ( 0 ,  0 ,  0 ) = (0, 0, 20).
Then, the controller starts to work, and the tracking error is reduced.
For the same reason, the initial error of the helical and lemniscate trajectories is much lower.The initial value reference is (1, 0, 20), and thus the initial error is 1.
In these figures, there is not any significant visual difference between the results with and without the neural network due to the fact that if the PIDs are well tuned and there are no changes either in the mass or in the external disturbances, as it is the case in this section, the neural networks do not provide relevant advantages.Nevertheless, the networks in the control scheme of Figure 4 show their full potential, when they must tackle disturbances, as it can be seen in the following sections.Consequently, the red and yellow lines seem to be overlapped.Other appreciable result is that the stationary tracking error is higher when the trajectory has helical component.Predictably, the circular and helical trajectories show a cyclic nature.
As a conclusion, the controller performs a good tracking for a wide range of different trajectories.Thus, it can be said that the control strategy has been validated.

Mass Disturbance Model.
Adding a payload in the quadrotor typically has three effects: the total mass of the system is increased, and the centre of the gravity can be modified and therefore also the inertia.In this work, we assume that the payload is an isotropic symmetric rigid solid attached to the UAV, not suspended, with dimensions much smaller than the dimensions of the quadrotor.The distance between the centre of gravity of the UAV and the centre of gravity of the load depends on the shape and the weight distribution of the manipulator and the shape and weight distribution of the load.In our experiment, we assume that this distance is zero.Under these circumstances, the effect of the inertia and centre of gravity variation can be neglected.Therefore, our paper is only addressing the effect of the mass variation.
When the UAV is performing a logistic task, there are two possible stable states regarding the mass: one is before the load is in contact with the quadrotor, and then only the mass of the UAV is considered; the second one is when the payload mass is part of the system, and the sum of both masses is then considered as an only system.Between these two states, there may be several profiles of mass variation depending on the grasping technology and the properties of the surface of the load.
We assume that the grasping and the load are nondeformable; thus, one step profile may be applied regarding the mass disturbance, as in other papers [16].
The mass variation is simulated by adding a new term   (34) to ( 13) to (15), resulting in (31) to (34).The modelling of the mass disturbance is a step function.The total mass then is triplicated at t = 4s (34) meaning that a payload has been attached to the UAV.After 4 sec, the total mass of the system is  +   = 3, with  being the mass of the quadrotor and the mass of the load   = 2.Even if it can be considered a simple approach of dealing with this disturbance, the final effect is well represented: This experiment represents a possible situation while performing a logistic task, where the payload is heavier than the quadrotor itself.

Simulation Results with Mass
Variation.Now, we test the control proposal with mass disturbances for the helical lemniscate trajectory because it is the most challenging one.Figure 12, left, shows the reference trajectory in blue, the trajectory obtained by the controller with the neuromass estimator in red, and without the mass estimation in yellow (only PID).It is possible to observe how the trajectory obtained without the adaptive neural estimators (yellow line) moves away the reference even if it later comes closer to it.At the right side of Figure 12, the tracking error is presented (red line with mass estimation and blue line without mass estimation).In both figures, it is possible to observe how the performance with the mass estimator is much better.The tracking error is mostly the same until the mass changes at t = 4 s, but then the error without mass estimation increases significantly.
The trajectory tracking of each coordinate has been represented in a separated figure to study the performance of the controller.Figure 13, top left, shows the tracking of the  coordinate, at the top, right, the tracking of the  coordinate, and at the bottom the tracking of the  coordinate, with reference (magenta line), the trajectory with mass estimator (red line), and the trajectory without mass estimator (blue line).For every coordinate, it is possible to see how the trajectory obtained by the controller with the mass estimator fits better the reference.Even though, the deviation mainly comes from the Z coordinate due to the fact that the acceleration in the z-axis is more sensible to changes in the mass.
Figure 14 shows the mass obtained by the neuromass estimator in this experiment (real mass in blue and the estimated mass in red).The estimate of the mass is very similar to the real one but slightly noisy.Clearly, it can be appreciated that the mass is triplicated following a step variation profile.
The controller is robust even with other types of variations in the mass like a sine function, for instance, if the mass changes according to The results of considering this mass variation profile are shown in Figure 15.The tracking error of each component is like the previous ones, but the system experiences a stronger change with the sinusoidal reference profile.In this case, the tracking error of the system without the adaptive neural estimators tends to increase; meanwhile, in the case of the step change, the tracking error decreased over the time.Therefore, it can be seen how the controller with the neural estimator also works well with different mass change profiles.
Figure 16 shows the mass obtained by the neuromass estimator (red line) in this case and the corresponding real mass (blue line).The estimate of the mass is again very similar to the real one but slightly noisy but now the sinusoidal nature of the profile can be clearly observed.
The controller has been extensively tested for different trajectories and the MSE numerical results are summarized in Table 3 for the different trajectories and for each coordinate, with the neural estimator (neuro) and without it (PID).The last column shows the absolute error.The best result for each component and trajectory is boldfaced.
Table 4 compares the values of the maximum error in this experiment for the same cases with before.
In Tables 3 and 4, it is possible to observe that the controller with adaptive neural estimators provides less or equal tracking error for every tested trajectory.A general trend in the "PID column" (without mass disturbance estimation) is that the worst tracking error is obtained for the  component.One of the reasons of this may be the fact that the maximum amplitude of the reference signal is in the z-axis.

Control Robustness with
Figure 13: UAV tracking trajectory of X, Y, and Z coordinates, respectively, with mass variation.
depending on the aerodynamics properties of the object and the characteristics of the air flow.The wind speed is a vector field; that is, its value may be different in each coordinate (x, y, z) of the space.For small UAVs like the one we are using in the experiments, we can assume a planar air flow, so the wind is the same in the region of the space where the UAV is flying.Under these circumstances, the wind influence in the torque can be neglected.
On the other hand, the following equation represents the drag force [36]: where   is the drag coefficient, which is usually determined experimentally and collects the complex dependency, A is the area exposed to the wind,   is the density of the air, and V is the relative velocity of the flying object with respect to the wind.Since the air flow is planar, it can be assumed that the drag force is fully exerted in the centre of the gravity of the vehicle.
In our work, this equation is divided by the mass.This way the expression is transformed to an acceleration ((40) to (43)) that can be easily introduced in the equations of the translational dynamics ((37) to (39)), where wind disturbances have been represented as   ,   , and   .
As the wind speed is a vectorial magnitude, in our experiment, we suppose the wind components X and Y are  twice the Z one.Due to this assumption, there appears a factor of 2 multiplying the wind speed in (41) and (42): In the free atmosphere, the wind is a balance between the Coriolis, centrifugal, and pressure forces acting on the air mass.But in the boundary layer, the mean wind velocity is also a function of the height [37], and it can be expressed as a logarithmic function.This fact is shown in the following: where V (=20) is the wind speed at 20 m of altitude in m/s, V  () is the wind speed at Z altitude in m/s,  is a constant related to the flight (in this experiment, the value is set to 1.5) which is dimensionless,   is the air density in Kg⋅m 3 ,   to   are the effective area of the quadrotor exposed to each component of the wind in m 2 ,  is the drag coefficient with respect to the wind which is dimensionless, Ẋ, Ẏ , and Ż are the velocities in the x-axis, y-axis, and z-axis in m/s, and sgn denotes the sign function.
The mean wind velocity can be considered constant during the experiments, but not its instant value.The most common assumption is to consider the wind turbulence as a stationary Gaussian random process [37].Considering this fact, in our experiment, the wind speed is simulated by a step with Gaussian noise at t = 4 s.The SNR between the average wind and the noise is 10 dB.The average wind speed is 12 m/s in the z-axis and 24 m/s in the x-axis and y-axis.These values match numbers 6 and 9 in Beaufort's scale (strong breeze and strong gale) [38].

Simulation
Results with Wind Variation.Figure 17, left, shows the tracking of the trajectory, the reference in blue, the trajectory with adaptive neural estimators in red, and without estimators in yellow.At the right side of Figure 17, the tracking error is shown with estimators (red line) and without estimators (blue line).In both figures, it is possible to see how the performance of the control strategy with the neural estimators is much better.Like in the case of the mass variation, the tracking error is the same until t = 4 s because before there is no wind disturbance, but from that moment on, the tracking error of the controller without the estimators increases significantly.
If the tracking according to each coordinate, X, Y, and Z, is represented (Figure 18), the contribution to the tracking error seems to be more balanced (reference, magenta; trajectory with adaptive neural estimators, red; trajectory without neural estimators, blue).For every coordinate, it is possible to see how the trajectory obtained by the controller with the neural estimators better fits the reference.Figure 18 also shows how the disturbance produces an important deviation around t=7s due to the big peak of disturbance in the y-axis which cannot be compensated without the adaptive neural estimator and it becomes a stationary error.This deviation can be also easily observed in Figure 17 in the PID line.Another interesting result which can be drawn from the previous figures is that we are not using a wind disturbance estimator for the Z coordinate (see Figure 4) but the tracking is still good enough.The reason is that adaptive neuromass estimator senses the wind disturbances in the z-axis as a virtual mass variation and it can compensate it.This is shown in Figure 19, where the estimate of the wind disturbance in the x-, y-, and z-axis is interpreted by the mass estimator as a mass variation.Indeed, the neural estimator (red line) fits reasonably well the real disturbances (blue line).
The controller has been extensively tested for different trajectories and the MSE numerical results are summarized in Table 5 for the different trajectories and for each coordinate, with the neural estimator (neuro) and without it (PID).The last column shows the absolute error.The best result for each component and trajectory is boldfaced.
Table 6 compares the values of the maximum error in this experiment for the same cases with before.
According to Tables 5 and 6, the controller with adaptive neural estimators provides less or equal tracking error for every tested trajectory.The minimal tracking error is achieved for the lemniscate trajectory in the z-axis, with a very small error value of 0.0005, 600 times less than the error value without the neural estimator.The maximum tracking error is obtained with the circular trajectory due to the high error of the initial conditions.
The controller with the adaptive neural estimators works also well when the wind follows other different profiles, such as a sinusoidal function.In the next experiment, the wind average speed at Z = 20 m has been set to Figure 20 shows the results.It can be seen how the performance of the controller without estimators is much worse than with the step wind profile.Nevertheless, the performance of the neurocontroller is like the previous ones.It is also possible to see the sinusoidal shape of the tracking error in Figure 20, right.

Conclusions
Intelligent control strategies are especially useful when the parameters change while the system is performing some tasks, and when the external disturbance are relevant, due to      the ability to learn and adapt to the changing conditions.This is a common situation in many UAV applications.In this work, a new intelligent control strategy based on neural networks has been proposed.It includes the design of neural networks that estimate the system parameter variations.They allow the UAV to follow different trajectories with small tracking error when disturbances due to mass changes and wind are included.
Simulation results show how the online learning of the neural estimators increases the robustness of the controllers,  reducing the effects of the mass variation and the wind on the UAV.Among other possible future works, we may highlight the study of the influence of other disturbances such as the ones generated by the engines.In addition, the analysis of the parallelization of this approach for real-time application could be another interesting research line and help to deal with the high computational demand of these systems.

Figure 2 :Figure 3 :
Figure 2: Offline training to identify the plant inverse dynamic.

Figure 4 :
Figure 4: Control system with mass and disturbance estimators.

Figure 6 :
Figure 6: UAV tracking of a linear trajectory (left) and its tracking error (right).

Figure 7 :
Figure 7: UAV tracking of a circular trajectory (left) and its tracking error (right).

Figure 8 :
Figure 8: UAV tracking of a helical trajectory (left) and its tracking error (right).

Figure 9 :1
Figure 9: UAV tracking of a cyclic helical trajectory (left) and its tracking error (right).

Figure 10 :
Figure 10: UAV tracking of a lemniscate trajectory (left) and its tracking error (right).

Figure 12 :
Figure 12: UAV tracking of a helical lemniscate trajectory with mass variation (left) and its tracking error (right).

13 refZ
Wind Disturbances 4.3.1.Wind Disturbance Model.The effect of the wind in an UAV in flight can be considered as a drag force and torque Complexity

Figure 16 :
Figure 16: Mass obtained by the neural estimator with a sinusoidal mass change profile.

Figure 17 :
Figure 17: UAV tracking of a helical lemniscate trajectory with wind disturbance (left) and its tracking error (right).

Figure 18 :
Figure 18: UAV tracking of X, Y, and Z coordinates, respectively, with wind disturbances.

Figure 19 :
Figure 19: Wind disturbance estimation in the x-and y-axis, top, and mass estimation (bottom).

Figure 20 :
Figure 20: UAV tracking of a helical lemniscate trajectory with sinusoidal wind profile disturbance (left) and its tracking error (right).

Table 1 :
Parameter values of the model.

Table 2 :
PID parameters for each variable.

Table 3 :
Comparison of the MSE of the tracking error for different trajectories with mass variation.

Table 4 :
Comparison of the MAX of the tracking error for different trajectories with mass variation.

Table 5 :
Comparison of the MSE of the tracking error for different trajectories with wind disturbances.

Table 6 :
Comparison of the MAX of the tracking error for different trajectories with wind disturbances.