*4.3. Bs-ANN Offline Training by Particle Swarm Optimization*

Inspired by the social behavior observed in fish schools and bird flocks, particle swarm optimization (PSO) has been proposed as an effective solution for solving a wide range of optimization problems [36]. The use of intelligent agents, called particles, allows this algorithm to iteratively find the best solution on a defined space of searching. For this reason, potentials of PSO has been properly exploited in different engineering and researching applications, such as tuning of automatic controllers [37] and artificial neural networks training [38]. In the second experiment, the PSO is used for the offline training of the BsNN (selection of the initial weights). The training process is performed while the system is commanded to reach a step reference for vertical translational motion, where the closed-loop response information is used for designing the objective function *fo* to be minimized.

Figure 11 portrays the closed-loop response of a second order system. Here, it can be observed that there exist several parameters can be used in the design of the objective function in order to minimize the tracking error and the control efforts: *tr*, *ts*, *Mp*, and *tp* stand for the rise time, settling time, maximum peak, or overshoot and peak time, respectively.

**Figure 11.** Time response of a closed-loop controlled second order dynamical system.

In this study, only the overshoot data are used as design parameter of the following objective function

$$f\_{\mathcal{o}} = \epsilon \left( M\_{\mathcal{P}} + \text{ITAE} \right) + \kappa \left( \text{ISCI} \right) \tag{41}$$

where the coefficients = 0.5 and *κ* = 0.1 penalize the error and the magnitude of the control inputs, respectively. On the other hand, the integral time absolute error (ITAE) index is computed as follows

$$\text{ITAE} = \int\_0^t t|e\_z| \, dt \tag{42}$$

here *ez* is the tracking vertical error and *t* is the time variable. Additionally, the integral squared control input (ISCI) term is introduced in Equation (43).

$$\text{ISCI} = \int\_0^t u^2 \, dt \tag{43}$$

In contrast with the previous experiments, it has been selected the following Hurwitz polynomial:

$$P\_d(\mathbf{s}) = (\mathbf{s}^2 + 2\mathcal{Z}\_\mathbb{f}\omega\mathbf{c}\mathbf{s} + \omega\mathbf{c}^2)^2 (\mathbf{s} + P\_\mathbb{c})\tag{44}$$

here *ωnc* , *ζc*, *Pc* > 0, are the controller adjustment parameters. Therefore, concerning Equation (22), the control gains can be selected as follows for ensuring closed-loop stability and the properly tracking of the planned trajectory

$$\begin{aligned} \beta\_{4\_z} &= 4\zeta\_c \omega\_c + P\_c \\ \beta\_{3\_z} &= 2\omega\_c^2 + 4\zeta\_c^2 \omega\_c^2 + 4P\_c \zeta\_c \omega\_c \\ \beta\_{2\_z} &= 4\omega\_c^3 \zeta\_c + 2P\omega\_c^2 + 4P\_c \zeta\_c^2 \omega\_c^2 \\ \beta\_{1\_z} &= 4P\_c \omega^3 \zeta\_c + \omega\_c^4 \\ \beta\_{0\_z} &= P\_c \omega\_c^4 \end{aligned} \tag{45}$$

For the third experiment, the quadrotor take-off stage is analyzed. In order to improve and ease the tuning process, the control parameters are properly computed online by using artificial neural networks which trained offline by a PSO framework.

In the Algorithm 1, it is presented the pseudocode for the training process, where a simulation time of 10 seconds is adopted.


The MATLAB optimization toolbox is used for the execution of the PSO algorithm. It is worthwhile to note that the procedure in Algorithm 1 is evaluated in each iteration of the optimization process, in order to determine the best set of control parameters who minimizes the objective function, which has been designed in function to the vertical motion tracking error, as well as the control input effort. Moreover, for this simulation experiment the PSO algorithm is configured with the dimensions of the search space defined by the low and upper boundaries *lb* = −5 and *ub* = 5, respectively, and a swarm size of 50 particles.

Additionally, in order to highlight the performance of the introduced novel adaptive robust control strategy, in this section it is illustrated the applicability of offline training of Bs-ANN neural networks by description of two relevant scenarios: in the first the offline training is carried out for determining initial values of control parameters *ζ<sup>c</sup> ω<sup>c</sup>* and *Pc* without using the online learning. On the other hand, online training is considered for computation of the parameters values throughout second scenario. Henceforth, we identified the scenarios, respectively, as fixed and adaptive. The yielded results are portrayed in Figures 12 and 13.

It is worth to mention that from Figure 12 it is observed that the performance for both scenarios looks similar. Nevertheless, the control signal efforts and the error are significantly decreased by using the adaptive strategy. The ISCI and the ITAE indexes are used also for a quantitative comparison and is summarized in Table 4 for both cases in experiment 3.

**Figure 12.** Tracking motion for experiment 3: (**a**) First scenario. (**b**) Second scenario.

**Table 4.** Computed ISCI in experiment 3.


It is important to point out that in first scenario it is also achieved an acceptable performance of the introduced control approach. The tuning procedure of the control gains in automatic control systems is not always an easy tasks since it depends on the designer experience for selecting the control gains. Thus, after a properly setup of the PSO scheme, it is possible to ease the tuning process where several control gains or parameters need to be selected: five gains in the present study. Moreover, in Figure 12, we highlighted the useful of the offline and online training process in the quadrotor motion control. Here, large overshoot and oscillation is avoided from the the closed-loop response by an efficient implementation of the adaptive robust motion control strategy.

On the other hand, in Figure 13, it can be appreciated the effects for using the online training of the Bs-ANN in contrast with the fixed case utilized in the first scenario of third experiment. According to the information presented in this figure, it is corroborated that by using the full adaptive scheme it is possible to improve the closed-loop response of the quadrotor system by suitably adjusting the control parameters. Notice that the introduced control scheme, it is able to perform efficiently regulation and trajectory tracking tasks even though there is not full knowledge of the non-linear quadrotor mathematical model, as well as the external vibrating disturbances.

**Figure 13.** Fixed and adaptive control parameters used in experiment 3: (**a**) First scenario. (**b**) Second scenario.

#### *4.4. Quadrotor Subjected to Wind Gust Disturbances*

In this section, a Dryden wind gust model is used for the assessment of control robustness. From the set of Equation (4), it is evident that in presence of induced disturbance torques, the angular, as well as the translational trajectory tracking, will be deteriorated. Therefore, in this experiment, the quadrotor is disturbed while it is hovering and path following in order to simulate different scenarios which it would usually face within a wide range of applications. Consider the wind gust mathematical model [39] given by

$$\xi\_{\eta}^{\chi}(t) = d\_{\text{tr}}^{s} + \sum\_{\sigma=1}^{n} \mathcal{A}\_{\sigma} \sin(\mathcal{O}\_{\sigma}t + \mathcal{q}\_{\sigma}) \tag{46}$$

for *η* = *φ*, *θ*, *ψ*. Expression (46) considers that the disturbance caused by wind field is proportional to the wind speed [39], which is described as a family of time-varying excitations. On the other hand, *σ* and *ϕσ* are randomly selected frequencies and phase shifts, respectively; *<sup>n</sup>* is the number of sinusoids, <sup>A</sup>*<sup>σ</sup>* is the amplitude, and *<sup>d</sup><sup>s</sup> <sup>w</sup>* is a static term for wind disturbance. Thus, the mathematical expression in (46) can be integrated in (5) for this simulation experiment as torque disturbances *ξφ*, *ξθ* and *ξψ*, with *n* = 6 for *φ* and *θ*, and *n* = 7 for *ψ*. Disturbance parameters are summarized in Table 5.


**Table 5.** Values for simulated torque disturbances.

Consider the following planned references for lateral and longitudinal quadrotor motion in this experiment,

$$\begin{cases} x^\star = 5\cos(T) + \cos(3T)\cos(T) \\ y^\star = 5\sin(T) + \cos(3T)\sin(T) \end{cases} \tag{47}$$

with *T* = 0.1*t*, and the Bézier based motion profile for vertical motion defined by Equations (30) and (52) with the following data: Γ<sup>0</sup> = 0, Γ*<sup>f</sup>* = 5, *T*<sup>1</sup> = 2, *T*<sup>2</sup> = 10, *T*<sup>3</sup> = 57 and *T*<sup>4</sup> = 65. Additionally, the yaw motion is regulated about a constant angle *ψ*- = 0 rad. Soft transition between initial condition and the regulation point is accomplished by a Bézier polynomial.

Figures 14 and 15 describes the effective performance of the adaptive robust motion control scheme (20), which compensates the disturbance forces induced by the wind gust model introduced in (46). Moreover, it is evident excellent levels of oscillations attenuation by using our control approach.

**Figure 14.** Trajectory tracking for the experiment 4.

**Figure 15.** Path following on the plane for the experiment 4.

From Figure 16, it is observed that the quadrotor is able to efficiently perform trajectory tracking tasks in spite of there is not previous information of the disturbance torques while tracking the planned references introduced in (47). On the other hand, the control input forces and torques generated by the proposed controller are presented in Figure 17. Here, it is appreciated a properly compensation of the disturbance effects which by the computed control inputs. The closed-loop system response for rotational dynamics is plotted in Figure 18, where it is corroborated an efficient performance of the introduced adaptive robust control approach, as done in previous experiments. It is important to mention that during experiment 4 it is adopted the same process for the computation of the control gains in the first experiment.

**Figure 16.** Translational motion tracking for experiment 4.

**Figure 17.** Computed control inputs in experiment 4.

Finally, in Figure 18, it can be seen the control parameters for rotational motions, which are computed online by means of the adaptive BS-ANN scheme. In addition, it is corroborated that even though there is not available information from derivatives of the angular references, the under-actuation problem is properly solved by the use of the neural networks and the integral reconstructors, thereby a good tracking of the online computed references *φ* and *θ*is achieved.

**Figure 18.** Dynamic rotational closed-loop response for the experiment 4: (**a**) Computed rotational adaptive control parameters. (**b**) Angular tracking motion.

## *4.5. Robustness against Uncertainty of Quadrotor Mass*

Another important issue for controlling a quadrotor is the variations of the nominal mass. Notice that the online computed references in (8) which define a proper motion on the plane depends on the nominal mass. Therefore, the quadrotor is supposed to follow the references considering the nominal mass value. Thus, during this experiment, it is probed if the vehicle flight may be deteriorate significantly when an extra mass is added.

Consider the following mass variation for this experiment

$$m = m\_{\rm tr} + \mathcal{M}\_{\Delta}(t) \tag{48}$$

where *mn* = 0.973 stands for the nominal quadrotor mass in kg, and MΔ(*t*) is an abrupt change of the mass quadrotor described by a modified impulse function given by

$$\mathcal{M}\_{\Lambda}(t) = \begin{cases} \left(\frac{1}{\sqrt{2\pi\sigma\_{\Lambda}^{2}}}\right) e^{-\left(\frac{\left(t-a\right)^{2}}{2\sigma\_{\Lambda}^{2}}\right)} + b & 0 \le t < 20.4\\ \left(\frac{1}{\sqrt{2\pi\sigma\_{\Lambda}^{2}}}\right) e^{-\left(\frac{\left(t-c\right)^{2}}{2\sigma\_{\Lambda}^{2}}\right)} + d & t \ge 20.4 \end{cases} \tag{49}$$

with *a* = 20.25, *b* = 0, *c* = 19.55, *d* = 0.7, and *σ*<sup>Δ</sup> = 0.4. During the experiment it is adopted a spiral shape planned reference given by the next parametric equations

$$\begin{aligned} x^\star &= r \cos(T) \\ y^\star &= r \sin(T) \end{aligned} \tag{50}$$

where

$$r = 5 + 0.2\cos(t)\tag{51}$$

and *T* = *<sup>t</sup>* <sup>6</sup> . Inspecting Figure 19, it is appreciated that the abrupt variation in the quadrotor mass does not affect significantly the following of the planned reference. In Figure 20, it is observed a slightly deviation of the quadrotor angular tracking in contrast with the nominal references *θ*- *<sup>n</sup>* and *φ*- *<sup>n</sup>*, computed with the nominal mass. Moreover, it is evident that after a brief period of time the quadrotor is able to recover from the perturbation and perform a proper tracking of the desired references thanks to the robustness of the proposed control scheme.

**Figure 19.** Simulation results for experiment 5. (**a**) Path following. (**b**) Mass variation given by Equation (48).

In Figure 21a, it is presented the compensation to the mass variation at 20.4 s by the control input *u*. Figure 21b portrays the vertical motion which is performed before the path following, and is given by the following Bézier polynomial

$$z^\* = \begin{cases} \begin{array}{c} \Gamma\_0 \\ \Gamma\_0 + \left(\Gamma\_f - \Gamma\_0\right) \mathcal{B}\_z(t, T\_1, T\_2) \\ \Gamma\_f \end{array} & \begin{array}{c} 0 \le t < T\_1 \\ T\_1 \le t < T\_2 \\ t \ge T\_2 \end{array} \end{cases} \tag{52}$$

where Γ<sup>0</sup> = 0 and Γ*<sup>f</sup>* = 5, given in meters, stand for the desired initial and maximum vertical positions. The time values given in seconds are as follows: *T*<sup>1</sup> = 2, *T*<sup>2</sup> = 10. In addition, B*<sup>z</sup>* is the Bézier polynomial introduced in (30) with *Ti* and *Tf* as the initial and final transition times. Moreover, *n* = 6, and *r*<sup>1</sup> = 252, *r*<sup>2</sup> = 1050, *r*<sup>3</sup> = 1800, *r*<sup>4</sup> = 1575, *r*<sup>5</sup> = 700, *r*<sup>6</sup> = 126.

**Figure 20.** Reference tracking results for experiment 5.

**Figure 21.** Simulation results for experiment 5. (**a**) Main force control input. (**b**) Controlled vertical motion.

Future studies will address other methodologies for trajectory generation. Interested readers are referred to [40,41] and references therein for further information on trajectory generation. Moreover, algebraic estimators [42] will be explored for determining variation in the quadrotor nominal mass due to unknown payload and damage or failure in the quadrotor frame.

## *4.6. Discussion of Results*

Throughout the presented experiments in this work, it is corroborated that the introduced control scheme is able to properly leads the quadrotor to stable scenarios in spite of the presence of external forces and torque disturbances, as well as mass uncertainty. Different from the important adaptive robust contributions proposed in [21–23], in our approach disturbance observers are unnecessary, only positions measurements are required for motion control, and the use of high frequency discontinuous control actions, as a consequence of the use of signum functions, is avoided. Additionally, due to the low dependency of the quadrotor non-linear mathematical model, the robustness against external disturbances and since it is not required the error derivatives for the implementation of our control scheme, we widely recommend this as an viable strategy for controlling other autonomous systems.

## **5. Conclusions**

A novel adaptive robust neural motion control scheme for quadrotor systems has been introduced in this study. The proposed controller guarantees that the desired trajectory can be tracking by the quadrotor vehicle. The control framework is composited by using dynamic compensators along with an adaptive strategy based on B-spline artificial neural networks. Moreover, an artificial intelligence mechanism based on PSO theory was properly employed for improving the design of the control strategy, as well as the dynamic closedloop response of the quadrotor system, where ITAE and ISCI metric indexes have been used for measuring the control performance. The introduced research is particularly important because of its potential application in motion tracking control of quadrotor systems, where the use of neither tracking error derivatives nor disturbance observers is required. Several simulation experiments were proposed for purposes of performance and robustness assessment. It was corroborated that, by using the introduced control scheme, the quadrotor dynamic response is sufficiently robust for driving the system to stable scenarios. Vibrating disturbance forces and torques, uncertainty of the quadrotor mass, and wind gusts affecting the quadrotor stable motion were used for testing the control scheme robustness. The suitable integration of adaptive and robust control allows to compensate external disturbances during the quadrotor navigation and soft-motion during take-off and landing. Additionally, the quadrotor performance is improved significantly in contrast when it is adopted fixed values for the control gains. The obtained results, thus, prove that the controlled quadrotor system is able to achieve acceptable control accuracy levels for both trajectory tracking and path following in spite of been subjected to undesired disturbances. Finally, it is worth pointing out that the proposed control strategy can be further extended for the motion control of different autonomous systems subjected to external vibrating disturbances, which will be addressed in future works.

**Author Contributions:** Research, H.Y.-B., F.B.-C., R.T.-O., A.F.-C., C.S., D.S.; Methodology, H.Y.-B., F.B.-C., R.T.-O., C.S., D.S.; Software, H.Y.-B.; Formal analysis, H.Y.-B., F.B.-C., R.T.-O., A.F.-C.; Supervision, H.Y.-B., F.B.-C., R.T.-O., A.F.-C.; Writing, H.Y.-B., F.B.-C., R.T.-O., A.F.-C., C.S., D.S., Project administration, H.Y.-B. All authors have read and agreed to the published version of the manuscript.

**Funding:** This research received no external funding.

**Institutional Review Board Statement:** Not applicable.

**Informed Consent Statement:** Not applicable.

**Data Availability Statement:** Not applicable.

**Conflicts of Interest:** The authors declare no conflict of interest.
