Robust Nonlinear Trajectory Controllers for a Single-Rotor UAV with Particle Swarm Optimization Tuning

: This paper presents the utilization of robust nonlinear control schemes for a single-rotor unmanned aerial vehicle (SR-UAV) mathematical model. The nonlinear dynamics of the vehicle are modeled according to the translational and rotational motions. The general structure is based on a translation controller connected in cascade with a P-PI attitude controller. Three different control approaches (classical PID, Super Twisting, and Adaptive Sliding Mode) are compared for the translation control. The parameters of such controllers are hard to tune by using a trial-and-error procedure, so we use an automated tuning procedure based on the Particle Swarm Optimization (PSO) method. The controllers were simulated in scenarios with wind gust disturbances, and a performance comparison was made between the different controllers with and without optimized gains. The results show a signiﬁcant improvement in the performance of the PSO-tuned controllers.


Introduction
During the last decade, we have seen the presence of unmanned aerial vehicles (UAVs) in different applications, whether in the commercial industry or high-end application fields such as the military, avionics, and artificial intelligence [1]. A UAV is a pilotless aircraft with the ability to fly and stay in a hover state without any human interaction. They are piloted remotely through control commands from a ground station [2].
In general, depending on the characteristics of the UAV, its application, speed, weight, and operation vary. UAVs are generally divided into four categories: fixed wing, fixed-wing hybrid, multirotor, and single rotor. Fixed-wing UAVs are vehicles based on wings, a main body, a motor, and a propeller. This type of UAV requires unique and extensive training to pilot them. One of its main advantages is the flight time of several hours. However, this vehicle is not able to perform a backward flight, hover, or rotate. The next type is the fixed-wing hybrid, which combines automated and manual gliding. Although that is an advantage, this type of UAV could be better at forward flight and hovering. Multirotor vehicles are the most common in the industry. There are different types of multirotors, and they are generally classified by the number of rotors or propellers they have. There are tricopters, quadcopters, hexacopters, and octocopters. The most used are quadcopters since they have a vertical landing, small size, and simple structure [2,3]. The last one is the single-rotor UAV, which has a single rotor as its name mentions. This type of UAV is less developed than the others since it is complex to design. Nevertheless, they have distinct advantages, like a heavy payload, a mixture of hovering with long endurance, and fast forward flight [4].
In recent years, it has been concluded that UAVs are no longer sufficient to fly autonomously, and more advanced technologies are needed to bring innovations and improvements to achieve more complex goals. While UAVs excel in speed and flight duration, innovative solutions are imperative to address their limited robustness, a pivotal consideration for large-scale deployment and diverse task completion [2].
It is common to assume that a single-rotor system resembles a conventional helicopter; however, this assumption only holds partially. The fundamental distinction lies in their dynamic configuration and weight-handling approaches [5]. Unlike helicopters, which employ a primary rotor and tail rotor to counteract asymmetry and reaction torque, singlerotor systems rely on fins or control surfaces to achieve stability and direction [4].
Helicopter dynamics revolve around the lift and control generated by the main rotor, counteracted by tail-rotor reaction torque [6]. Conversely, single-rotor systems employ fins and control surfaces to manipulate airflow, enabling precise aircraft control. Furthermore, single-rotor systems, generally lighter than traditional helicopters, leverage more efficient configurations and sophisticated control systems, compensating for dynamic and weight differences [4].

Single-Rotor UAV
Single-rotor UAVs only have one propeller, and although it could be seen as a disadvantage since it would lose maneuverability, in reality, the energy use also decreases. Using only one rotor increases the flight efficiency, reduces energy consumption, and allows for an important feature: the VTOL (vertical take-off and landing) [7]. Different single-rotor UAV designs have been introduced over the years. A single rotor composed of two fixed-wing airplanes was analyzed in [8], in which two attached rotating airplanes can be modeled and controlled. Another variation studied is the single-rotor aerial vehicle, which features a model with a single rotor and a tail rotor [9]. In [4], a different approach based on the design of a single-rotor VTOL is presented. This design is based on thrust vectoring through a single propeller and four deflecting fins actuated by small motors. In that work, the process design is simplified to obtain lower costs and an increase in the number of applications.
Path following and trajectory tracking constitute primary control challenges for UAVs [10]. The PID (Proportional Integral Derivative) controller is commonly used in UAVs [11] due to its versatility and applicability to various UAV variants. However, the PID has limitations in handling complex systems, uncertainties, disturbances, and nonlinearities, making more robust control techniques desirable. The PID does not require a mathematical model of the system but has limitations when systems are complex. Changes in the system parameters can affect the stability and performance of the control if the parameters are not tuned properly. In addition, the PID is not efficient for handling uncertainties and disturbances compared to other more robust controllers. Because the PID is designed on linear assumptions, it has difficulties controlling nonlinear systems. The elimination of steady-state errors is also a limitation that reduces the control performance [12]. For this reason, more robust nonlinear control techniques are considered in this work to deal with such issues.
This work explores robust nonlinear control techniques such as the Adaptive Sliding Mode (ASM) and Super Twisting (ST) for single-rotor UAVs. ST is a control technique used for nonlinear dynamic systems based on the theory of sliding mode and trajectory tracking to zero. Several approaches have been used in the literature to quantify the position control of small-rotor UAVs. In [13], it is demonstrated that ST control is one of the most powerful second-order sliding mode controllers for systems with a relative degree equal to one. The main contribution of this work is the robust ST control for solving the attitude-tracking problem of a quadrotor subject to perturbations. Limitations in the controller are also observed. The main one is the presence of chattering [14]. Although the controller is shown to be robust, it has limitations with regard to working with uncertainties, requiring extensive knowledge for tuning [15].
Sliding mode techniques have also been applied in the control of UAVs. For instance, [16] presents a bond graph (BG) model and a robust cascaded controller for a twin-rotor system. The BG model accounts for all the energetic and dynamical couplings. An adaptive integral backstepping sliding mode controller is used in an outer loop to control the yaw and pitch dynamics. Although the proposed controller was able to obtain less chatter and lower the following error than the others during experiments, it did so at the expense of an increased response time, which implies a trade-off between accuracy and speed. In [17], a robust and fault-tolerant controller is designed to determine the position and attitude dynamics by using a higher-order integral dynamic sliding mode controller. The proposed method requires redundant actuators, which increases the cost of implementation. Here, the performance of finite-time disturbance observers used to estimate the combined effects of parametric uncertainty, external disturbances, and actuator faults is satisfactory, but the estimators start deteriorating after intermittent faults. Additionally, in [18], the attitude-position tracking control of fully actuated multirotor aerial vehicles equipped with fixed rotors and subject to matched model uncertainties and disturbances is presented. Here, a joint geometric attitude-position control law is designed by using a multi-input smooth second-order sliding mode strategy. The simulations show that the proposed method reduces the chattering and improves the tracking performance in comparison with Super Twisting and second-order sliding mode controllers, but it still presents oscillatory behavior, which is mainly caused by the unmodeled rotor dynamics. Finally, ref. [19] presents the development of a terminal sliding mode attitude-position quaternion-based control of a quadrotor unmanned aerial vehicle (UAV). The dynamics of the UAV are split into an attitude and position loop to design independent control laws. The control law implemented for each loop is the hybrid terminal sliding mode and quaternion controller. The results obtained in simulations showed better performance when compared with a higher-order sliding mode controller, but like the other previously mentioned works, they did not test the method with sustained wind gust disturbances as we did in our work.
Another nonlinear control technique for complex dynamic systems is the Adaptive Sliding Mode [20]. It also has the ability to handle uncertainties in the system model. It is based on the theory of bringing the system's state to a sliding surface controlled by a linear controller [21]. The ASM has the ability to provide smooth and precise control, but the outstanding feature of the ASM is its ability to reduce the chattering effect. This effect is an unwanted vibration in the ST controller under certain conditions. The ASM has an inherent disturbance rejection capability to compensate for disturbances without requiring additional control action [22].
Regarding the implementation of the ASM in the SR-UAV, it is beneficial due to the nonlinear complexity of the system and the variable perturbations it faces in different flight conditions. The adaptive capability of the ASM is presented as a prosperous solution for controlling a nonlinear system such as the SR-UAV [23]. However, the limitation of the complexity of the ASM implementation must be kept in mind, as well as the requirement for the selection of the controller parameters and the detailed knowledge of the system model [24].
To deal with uncertainty and external disturbances in UAVs, there have been previous works; for instance, ref. [25] addresses the design of a robust controller based on nonlinear estimators for a quadrotor. This controller ensures the tracking of desired references even with parameter variations and external disturbances. It uses high-order sliding mode estimators to estimate the disturbances, which can then be canceled by the controller, thus improving the dynamic behavior of the controlled system. However, experiments to show the performance of the proposed controller in more complex trajectories, as the helical route we use in our testing, are missing. Another type of perturbation implementation is based on the Von Karman wind model [26]. This model allows one to understand and characterize different types of wind, such as steady wind, turbulent flow, wind speed variations, and a propulsor vortex. By combining this model with the mathematical representation of the UAV, the motion of the UAV in a wind field can be illustrated from three different perspectives: speed, force, and energy.

Particle Swarm Optimization
One of the main problems found in UAV controllers is the tuning process over which the controller gains are adjusted by trial-and-error to minimize the settling time and the corresponding oscillations of the closed-loop system. Many gains need to be adjusted depending on the number and the type of controllers in the system. Each set of gains represents a new possible scenario to obtain the best conditions for the experiment, which can make tuning rather long, tedious, and costly. Particle Swarm Optimization is a global metaheuristic optimization method that belongs to the family of algorithms based on the swarm intelligence concept introduced by Kennedy and Eberhart [27]. This method is based on the concept of swarming, which is inspired by the collective behavior of social animals, especially bird flocks and fish schools. A swarm is a population of agents which perform tasks by interacting locally with each other and with an environment. There is no central control, and their behavior arises from stochastic local self-organization and interaction. These swarm individuals could be more satisfied with limited capabilities; the goal is achieved by exchanging information obtained through the behavioral and interaction parameters [28]. Specifically, this type of optimization is suitable for solving problems where the optimal solution is a point in a multidimensional parameter space. Each particle is evaluated to determine its fitness value. At each iteration, a fitness value is calculated and compared with the previous value to obtain the best one. This social interaction is direct, which means that each particle is influenced by its memory (the best solution so far) and by those of the other agents. Individual and global best positions are updated, where if a stop criterion is not met, the velocity and position are updated to create a new swarm. The two fundamental operations are the velocity and position update. The actual velocity depends on the old velocity, the individual particle's experience, and the whole swarm's experience. Each term has an associated weight constant [29].
PSO has been used in the control of UAVs due to the difficulty of adjusting the parameters of the controllers. For instance, the camera-position control on a UAV is presented in [30]. The designed PID controller keeps the camera stable. Traditional fitting methods and evolutionary/bioinspired algorithms such as PSO are discussed in this article. It is highlighted that PSO is used due to its stable convergence, both in terms of its dynamic and static performance and its good computational efficiency, which allows for improving the system performance through error minimization. The research concluded that the PSOtuned PID controller offers accuracy and convergence stability, which makes it the preferred option. In [30], PSO is applied to camera-position control, offering stable convergence and improved system performance compared to manual tuning. The approach proposed in [31] is the modified PSO (MOPSO), which optimizes the gains of a PID controller for an AR drone quadcopter. The MOPSO algorithm demonstrates the efficient adjustment of the PID parameters, resulting in no overshoot, zero steady-state errors, and a short rise time. Similarly, in [32], PSO is used to optimize parameters in a four-rotor PID controller, achieving a shorter tuning time and reduced overshoot. However, despite these achievements, there is limited research on using PSO in UAV control with nonlinear methods. For instance, in [33], PSO is employed to tune the gains of three nonlinear control strategies for quadrotor attitude control and trajectory tracking. The GTNC controller stands out as it consistently converges to the desired attitude and effectively reduces the position error and basin of attraction to zero, making it more reliable at high speeds. However, it requires more processing time compared to other controllers. In [34], a control strategy is proposed for a quadrotor with a sliding mode controller (SMC) that will use the gains obtained from Lyapunov stability analysis and PSO. The controller is shown to be stable with the gains obtained from PSO. A PID controller is also added to the SMC control law when a fault is detected to stabilize it. The results show that this control technique meets the desired requirements given the gains obtained by the PSO algorithm.
The main contributions of this paper strengthen our existing knowledge in two aspects: • First, in this research, robust nonlinear controllers are used. To the best of our knowledge, none of these approaches have been applied before with single-rotor UAVs. We show that these controllers are effective in improving SR-UAV performance, especially under wind gusts disturbances. • Second, we prove that the gain values obtained with the PSO algorithm satisfy Lyapunov stability conditions for Super Twisting and Adaptive Sliding Mode controllers.
In addition, to address the challenging and laborious task of tuning the multiple controller parameters, we used an evolutionary PSO method. This automated tuning approach has allowed us to find the optimal parameter values for the PID and the other two nonlinear controllers. The results obtained in simulation scenarios, with the presence of significant wind disturbances, have demonstrated the superiority of the PSO-tuned controllers compared to the controllers tuned by the traditional trial-and-error method. Also, we have to mention that corrections were made to the original mathematical model obtained in [4].
It is important to note that a simulation is an initial and fundamental stage in the process of developing and evaluating the proposed method. At this initial stage of the project, simulations provide an opportunity to explore and validate the operation of the controllers virtually. The validation of a method is an iterative and gradual process [35]. Once the controllers have been validated and optimized through simulation, the next stage may involve testing in a controlled laboratory environment or even on a physical prototype if the necessary resources are available at later stages of the project. In this way, the proposed approach is strengthened as validation progresses and more experimental evidence is acquired. This paper is organized as follows: Section 2 presents the design and mathematical model of a single-rotor unmanned aerial vehicle. Section 3 proposes three different controller methods assuming hovering flight conditions. In Section 4, a PSO algorithm for the tuning process is presented. The results of the experiments are presented and discussed in Section 5. Section 6 presents the comparative study of the performance of the three controllers, and finally, Section 7 concludes and presents future work.

Single-Rotor UAV Dynamics and Von Karman Wind Model
The single-rotor UAV propulsion design consists of a single rotor and four control fins that are placed symmetrically in the lower part of the aircraft and directly below the propeller, as shown in Figure 1. The distance between O and C is the length L, between C and A i (i = 1, 2, 3, 4) is the length r, and between B and E is the length R. Each control fin is directly attached to a servo, producing a surface that deflects the air propelled by the rotor and then obtaining a torque that produces the translational movement [4]. The control system comprises five outputs: the main one is the thrust of the main rotor, and the other four regulate the movement of the control fins. The required directional torque is generated by using the four fin controls to maintain both positive and negative angle of attack (AoA) behavior.
This section introduces the mathematical modeling analysis based on [4]. The UAV kinematics were calculated in Euler angles for drone motion. There are two three-dimensional coordinated inertial frames: one called the body frame (X 0 , Y 0 , and Z 0 ), which is the one that is attached to the center of mass of the SR-UAV, and the second inertial frame (X 1 , Y 1 , and Z 1 ) that is placed at a point of escape, as shown in Figure 2.  According to the laws of mechanics, the forces and moments in a body frame where the origin coincides with the center of mass of the drone [36] are given by where the notation () B f indicates a vector in the body frame, the point indicates differentiation with respect to time, υ B f is the velocity of the center of mass of the UAV with respect to the inertial frame, ω B f is the angular velocity of the body frame with respect to the inertial frame, m is the mass of the UAV, and J B f is the constant inertia in the body frame. F B is the sum of the forces acting on the UAV, and T B is the sum of the moments of those forces at the center of mass. The inertia matrix J is established as The kinematics express the change in time of the velocity of the center of the UAV mass and the angular velocity with respect to the inertial frame (given in the body frame). Therefore, to recalculate the position and attitude of the UAV based on time, the following equations are used: where O = [x, y, x] T is the position of the UAV center of mass (inertial frame), υ B f = (u, v, w), and R BI is the rotation matrix that passes from the body frame to the inertial frame given by where c and s are the cosine and sine of the angles, respectively, and [φ, θ, ψ] are the roll, pitch, and yaw angles, respectively. Then, we have the following equation for the angular velocity:ȧ is the attitude of the SR-UAV and ω B f = [p, q, r] is the angular velocity. R BI is the simplified matrix of the kinematics of the Euler angles, obtained by differentiating R BI with respect to time:Ṙ Furthermore, the torques generated are defined in vector τ = [τ φ , τ θ , τ ψ ] T as follows: where sθ 1,2,3,4 is sin θ 1,2,3,4 , L and r are the lengths, K f orce is the maximum force generated by the propeller, and u is the motor s input. The linear and angular dynamics of the model are shown below: where [ẍ,ÿ,z] are the linear accelerations, sθ i is sin(θ i ), and R G is the matrix of gravity. In relation to the angular dynamics, the angular acceleration vector [φ,θ,ψ] is associated with the inertia matrix J, represented by [J xx , J yy , J zz ]. The terms ξ x,y,z refer to external disturbances in the form of turbulent wind gusts, which with the following equations are expressed as drag forces [37]: where ρ is the air density, B is the drag coefficient, h is the area of the SR-UAV in each axis plane, and η I f is the wind velocity in the inertial frame as whereη I f is the mean wind velocity while u , v , and w are wind deviations determined by the Von Karman wind turbulence model. In this study, certain assumptions have been made to simplify the system's analysis and design. These assumptions are as follows: • The system is in a hover state; i.e., it maintains a stable position in the air. This assumption has been considered because the main objective of this study is to analyze the behavior of the flaps in static conditions. By assuming this condition, it allows us to focus exclusively on the analysis of the effects of flap movements without the interference of other factors, such as the displacement of the system in a threedimensional space. Furthermore, the evaluation of the flaps in a hover state provides a fundamental understanding of their operation, which lays the foundation for future investigations in more complex flight situations. • The range of movement of the flaps is limited to a maximum angle of +15 degrees and −15 degrees. This assumption is based on the technical specifications of the system design under study. By restricting the range of flap movement within these limits, the aim is to evaluate the system behavior in a configuration that is technically feasible and easily implementable. As well, wider angles could lead to control and stability problems, while narrower angles could limit the effectiveness of the flaps in maneuverability and system performance.
The wind turbulence model uses the Von Karman spectral representation to add turbulence to the specified model by passing the white band noise through the appropriate filters. The mathematical representation is implemented per the Military Handbook MIL-HDBK-1797 [38]. According to military references, turbulence is a stochastic process based on the velocity spectrum [39]. The transfer functions are shown below [40]: where P u , P v , and P w are noise signals, and the parameters for a low altitude are given by [40] L w = z (23) where L u , L v , and L w refer to the turbulence scale lengths. The white noise signals are given by W 20 , which, according to the MIL-HDBK-1797 [38], shows the wind speed at the height of 6 m with a turbulence intensity light at W 20 = 15 knots.

Control System
This section will present three different controllers applied to the SR-UAV, considering a translational vector (x, y, z) and attitude (φ, θ, ψ) to control the six degrees of freedom.

PID
There are two controllers in the SR-UAV system: the translational and the attitude control. The PID controller is the most dominating form of control feedback used in the industry [41]. It assures satisfactory performances with a simple algorithm. The desired state can be obtained by adjusting the gains. Although using the trial-and-error tuning method might provide an accurate solution, finding optimal controller parameters is a long and sometimes extensive process for complex systems [42].
The PID controller is governed by the following equation: where K P , K I , and K D are the proportional, integral, and derivative gains, respectively; m is the manipulation signal; and e is the error signal [43].
In this case, a PID controller is used, as shown in Figure 3. There are three PID controllers, each with different inputs and outputs. The corresponding inputs are the coordinates x, y, and z, identified with index i, and three outputs are obtained from the PID controllers: Fp, which is the manipulation signal from the PID controller for the main motor (position z) and is used as a direct input to the plant (SR-UAV) as Fp. The other two outputs are φ des and θ des , which act as inputs to the P-PI cascade controllers.
Additionally, for attitude control, a set of three independent P-PI-type controllers is employed. Their inputs are φ des , θ des , and ψ zre f , and three different outputs are obtained: U 1 , U 2 , and U 3 . These outputs, in turn, enter the angle mixer (AM) block to obtain the θ angles for each of the fins.  Figure 4 shows the structure of the P-PI cascade controller with the AM to generate the angles of attack for the four control fins. As a result of the output of the P-PI, we have controller outputs U 1 , U 2 , and U 3 that enter directly into the block AM. This block subsequently obtains the four angles of the fins, which enter directly into the dynamics of the SR-UAV. The four angles of the fins are used to generate a counterbalance force. These fins are placed under the main rotor. They are adjusted with the angles to provide the necessary torque balance. They generate a force that counteracts the main rotor's torque. Balancing the torque that the main rotor generates is crucial to maintain stability and control during flight. The P controller uses the references for φ, θ des , and ψ re f to produce a reference for the p, q, and r that the PI controller uses, respectively. The block AM is a mixer of the signals obtained from the manipulation signals coming from P-PI (U 1 , U 2 , U 3 ) used to generate the angles for the UAV propellers as follows: For the simulation of the described SR-UAV, the parameters used were extracted from [4] for the evaluation. The simulation of this novel concept is restricted to small roll and pitch angles to limit speed and keep the SR-UAV fenced in a hover state.

Super Twisting
UAVs are affected by different external disturbances. Moreover, the physical model has inaccurate parameters and nonmodeled effects. More advanced controllers are needed to deal with these uncertainties, such as the sliding mode, which provides robustness against uncertainties and disturbances. This control technique is based on defining an internal function called the sliding variable, intending to design a control law that forces this variable to zero and maintains it around this value despite the disturbances and modeling uncertainties [44]. Discontinuous control from the SM has a chattering effect, a high-frequency change in the control signal. Chattering is an SM undesired behavior since it can cause actuator damage. One of the advanced techniques to mitigate chattering is Super-Twisting control, a branch of the sliding mode. The UAV model can be rewritten with the Super-Twisting method as follows [45]: where x is the system state and u is the control input. f (x) and g(x) are nonlinear continuous functions. Then, defining a classic linear sliding surface as where e is the error, e = x d − x, x d is the desired state, and λ is a constant greater than zero. The sliding variable is differentiated aṡ leading toṡ Using (32), it follows thatṡ The control law is defined as such that the behavior of the controller is described by where k 1 , k 2 > 0. Once the equations that govern the Super-Twisting controller were applied to the mathematical modeling of the SR-UAV system, it was implemented to substitute the PID in the translational control. The translational dynamics of the SR-UAV are underactuated, so feedback linearization cannot be conducted directly [46]. Therefore, a virtual auxiliary controller is used: where the virtual control U v * where * = x, y, z is performed by the following Super-Twisting control law: Subsequently, to meet the desired trajectories of x and y, the desired roll and pitch rotations are obtained from the following equations: On the other hand, the dynamics of z are stabilized by the input control: Figure 5 presents the Super Twisting in a cascade with a P-PI for translation and attitude control. There are three Super-Twisting controllers, one for each of the position signals x, y, and z with indices 1, 2, and 3. The following controller P-PI is connected in a cascade and remains the same as in the previous controller design. Stability is crucial to ensure that the controlled system converges to a desired state quickly and accurately. ST stability refers to the ability of the algorithm to keep the controlled system within acceptable limits over time, avoiding excessive oscillations or divergence. The finite-time stability of the ST is presented below with Equations (32)- (39).
For an equation to be a Lyapunov candidate, it must be that Vx = 0 and V(0) = 0. Next, modifications to the variables will be introduced as follows [46]: Therefore, it remains thatẋ The system is left as follows:ẋ where To verify the stability, the values obtained by PSO were taken for the variables x, y, and z, corresponding to the coefficients k 1 and k 2 . It is important to note that these values of the A matrices are obtained from PSO; i.e., the gains provided by PSO in the context of the system's stability. Subsequently, by using MATLAB with the PSO values, the "lyap" function was used to obtain the P matrices, representing solutions of the Lyapunov equation. Given these gains, the matrix A for each linear degree of freedom is defined as Therefore, the following Lyapunov function is proposed for the stability analysis: where P is a 2 × 2 positive definite matrix. The derivative of V is given bẏ where Q I is a symmetric matrix, defined as follows: The positive definite matrices P x , P y , and P z were obtained by using the lyap function of MATLAB: Each of these P matrices can be a solution to the Lyapunov equation, without a loss of generality:V

Adaptive Sliding Mode Control
As mentioned above, different control techniques contribute to eliminating chattering and guaranteeing the desired trajectories of UAVs in disturbed environments. The Adaptive Sliding Mode is a second-order controller that can adapt the varying system parameters to obtain the best control effects. This controller is based on Lyapunov theory, where the switching gains increase monotonically to remove the upper limit of uncertainty and never decrease due to the control structure [47]. The adaptive law allows for the proper adjustment of the switching gains, depending on the magnitude of the sliding variable [48]. The previously proposed nonlinear system from (32) and the control law from (33) are used. The equations that govern the controller are the following: where k 2 > 0 and the adaptive law iṡ Figure 6 presents the ASM in a cascade with a P-PI for translation and attitude control. There are three ASM controllers, one for each of the position signals x, y, and z with the indices 1, 2, and 3. The following controller P-PI is in a cascade and remains the same as in the previous controller design. Achieving stability in ASM control is very important, ensuring the system will operate safely and predictably under various conditions. Lyapunov stability theory provides a systematic approach to analyzing the stability of dynamic systems and design controllers that ensure stability. Using the Lyapunov equation, stability conditions can be established that guide the design of ASM control. The following Lyapunov equation is considered [48]: The inequality k b > (1/|s| 1/2 ( − k 2 ) > 0 represents an unknown upper bound for the gain, while (k 1 − k b ) < 0 and > 0 represent unknown perturbations, subject to the constraint || || ≤ H. Therefore, taking the derivative of Equation (62) as stated in [49] and assuming that k 1 > k min yieldsV Under the assumption that ι s and ι k are positive, the term ι s = k b |s| 1/2 + k 2 |s| − H can be simplified, resulting iṅ It is worth noting that the system can be reformulated as follows: where ι = min{ι s √ 2, ι k √ 2}, a = 1 2 , and ∂ = (−k a sign(|s| − µ) + |s| 3/2 + ι k |k 1 − k b |. The control is of practical finite time, and thus it is necessary to ensure that ∂ > 0. To this end, the following analysis is provided: Case 4: If k 1 ≤ k min , the following inequality is chosen: ι k > k min − |µ| 3/2 , in order to satisfy (−k a sign(|s| − µ) Since s i has been proven to be PFTS, the stability of the ASM is directly related to the gains provided by PSO, which in this case are k 1 , k a , and µ and Equation (71). When substituting the obtained values of PSO in the condition of ι k > k min − |µ| 3/2 , using the value of µ obtained from PSO, one sets a lower bound for the adaptive gain of the controller. This is essential to ensure that the partial term in the stability equation is positive, which in turn contributes to the stability of the system.

Particle Swarm Optimization Tuning
Modern heuristics, such as Particle Swarm Optimization, can improve the capacity of traditional trial-and-error techniques. PSO is a stochastic optimization technique that provides a population-based search procedure based on particles that change their position over time [50]. In this approach, particles fly in a multidimensional search environment. Each particle adjusts its position according to its own experience and the experience of the particle next to it, searching for an optimal solution (the best parameters for controllers). The algorithm is initialized with a population of random solutions, updating generations until the optimum is found [51]. The PSO algorithm used in this paper was based on the one introduced in [52] as a modification of the original, adding a new parameter: inertia weight, as well as the adaptive Particle Swarm Optimization of [53]. The inertial weight decreases linearly during the iteration.
The PSO algorithm is based on the principles of natural selection and the search algorithm, where individuals are particles that evolve by the exchange of information and the competition between them through generations. Each particle represents a possible solution to the problem. These particles update their trajectory according to their own experience and that of others. Each particle is treated as a point in a D-dimensional space, and pa is the particle. The representation of a particle is given by X I = (x pa,1 , x pa,2 , . . . , x pa,D ) as the position. The best position found by the particle is represented as x best . The best position found in the entire swarm is represented as x Wbest . The particle's velocity pa is represented as v [54]. The particles are updated according to the following equations: where d is the search direction; K 1 and K 2 are the cognition and social parameters, respectively, that in [53] both have a value of 1.494; w is the inertial weight; and rnd() is a random number with uniform distribution in the range of [0, 1]. Equation (72) represents the new speed of the particle according to its previous speed and the distance of its current position from its original position and the best global position. As a result, the particle is directed towards a new position according to Equation (73). The performance of each particle is obtained according to a predefined aptitude, which is related to the problem to be solved. The inertial weight proposed by Clerc is w = 0.729, which balances the global and local search capability [54]. The PSO algorithm can be applied to adjust the controller gains in order to ensure that the heuristic tuning process is eliminated, as well as to ensure an optimal control performance. PSO was used for the gains of the three types of controllers: the PID, ST, and ASM. Table 1 shows the parameters and gains of each of the controllers. In the table, the C in the abbreviations Translation C and Attitude C refer to the controller. The first column shows the gains that need to be optimized for the PID variant in both the translation and attitude P-PI controller, resulting in 18 gains. For the second variant, which is the ST controller, there are 19 gains. The third variant is the ASM controller, which requires 24 gains to be optimized. By displaying the gains in this way, it can be seen that there are too many gains to be adjusted, which is why a method like PSO is adequate for saving time and simulation costs, but mostly to find the optimal parameters of controllers which provide robustness against disturbances.

PID Super Twisting Adaptive Sliding Mode
Translation C Attitude C Translation C Attitude C Translation C Attitude C K I,z s kmin z a K I,z s -- Once the limits of the control parameters are defined, the particle population is initialized. For this case, there is a size swarm of N = 650, which is the number of seekers. We have Niter = 100, which is the number of iterations, and Nd, which is the number of dimensions, which will depend on the number of gains of the PID, ST, and ASM controllers. The swarm size is sufficient to find a set of gains where the solution with the minimum RMSE is obtained since the simulations were tested with different sizes. Increasing the swarm size did not provide better solutions. For the search engine parameters, we have c 1 = 1.5 and c 2 = 0.5. Different values were tested during simulations, and those are considered the best for the three control schemes. In matters of the inertial weight, there is the initial and the final where w0 = 0.9 and w f = 0.9, respectively, which was also varied and determined to be the best value for the three cases. The initial value for the RMSE was defaulted to 1000.
The PSO algorithm generates values for the controllers' gains; then, simulations are performed using these values. The metric for comparing and evaluating performance is the RMSE. The error in the trajectory is stated as follows: where N represents the total number of points in the trajectory and T represents the difference between the desired value and the actual value in each trajectory sample. The objective is to find the best values to minimize the RMSE Et and find the optimal values for the controller parameters.
In every iteration, PSO computed a set of parameters for the controllers, then a trajectory was simulated, and the RMSE was calculated. The RMSE was sent back to PSO to adjust the search, and the process started again in the next iteration. This process was repeated 5 to 7 times, since sometimes good parameters were not found. Repeating the whole search more than seven times did not provide better results.
There are computational limitations in the PSO algorithm when implementing it in real time on onboard computers [55], especially under conditions of low processing power. However, it is essential to note that PSO is run offline, so it is not expected to run in real time. Therefore, computational limitations must be considered during the driver tuning phase, as real-time implementation on low-power devices might require simplifying the models or reducing the number of particles in the search.

Simulation Results
The closed-loop system presented in Section 3 was simulated to obtain a preliminary evaluation of the proposed design's behavior and to compare the three proposed controllers: PID-PPI, ST-PPI, and ASM-PPI. The performance of the proposed controllers is tested with computer simulations on Simulink/MATLAB software. All the simulations include wind gust disturbances exerted on the SR-UAV while executing a helicoidal trajectory given by where ψ re f = 0 rad. The external disturbances in the simulation correspond to a moderate turbulent wind field described by the Von Karman wind model in Equations (13) The controller simulation implementation in this part is divided into two subsections. The first section involves implementing the simulation with the trial-and-error method to adjust the controller parameters. The trial-and-error method is an iterative process in which different parameter values are tried until a good system response performance is achieved [56]. This method starts from random gain values; in this case, all the controllers' initial gains started from one. Through an iterative process, the gains were varied until an RMSE value within acceptable limits was obtained. The RMSE is defined as follows [57]: where n is the total number of observations, y i is the desired value of the UAV trajectory at position i, andŷ i is the achieved value i. The validity of the obtained RMSE value was established by comparison with other RMSE values obtained in similar simulations, which were carried out with the same model conditions and parameters. The process of optimizing the optimal gains took approximately 110 h for each of the controllers. The computer used was a laptop with an Intel i7 processor @ 2.8 GHz and 16 GB RAM.
The gains for this first part of the simulations were obtained with the trial-and-error method shown in Figure 7. This method was used in 18 gains of the PID-PPI, 23 gains and parameters of the ST-PPI, and 23 gains and parameters of the ASM-PPI.
As for parameter tuning, we start with initial values based on a specific reference. From there, we iteratively adjust the parameters until the desired RMSE is achieved and then leave them fixed. The gain parameters for the PID controller are presented in Table 3. The gains of the attitude control P-PI are presented in Table 4. Table 3. PID controller gains with trial-and-error tuning.

Parameters Values
K P,x i, K P,y i 1.2 K I,x i, K I,y i 0.03 K D,x i, K D,y i 0.75 K P,z i 2.1 K I,z i 0.03 K D,z i 0.6 Table 4. P-PI controller gains with trial-and-error tuning.

Parameters Values
K P,x h, K P,y h, K P,z h 7 K P,x s, K P,y s 0.3 K P,z s 0.1 K I,x s, K I,y s 0.012 K I,z s 0.003 The simulation of the ST-PPI controller is presented with the parameters in Table 5. The gains for the ST controller are presented in Table 6. The gains for the P-PI controller were used as above and are shown in Table 7.

Parameters
Values Table 6. Gains for the ST controller with trial-and-error tuning. Table 7. Gains for the P-PI controller with trial-and-error tuning.

Parameters Values
K P,x h, K P,y h, K P,z h 3 K P,x s, K P,y s 0.1 K I,x s, K I,y s 0.01 K P,z s 0.1 K P,z s 0.01 The ASM-PPI controller is simulated with the parameters in Table 8. The values were established through a methodical trial-and-error process. Testing different decimal values showed that several variations produced similar outcomes in system performance. Consequently, the most representative values were chosen, balancing practicality and effectiveness. Additionally, the gains for the ST controller are presented in Table 9. The gains for the P-PI controller were used as above and are shown in Table 10.

Parameters
Values λ x a, λ y a 1 λ z a, λ Fp a 1 µ x a, µ y a 1 µ z a 1 kmin x,y,z a 1 Table 9. Gains for the ASM controller with trial-and-error tuning.

Parameters Values
K 1,x a, K 1,y a 1 K 2,x a, K 1,y a 1 K 1,z a, K 2,z a 1 Table 10. P-PI controller gains with trial-and-error tuning.

Parameters Values
K P,x h, K P,y h, K P,z h 3 K P,x s, K P,y s, K P,z s 0.1 K I,x s, K I,y s, K I,z s 0.01 From the PSO implementation, the best combination of gains for each of the controllers concerning the minimum RMSE was obtained (shown in Figure 8). The gains obtained for the PID controller by the PSO algorithm can be seen in Table 11. The gains obtained for attitude control (P-PI) by the PSO algorithm are shown in Table 12.

Parameters Values
K P,x i 4 K D,x i 2.5 K P,y i 4.1 K D,y i 2.4 K P,z i 7 K D,z i 2 K I,x i, K I,y i, K I,z i 0.1 Table 12. Gains for the P-PI controller with PSO tuning.

Parameters Values
K P,x h 6.2 K P,y h 6.1 K P,z h 6.1 K P,x s 1 K P,y s 1.05 K P,z s 0.1 K I,x s, K I,y s 0.04 K I,z s, 0.001 The PSO algorithm and the ST-PPI controller were implemented, and the following parameters and gains were obtained. The parameters are shown in Table 13. The gains obtained for the ST controller by PSO can be seen in Table 14. The gains obtained for the P-PI controller are shown in Table 15.

Parameters
Values

Parameters Values
K P,x h 3.5 K P,y h, K P,z h 3.4 K P,x s 0.3 K P,y s 0.35 K I,x s, K I,y s 0.04 K P,z s 0.1 K P,z s 0.01 The parameters obtained for the ASM controller by PSO can be seen in Table 16. The gains obtained for the ASM controller and attitude control (P-PI) by PSO are shown in Tables 17 and 18.

Parameters
Values λ x a 2.01 λ y a 1.98 λ z a, λ Fp a 1 µ x a, µ y a 0.5 µ z a 0.1 kmin x,y a 1 kmin z a 0.14 Table 17. Gains for the ASM controller with PSO tuning.

Parameters Values
K 1,x a 1.47 K 1,y a 1.50 K 2,x a 0.99 K 2,y a 1.01 K 1,z a 1 K 2,z a 0.98 Table 18. P-PI controller gains with PSO tuning.

Parameters Values
K P,x h 6.01 K P,y h 6.11 K P,z h 5.87 K P,x s 0.10 K P,y s 0.09 K P,z s 0.099 K I,x s 0.08 K I,y s 0.04 K I,z s 0.01

Comparative Study
This section presents the performance comparison of the three control strategies by using the trial-and-error method for the tuning of the parameters. Also, a comparison is presented when PSO was used for the parameter adjustment of each controller. To observe the trajectories in more detail, a 2D close up was performed, which can be seen in Figure 10a-c. In addition, in Figure 11a-c, the servomotor signals are presented as the helicoidal trajectory is followed. The previous results have a direct effect on the control effort of the components. The control effort refers to the level of effort or energy applied to control a system. In this case, the amount of energy or input signal is sent to the motors [58]. Table 19 shows the control efforts of the simulated motor moving in direction z, which are indicated as |τ| z . In addition, the table shows the values of the SR-UAV fin angles that are controlled by servomotors, which are represented by |θ| 1 to |θ| 4 . This table shows that the motor control effort for the three controllers |τ| z oscillates between 480-490. The RMSE of the ASM-PPI controller is the lowest of the three, as it is shown in Table 19. In the same way, a significant change is presented in the control effort of the servomotor signals with the implementation of the sliding mode controller compared to the classic PID controller. These responses show that the SR-UAV can follow trajectories when the three proposed control schemes are used. The controllers used the classical trial-and-error tuning process in these simulations and showed a significant deviation error in the desired trajectory. The scheme that presents the minimum error is the ASM-PPI control. Subsequently, the proposed control strategy based on PSO was implemented. In Figure 12a-c, the helicoidal trajectory is shown. A comparison between the simulation with the trajectory specified by Equations (75)-(77) and tuning by using PSO was made. Figure 13a-c show the two-dimensional trajectory. The trajectory presents oscillations with amplitudes at the beginning of the trajectory, but the three controllers stabilize quickly compared to the classic tuning. In Figure 14a-c, the fin angles are presented. The trajectory stabilizes, and the angles are within the expected range with an average of 0.0741, 0.0731, and 0.1051 (rad) for the PID, ST, and ASM, respectively. The curves exhibit seemingly abrupt angle changes, but the majority of variations actually fall within a range of about ±6 degrees. Hence, while the visual representation might suggest abrupt shifts, most angular deviations remain within a more moderate span. This effect could stem from the graphical presentation, underscoring the importance of considering both graphical appearance and precise data for an accurate understanding of angular variation.
In Figures 15-18, we present phase plots (ė vs. e) that offer comprehensive insight into the finite-time convergence dynamics of our system. These phase plots are instrumental in comprehending how the controllers behave over time. Sliding surface convergence is a vital aspect of control systems' evaluation. Figure 15a shows the initial swirling pattern that corresponds to the adaptive response to initial conditions, indicating rapid error reduction as the pattern converges toward the origin. However, lower excursions are shown in Figure 16a, corresponding to the behavior of a Super-Twisting controller tuned with PSO. The patterns observed in Figures 15b and 16b are quite similar, although a quicker convergence to zero is observed in the later stage. In the z axis, Figure 16c shows a more concentrated pattern near the origin than Figure 15c. In summary, the PSO-tuned ST controller exhibits better convergence properties than the ST tuned with the trial-anderror method. A less prominent swirl suggests that the system in Figure 16 may have experienced less initial oscillation or adaptation compared to Figure 15. Most notably, the faster convergence towards zero indicates that the system reaches the desired state more swiftly compared to the system outlined in Figure 15, which could be interpreted as a more efficient control response and faster finite-time convergence. Figure 17a-c present the performance of ASM controllers without PSO gain tuning. These results offer insights into the inherent capabilities of ASM for SR-UAV control. In contrast, Figure 18a-c illustrate the behavior of ASM controllers with PSO-guided gain adjustments. Notably, in Figure 18b, rapid convergence to zero is evident, while the behavior observed in Figure 18a,c in terms of the convergence time and magnitude is slightly better than the performance shown in Figure 17a,c. The different responses between the ASM controllers without and with PSO gain tuning emphasize the impact of automated parameter optimization in enhancing the SR-UAV control performance. Figure 19a-c present the evolution of gain parameters in an ASM controller without PSO tuning, and Figure 20a-c show the same parameter with PSO tuning. Figure 19 shows minimal fluctuations in the gain values. Conversely, Figure 20 tells a different story. Particularly, in Figure 20c, we witness substantial variations in the gain parameters. These fluctuations are a direct consequence of PSO's ability to guide the controller closer to the gains that confer superior attributes. It continuously refines these gains to minimize errors, as illustrated by the pronounced changes observed. The previous results reveal that the SR-UAV can perform well when using any of the three controller schemes. Table 20 shows the control effort in the primary motor |τ| z and the control efforts from the fin angles related to the servomotors. Here, the best performance for each of the indices is highlighted.

Conclusions
In this work, we extend and improve the work presented in [4]. We correct the mathematical model, design robust nonlinear controllers, and test their performance in scenarios with strong wind disturbances. Because the number of parameters on each controller makes tuning by hand difficult, we used the PSO method to obtain optimal parameters. Additionally, we proved that ST and ASM controller parameters, obtained with the PSO algorithm, satisfy Lyapunov stability conditions. The first controller used a PID scheme, for comparison purposes, while the other two controllers employed sliding mode techniques. Even though the simulation results showed that the controllers tuned with PSO achieved higher accuracy and robustness, they require extensive offline simulations to obtain the optimal parameters. The training scenarios included weak and strong wind gust disturbances.
According to the summary in Table 20, the ST controller showed the best performance and minimum errors, although it also exhibited more abrupt changes in the angles of the controlled fins. The ASM controller was the second-best controller regarding the accuracy of positioning and showed less-abrupt changes in the angle of fins than the ST controller. Finally, even though the PID controller was less efficient than the ASM and ST controllers, it demonstrated lower abrupt changes in the angle of fins than the other two controllers. Overall, this study highlighted the advantages and disadvantages of each controller and gain-tuning method, emphasizing the importance of considering specific system characteristics and control requirements when selecting the appropriate approach.
In future work, we aim to implement advanced attitude controllers to compare their performance against the one used in this work (P-PI). Additionally, we are in the process of building an SR-UAV physical prototype to carry out an implementation of the controllers and evaluate their performance under realistic conditions. Also, the use of other schemes such as Nonlinear Predictive control (NMPC) and Reinforcement Learning (RL) will be investigated to improve reference tracking, system stability, and the ability to compensate for external disturbances. Investigating these techniques would provide a broader understanding of SR-UAV behavior and allow for the development of more efficient and accurate solutions.

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

Abbreviations
The following abbreviations are used in this manuscript: Sum of the moments of those forces at the center of mass U AV Unmanned aerial vehicle u Motor s input v Velocity of the particle pa VTOL Vertical take-off and landing w Inertial weight x best Best position found by the particle x Wbest Best position found of the entire swarm (X 0 , Y 0 , Z 0 ) Body frame x, y, z (X 1 , Y 1 , Z 1 ) Inertial Frame x, y, z i. f Inertial frame