Curved Path Following Control for a Small Fixed-Wing UAV with Parameters Adaptation

: This paper presents an approach to address the curved-path following problem of a ﬁxed-wing UAV, which can reach uniform optimal path-following performance for different initial states and control processes. First, a proper guidance law is designed following a class of horizontal smooth paths with ﬁxed control parameters. The stability of the relative nonlinear system is guaranteed by the Lyapunov stability theory. The inﬂuence of the control parameters on path-following performance has been analyzed. Second, the rules of the time-varying control parameters are designed separately. The rules of the time-varying P-like parameter are designed by analyzing the dynamic characteristics of the nonlinear system with different initial ﬂight states. The rules of the time-varying D-like parameter are designed based on the fuzzy logic technique. The stability of the corresponding nonautonomous nonlinear system is also proved. The simulations are carried out in the Matlab/Simulink environment with an Aerosonde UAV model. The results are presented to illustrate the effectiveness and high path-following performances of the proposed control strategies.


Introduction
In the past two decades, small fixed-wing UAVs have been widely applied in military and civil fields, such as anti-terrorism reconnaissance, communication relay, land surveying and mapping, forest fire prevention, power inspection, and so on [1]. One important function of the autopilot is that it can give the UAV the ability to fly over the target area according to the predefined path [2]. The methods for realizing the objective can be classified into two categories: trajectory tracking and path following. Path following is to make the UAV fly along the geometric path at any feasible speed. Trajectory tracking requires the UAV to converge and follow a time-parameterized path [3]. It requires the autopilot to produce the velocity command, which is critical for the small fixed-wing UAV [4].
Various approaches have been proposed in the literature for path following. Two main categories are linear-control-based approaches and nonlinear-control-based approaches. The linear path following control methods mainly include PID and LQR techniques. The structure of a PID-based path following controller is simple and easy to implement [5], but the selection of control parameters mostly depends on the experience of the designers [6]. the controller's ability to resist unmodeled parts and external disturbances is poor [7]. The LQR-based method is usually applied to follow a straight-line and circular paths. The LQR-based path following approach requires a suitable linear model, which includes the dynamic characteristics of the system and the differential equation of the heading error [8]. It should be pointed out that the heading error must be small enough to meet the linearization conditions [9]. Otherwise, the linear model will not match the actual characteristics, and the controller will fail.
The nonlinear path following control methods mainly include the intelligent control techniques, nonlinear model predictive control (NMPC), and the Lyapunov-stability-theorybased methods. In the aspect of intelligent control techniques, Cancemi et al. applied the Takagi-Sugeno fuzzy technique to produce the desired heading to follow the predefined waypoints [10]. Back et al. applied the convolutional neural networks to produce the head direction control and lateral offset [11]. By combining the above two control quantities linearly, the yaw rate command was generated to guide the UAV to follow the desired path. Zhang et al. [12] used the deep reinforcement learning approach to generate the desired heading command, where a specific reward function was designed for minimizing the cross-track error of the path following problem. The simulations with the above intelligent techniques have been presented to show their effectiveness. However, the stability of the relative controllers has not been proved.
Considering the input and state constraints of the UAV, the NMPC technique is usually applied to solve the path following problems by combining the dynamics of the UAV and the path following error. In the early stage of applying NMPC, the methods have satisfactory path-following performance [13,14], but they do not consider the stability of the relative closed-loop system. Hamada et al. applied the NMPC technique to produce the lateral guidance law by using the continuation/generalized minimum residual method with an extended Kalman filter [15]. In [16], Yang et al. applied the NMPC technique to generate the heading rate command to first follow the straight-line path. By varying the control horizon depending upon the path curvature profile, an adaptive NMPC algorithm was presented to follow the continuous curvature path [17]. The conditions that can assure the closed-loop stability of the corresponding system were obtained. However, this method presents higher requirements for the calculation of the optimization problems, especially when the control horizon increases.
Other nonlinear path following controllers are mainly based on the Lyapunov stability theory. Kothari et al. applied the pure pursuit and line-of-sight (PLOS) method to realize following in a straight-line [18]. By using the virtual target point, Park et al. [19] developed a nonlinear path-following guidance law, which can follow both straight-line and circular paths. The use of heading guidance generated from vector fields is a candidate for UAVs to implement path following [2]. Nelson et al. combined the techniques of vector field and sliding mode to generate the straight-line and circular paths following control law [20]. Farì et al. presented an adaptive vector field control law which can compensate for the lack of knowledge of the wind vector and for the presence of unmodelled course angle dynamics [21]. Zhao et al. developed a curved-path following controller approach with the combination of the vector field and the input-to-state stability theorem [22]. Liang et al. designed a saturated course rate controller based on a combined vector field, which combined a conservative vector field and a solenoidal vector field [23,24]. The theory of nested saturations is an alternative approach which can be used to deal with the input constraints [3]. Zhao et al. developed a curved-path following control scheme with the control constraints by using the theory of nested saturations [3]. Beard et al. designed the guidance strategies for following the straight-lines and orbits in wind by using the nested saturations technique. The strategies have considered the roll angle and flight path constraints [25]. While designing the guidance law for path following by using the kinematic and dynamic models of the UAV, the backstepping technique can be applied to design the virtual control to meet the requirements step by step, finally designing the real control law. By using the backstepping and parameter adaptation techniques, Jung et al. have developed the roll angle command, which can follow the flyable smooth path [26]. Flores et al. have designed a path following controller by introducing a virtual particle moving along the geometric path that is represented by parameterized smooth functions. The error kinematic model in the Frenet-Serret frame, together with the roll dynamics, is used to generate the guidance law [27]. Furthermore, the wind disturbances, which are estimated by using the arbitrary-order exact robust differentiator, are considered to improve robustness [28].
The nonlinear controllers designed using the Lyapunov stability theory are very attractive, both in theory and experiment. Nevertheless, in the process of designing this kind of controller, the control parameters are generally fixed to ensure the stability of the corresponding closed-loop nonlinear system. In fact, the values of the control parameters have a very important impact on the path-following performance, which is mainly reflected in the convergence speed, overshoot, following error, and so on. If the above controller parameters change within a certain range, the corresponding stability proof process will no longer be applicable. Therefore, designing a stable path following controller based on the Lyapunov stability theory, where its corresponding control parameters can be adjusted in real time to adapt to different initial conditions and dynamics, is vital to improve the path-following performance of a UAV.
In our previous works [29], a PD-like nonlinear guidance law was presented to guide the fixed-wing UAV toward the predefined straight-line path. To achieve better pathfollowing performance, one of the control parameters was tuned by fuzzy logic. However, the other control parameter is still fixed; therefore, it cannot give the UAV a better pathfollowing performance. In this study, the PD-like nonlinear guidance law is extended to follow a class of horizontal paths. Both of the control parameters are designed adaptively to improve the path-following performance.
The main contributions of this study are summarized as follows: First, a Lyapunovstability-based guidance law for following a class of horizontal paths is presented by using Barbalat's lemma, where the ground speed of the UAV is time-varying and bounded. Second, both of the control parameters of the guidance law for following the straight-line and circular paths are designed adaptively. The rules of the time-varying P-like parameter are designed to make it adapt to this different initial flight states, whereas the rules of the time-varying D-like parameter are designed based on the fuzzy logic technique. In this case, the stability of corresponding nonautonomous nonlinear system is also guaranteed. To the best of our knowledge, this the first time that all of the control parameters of the guidance law used are time-varying and adaptive. Third, the control results were compared with the methods when the parameter was fixed, which illustrates the effectiveness and better performance of the proposed control strategies.
The remainder of this paper is organized as follows. The equations of the problem description are listed in Section 2. In Section 3, a guidance strategy for a class of horizontal path following is derived. The influence of the parameters on the dynamic characteristics of the relative nonlinear system is also analyzed. The detailed rules of the time-varying P-like parameter and the fuzzy logic controller for optimizing the D-like parameter are also presented. The simulation results obtained using an Aerosonde UAV in Matlab/Simulink are given in Section 4, and some concluding remarks are summarized in Section 5.

Problem Formulation
A small fixed wing UAV equipped with autopilot can realize the stable feedback control of altitude, attitude, and airspeed. In this case, these states converge with the desired response to their commanded values. In typical application fields such as mapping and searching, the airspeed and altitude remain unchanged using a zero climb rate under the control of the autopilot so that the UAV works in the safe flight envelope [25]. The following kinematic model in the horizontal plane can describes the motion of the fixedwing UAV: . y = V a sin(ψ) + W y = Vsin(χ) .
where x, y, and V denote the inertial position and speed of the UAV in a 2D inertial frame, respectively. W x and W y represent the x and y components of the wind velocity W. V a and ψ denote the airspeed and heading, respectively. χ ∈ (−π, π] is the course of the UAV.
u cmd is the course rate command of the UAV. When the fixed-wing UAV is flying, the speed V will always be positive. Thus, the following assumption is adopted.

Assumption 1.
The speed V and its derivative . V are both bounded, and V p1 ≥ V ≥ V p2 > 0, where V p1 and V p2 are all positive constants. Definition 1. (Horizontal Path). Let P r = {(x, y)| f (x, y) = 0, x, y ∈ R} be an implicit expression of a reference path, where f (x, y) is a twice continuously differentiable function.
Following [30], the value f (x, y) when the UAV is in (x, y) is used as the distance value. Given that the gradient of f (x, y) is not zero on the path, the value of f (x, y) can represent the position of the UAV relative to the desired path. If f (x, y) = 0, it means that the UAV is on the path.
Let f x and f y be the first-order partial derivatives of f (x, y), and the gradient modules As shown in Figure 1, the vector f x , f y represents the desired orientation along the level path. The desired orientation χ d can be given as Following [30], the value ( , ) when the UAV is in ( , ) is used value. Given that the gradient of ( , ) is not zero on the path, the valu represent the position of the UAV relative to the desired path. If ( , ) = the UAV is on the path.
Let and be the first-order partial derivatives of ( , ), and th ules of ( , ) is ‖ ‖ = + . As shown in Figure 1, the vector ( , For some given ( , ), the value of ‖∇ ‖ may be zero in some poi UAV's initial position is at these points, the guidance to be designed belo the UAV will lose control. In the following, the safe flying area for the UA = {( , )| , ∈ , ‖∇ ‖ ≥ }, where is a positive constant.  For some given f (x, y), the value of ∇ f may be zero in some points (x, y). If the UAV's initial position is at these points, the guidance to be designed below will fail, and the UAV will lose control. In the following, the safe flying area for the UAV is defined as Assumption 2. f x , f y , f xx , f xy , and f yy are bounded in any bounded domain D ⊂ R 2 .
The virtual distance error e d is introduced as Let the course angle error e χ be defined as Hence, The error kinematics model suitable for control purposes is summarized as The Equations (3) and (5) show that if the UAV is flying along the desired path f (x, y) = 0 with the right direction, then e d = 0, and e χ = 0. Thus, the purpose of this study is that, based on the error kinematics model (7), the designed feedback control law u cmd should make the errors e d and e χ converge to zero.

Controller Design
In this section, first, a stable kinematic control law for the course rate command with fixed control parameters is derived based on the nonautonomous systems. Second, the analysis of the control parameters is presented. Third, the nonautonomous systems which will be used to describe the adaptive path following is presented, and the relative control law is designed based on the Lyapunov stability theory. Additionally, the method of parameters adaptation is also described. The sketch of the solution to the curved-path following controller with parameters adaptation is shown in Figure 2.
Let the course angle error be defined as Hence, The error kinematics model suitable for control purposes is summarized as The Equations (3) and (5) show that if the UAV is flying along the desired path ( , ) = 0 with the right direction, then = 0, and = 0. Thus, the purpose of this study is that, based on the error kinematics model (7), the designed feedback control law should make the errors and converge to zero.

Controller Design
In this section, first, a stable kinematic control law for the course rate command with fixed control parameters is derived based on the nonautonomous systems. Second, the analysis of the control parameters is presented. Third, the nonautonomous systems which will be used to describe the adaptive path following is presented, and the relative control law is designed based on the Lyapunov stability theory. Additionally, the method of parameters adaptation is also described. The sketch of the solution to the curved-path following controller with parameters adaptation is shown in Figure 2.
Design a PD-like stable nonlinear kinematic control law with fixed control parameters based on Equation (7) Analyze the influence of the two control parameter values on the path following performance Design a PD-like stable nonlinear kinematic control law with time-varying control parameters based on Equation (7) Design the rules of the timevarying P-like parameter Design a fuzzy logic controller for optimizing the D-like parameter

Kinematic Controller Design with Fixed Control Parameters
Theorem 1. Considering the kinematic error model of the UAV described in Equation (7), the following control law , where and are all positive constants, ( ) is the saturation function defined as

Kinematic Controller Design with Fixed Control Parameters
Theorem 1. Considering the kinematic error model of the UAV described in Equation (7), the following control law u cmd , where k 1 and k 2 are all positive constants, f sat (x) is the saturation function defined as with x 0 an arbitrary given positive constant, asymptotically drives e d and e χ towards zero.
Proof of Theorem 1. Substitute u cmd shown as Equation (8) into Equation (7), then Define the domain where e d1 is a positive constant, and let x = [e d , e χ ] T , Equation (9) can be rewritten as where It can be found that g : D 1 → R 2 is a locally Lipschitz map from the domain D 1 ⊂ R 2 into R 2 with Assumptions 1 and 2 adopted. [0, 0] T is the only equilibrium point for (11) in D 1 . Let U(x) be a candidate Lyapunov function given as: Therefore, It can be found that . U(x) is negative semidefinite. Since V, f x , f y , f xx , f xy , and f yy are bounded and ∇ f ≥ λ, one can derive that d ∇ f /dt is bounded. It can be found from (12) that U(x) is lower bounded. Since V, ∇ f , and their derivatives are all bounded, by (13) . U(x) is negative semidefinite and uniformly continuous in time. By Barbalat's lemma [31], . U(x) → 0 as t → ∞ . Moreover, it has sin(e χ ) → 0 , and . e d → 0 as in (11). Since e d is bounded, it follows that e d tends to a finite limit e d as t → ∞ . Since e χ → 0 as t → ∞ , and . e χ in (11) is uniformly continuous, it derives that . e χ → 0 as t → ∞ . Hence, it follows that lim t→∞ f sat (e d ) → 0, and e d = 0. Therefore, the kinematic control law (8) can asymptotically drive e d and e χ toward zero.

Figures, Tables and Schemes
For a given initial state of the nonlinear system (9), The behaviors of e χ and e d are affected by the two control parameters k 1 and k 2 . In order to study how the parameters will affect the dynamics of the nonlinear system (9), the straight-line and circular paths are chosen for case analysis. The function of a given straight-line path can be expressed as ax + by + c = 0, where a, b, c ∈ R and √ a 2 + b 2 = 1. The function of a given circular path where C x , C y and C R represent the center and radius of the circle, respectively. With the functions of the straight-line and circular paths described above, the values of the corresponding gradient modulus are all ∇ f = 1. Figure 3a shows the different trajectories of the nonlinear system (9) with ∇ f = 1, V= 25 m/s, and k 2 = 0.0003, but under five different values of parameter k 1 . The trajectories of e d and e χ are shown in Figure 3b,c, respectively. The parameter k 1 directly affects the dynamic characteristics of the two states e d and e χ . With larger value of k 1 , the rise times of the two states e d and e χ are all shorter, but the corresponding overshoots and oscillation amplitudes become larger. The smaller or larger value of the parameter k 1 , the faster the convergence speed of the two states.
Appl. Sci. 2022, 12, x FOR PEER REVIEW 7 of 20 Figure 3a shows the different trajectories of the nonlinear system (9) with ‖∇ ‖ = 1, V= 25m/s, and 2 = 0.0003, but under five different values of parameter 1 . The trajectories of and are shown in Figure 3b,c, respectively. The parameter 1 directly affects the dynamic characteristics of the two states and . With larger value of 1 , the rise times of the two states and are all shorter, but the corresponding overshoots and oscillation amplitudes become larger. The smaller or larger value of the parameter 1 , the faster the convergence speed of the two states.   Figure 4b,c, respectively. It can be seen that the parameter 2 significantly influences the dynamics of and . With a larger value of 2 , the overshoots of and will both be smaller. The smaller value of 2 will lead to a larger oscillation amplitude and more oscillation times of and . With the increase of 2 , the rise times of and are both longer. Equation (9) shows that the dynamics of is a nonlinear combination of the variable and its differential, which is similar to a PD controller. The term − 2̇ can predict the error trend and correct the error in advance. Thus, the parameter 2 cannot blindly pursue a large value, but should take an appropriate value.   Figure 4b,c, respectively. It can be seen that the parameter k 2 significantly influences the dynamics of e d and e χ . With a larger value of k 2 , the overshoots of e d and e χ will both be smaller. The smaller value of k 2 will lead to a larger oscillation amplitude and more oscillation times of e d and e χ . With the increase of k 2 , the rise times of e d and e χ are both longer. Equation (9) shows that the dynamics of e χ is a nonlinear combination of the variable e d and its differential, which is similar to a PD controller. The term −k 2 V g . e d can predict the error trend and correct the error in advance. Thus, the parameter k 2 cannot blindly pursue a large value, but should take an appropriate value.

Kinematic Controller Design with Time-Variable Control Parameters
The analysis of Section 3.2 shows that the two parameters k 1 and k 2 will both affect the guidance performance of a UAV. Reviewing the proof process of Theorem 1, as long as the parameter k 2 is always greater than a positive value, the stability of the relative nonlinear system (9) can be guaranteed. At the same time, we hope that for each flight path, under different initial distances and relative course angles, the parameter k 1 can also adapt to the different initial flight states, where the resulting overshoot is small and the convergence speed is fast, whereby the stability of the whole system can also be guaranteed.
In the following, in order to achieve better path-following performance with smaller overshoot and faster convergence speed, a modified control law is introduced as: where k 2,max ≥ k 2 (t) ≥ k 2,min , k 2,max , k 2,min are both positive constants with k 2,min < k 2,max , and k 1,max , k 1,min are both positive constants with k 1,min < k 1,max , τ is a positive constant.

Kinematic Controller Design with Time-Variable Control Parameters
The analysis of Section 3.2 shows that the two parameters 1 and 2 will both affect the guidance performance of a UAV. Reviewing the proof process of Theorem 1, as long as the parameter 2 is always greater than a positive value, the stability of the relative nonlinear system (9) can be guaranteed. At the same time, we hope that for each flight path, under different initial distances and relative course angles, the parameter 1 can also adapt to the different initial flight states, where the resulting overshoot is small and the convergence speed is fast, whereby the stability of the whole system can also be guaranteed.
In the following, in order to achieve better path-following performance with smaller overshoot and faster convergence speed, a modified control law is introduced as: where 2, ≥ 2 ( ) ≥ 2, , 2, , 2, are both positive constants with 2, < 2, , and 1, , 1, are both positive constants with 1, < 1, , is a positive constant. Equation (15) shows that the parameter 1 is time-varying. For each given path, the parameter 1 changes from the maximum value 1, to the minimum value 1, over time . This parameter change mechanism can meet the need to use a large value of to make the UAV fly to the target path quickly when the vehicle is far from the target Equation (15) shows that the parameter k 1 is time-varying. For each given path, the parameter k 1 changes from the maximum value k 1,max to the minimum value k 1,min over time t. This parameter change mechanism can meet the need to use a large value of k 1 to make the UAV fly to the target path quickly when the vehicle is far from the target path. When the UAV is close to the target path, the value of k 1 becomes smaller, which will reduce the overshoot. The time constant τ plays an adjusting role in this process. When following the control of each target path, the time constant τ should be set according to the initial states of the UAV relative to the target path, i.e., the initial distance and relative course angles.
By choosing the candidate Lyapunov function U 1 (t, x) as The derivative of U 1 (t, x) along the trajectories of (19) is given by Furthermore, with the results shown as Equations (16) and (17), it can be derived that It can be found that W 1 (x) is a continuous positive semidefinite function on D 1 , W 2 (x) and W 3 (x) are both continuous positive definite on D 1 . It can be found from (22) and (23) that U 1 (t, x) is lower bounded. Since V, ∇ f , and their derivatives are all bounded, by (21) . U 1 (t, x) is negative semidefinite and uniformly continuous in time. By Barbalat's lemma (p. 323, [31]), . U 1 (t, x) → 0 as t → ∞ . Moreover, it has sin(e χ ) → 0 , and . e d → 0 as in (19). Since e d is bounded, it follows that e d tends to a finite limit e d as t → ∞ . Since e χ → 0 as t → ∞ , and . e χ in (19) is uniformly continuous, it derives that . e χ → 0 as t → ∞ . Hence, it follows that lim t→∞ f sat (e d ) → 0, and e d = 0. Therefore, the kinematic control law (14) can asymptotically drive e d and e χ toward zero.

The Adaptive Design of k 1 (t) and k 2 (t)
In this subsection, the control parameters k 1 (t) and k 2 (t) are designed adaptively to improve the path-following performance. Since a given smooth path on the plane can be approximated by a certain number of straight lines and arc segments, the following research focuses on the straight-line and circular paths.

Assumption 3.
For each straight-line or circular path to be followed, the distance between the UAV and the target path is within 300 m, and the corresponding course angle deviation is within 90 degrees. Thus, the variation ranges of the initial values of the states e d and e χ are [−300, 300] and − π 2 , π 2 , respectively. As shown in Equation (13), the dynamics of the parameter k 1 (t) is determined by the parameter τ. The adaptive design of k 1 (t) is transformed into the optimal design of parameter τ. In this study, the time constant τ is selected by analyzing the dynamic response of Equation (9) under different initial conditions. k 1,max and k 1,min are chosen as 0.00025 and 0.0001, respectively. The objective is to establish the relationship between the time constant τ and the initial values of the states e d and e χ based on Equation (9), when k 1 = 0.00025, k 2 = 0.0008. In the following, the initial values of the states e d and e χ are denoted as e d0 and e χ0 for convenience.
Since the analytical solution of the nonlinear Equation (9) cannot be obtained, the numerical method is applied to study its dynamic characteristics. By discretizing the value range of e d0 according to equal intervals of length 30, 21 values of e d0 are obtained. Similarly, 19 values of the state e χ0 are obtained by discretizing its value range according to equal intervals of length π 18 . Thus, 399 pairs of (e d0 , e χ0 ) are obtained through combination. Under each initial state condition (e d0 , e χ0 ), the state trajectories of the nonlinear system (9) with k 1 = 0.00025 and k 2 = 0.0008, can be calculated by the fourth order Runge-Kutta algorithm.
There are four typical trajectories of e d under different initial state conditions (e d0 , e χ0 ), which can be seen in Figure 5. As shown in Figure 5a,b, if e d0 ≥ 0, the time length T 1 is defined as the length of time it takes for the state e d (t) to get the maximum value from its initial value. If e d0 < 0, the time length T 1 is defined as the length of time it takes for the state e d (t) to get the minimum value from its initial value. Figure 5c,d shows that, if e d0 ≥ 0, the time length T 2 is defined as the length of time it takes for the state e d (t) to get the minimum value from its initial value. If e d0 < 0, the time length T 1 is defined as the length of time it takes for the state e d (t) to get the maximum value from its initial value.
argmax(e d (t)) s.t. Equation (9) and e d0 , e χ0 , if e d0 ≥ 0 argmin(e d (t)) s.t. Equation (9) and e d0 , e χ0 , if e d0 < 0 (24) T 2 = argmin(e d (t)) s.t. Equation (9) and e d0 , e χ0 , if e d0 ≥ 0 argmax(e d (t)) s.t. Equation (9) and e d0 , e χ0 , if e d0 < 0 (25) In this study, the empirical relationship between the time constant τ and the two parameters T 1 and T 2 are selected by analyzing the dynamic trajectory as At this time, the discrete relationship between the time constant τ and 399 pairs of (e d0 , e χ0 ) can be obtained, as can be seen in Figure 6. When following each desired path, the initial state of the UAV will be calculated, and then the corresponding time constant τ required to follow this path can be obtained by using the bilinear interpolation method. At this time, the discrete relationship between the time constant and 399 pairs o ( 0 , 0 ) can be obtained, as can be seen in Figure 6. When following each desired path the initial state of the UAV will be calculated, and then the corresponding time constan required to follow this path can be obtained by using the bilinear interpolation method According to the analysis shown in Section 3.2, the value of should adaptively in a certain range near the appropriate value. Additionally, the d is a nonlinear combination of the variable and its differential, which is PD controller. The method of applying fuzzy logic to a linear PD controller is the adaptive design of parameter . In this study, the adaptive parameter culated around the given nominal value by a fuzzy logic controller as = + ∆ According to the analysis shown in Section 3.2, the value of k 2 should be adjusted adaptively in a certain range near the appropriate value. Additionally, the dynamics of e χ is a nonlinear combination of the variable e d and its differential, which is similar to a PD controller. The method of applying fuzzy logic to a linear PD controller is adopted to the adaptive design of parameter k 2 . In this study, the adaptive parameter k 2 can be calculated around the given nominal value k 20 by a fuzzy logic controller as k 2 = k 20 + ∆k 2 (27) where ∆k 2 is the output of the fuzzy logic controller. While designing the fuzzy logic controllers, the value of ∆k 2 is defined by the fuzzy rules described in Table 1, based on e d and . e d . The terms NB, NM, NS, Z, PS, PM, and PB stand for negative big, negative medium, negative small, zero, positive small, positive medium, and positive big, respectively. Figure Figure 7b shows the input-output surface for the fuzzy logic controller among e d , e d , and ∆k 2 . The minimum value of ∆k 2 is −0.0002042. In this study, the parameter k 20 is chosen as 0.0008. Then, k 2 is always positive with k 2 > 0.000596.

Simulation
The proposed curved-path following control method with adaptive parameters is presented as Figure 8.

Simulation
The proposed curved-path following control method with adaptive parameters is presented as Figure 8.

Simulation
The proposed curved-path following control method with adaptive parameters is presented as Figure 8.  The bank-to-turn maneuver with no sideslip is applied to the small fixed-wing UAV. It follows that [25] = g ( ) where g is the magnitude of gravity at sea level. It is assumed that the inner loop PD controller can quickly track the commanded bank angle. At the same time, the dynamics of the bank angle are much faster than those of heading and altitude. In this case, the roll angle can be approximately considered as the commanded bank angle . Therefore, Equation (28) becomes The bank-to-turn maneuver with no sideslip is applied to the small fixed-wing UAV. It follows that [25] .
where g is the magnitude of gravity at sea level. It is assumed that the inner loop PD controller can quickly track the commanded bank angle. At the same time, the dynamics of the bank angle are much faster than those of heading and altitude. In this case, the roll angle can be approximately considered as the commanded bank angle φ cmd . Therefore, Equation (28) becomes Considering the relationship . χ = u cmd shown in Equation (1), the bank angle command φ cmd can be derived as The simulation was studied in the Matlab/Simulink environment. The Aerosonde UAV model with a wingspan of 2.9 m was used as the test vehicle [29]. Figure 9 shows the simulation in the Matlab/Simulink environment. The parameters used in the simulation are shown in Table 2. The initial V was set as 25 m/s. The sample time was set as 25 ms. A constant wind at 8 m/s from 270 • W was also added to the model of the UAV, which will verify the effectiveness of the proposed method under the wind disturbance. The initial position and course of the UAV were set as (0, 0) and 0 • N, respectively. the simulation in the Matlab/Simulink environment. The parameters used in the simulation are shown in Table 2. The initial was set as 25 m/s. The sample time was set as 25 ms. A constant wind at 8 m/s from 270° W was also added to the model of the UAV, which will verify the effectiveness of the proposed method under the wind disturbance. The initial position and course of the UAV were set as (0, 0) and 0° N, respectively.

Polygon Path Following
The desired horizontal polygon path was defined with six waypoints: A (0, 0), B (2400, 1386), C (2400, 3386), D (0, 5786), E (−2400, 5786), and F (−2400, 0). The simulation duration is 900 s. Figure 10a shows the comparison of the path following with the control parameter = , , = , , and , . For the convenience of description, the path following controller under the action of = , , = , , and , is abbreviated as _ , , _ , , and _ , , respectively. To verify the effectiveness of the proposed methods, we compared the path-following performances of
The response to the straight-line path can be evaluated by the length of the predefined path followed (LOPPF), the convergence distance, and the error overshoot. For a given segment path, the time from the error f (x, y) converging to less than the aircraft's wingspan until the UAV starts to switch to another path is called the effective time of UAV flying along the given path. The length of the predefined path followed (LOPPF) is defined as the projection length of the UAV's flight path on the desired segment during this effective path-following time. The convergence time is defined as the time from the UAV following the desired path until | f (x, y)| is less than the aircraft's wingspan. For straight-line path following, the error overshoot is the maximum of | f (x, y)|, which can be seen in the areas of I, II, III, IV, V, and VI, as shown in Figure 10b. Appl. Sci. 2022, 12, x FOR PEER REVIEW 15 of 20 the methods PFC_ 1, , PFC_ 1, , PFC_ 1, , and vector field (VF) [20]. While executing the polygon path following, the turn-through-waypoint mode was adopted to switch course.   Figure 10b shows the comparison of the f (x, y) while following the predefined polygon path with the four methods PFC_k 1,max , PFC_k 1,min , PFC_k 1,adaptive , and VF. As shown in the areas I, II, III, IV, V, and VI, the error overshoots found by using the method PFC_k 1,max are the largest. The corresponding error overshoots found by using the method PFC_k 1,min are the second smallest. When using the method PFC_k 1,adaptive , the error overshoots are moderate and closer to those generated by the method PFC_k 1,min . The corresponding error overshoots shown in the areas I, II, III, IV, V, and VI are all listed in Table 3. As Figure 10b and Table 3 show, while turning through the waypoint F (2000, 0), the deviations of the UAV from the reference path found by using the four methods are all larger than 125 m, and the largest occur during the first lap flight. These deviations show that, with the two orthogonal components of the added wind acting on the fuselage axis and the lateral axis of the UAV, the wind from 270 • W influences the turning of the UAV dramatically. Moreover, the convergence time by using the method PFC_k 1,adaptive is 25.73 s, which is the longest during the first lap flight. However, the convergence time is moderate by comparing it with those obtained by using the methods PFC_k 1,max and PFC_k 1,min . Table 3 lists the performance comparison of the polygon path following using the four methods PFC_k 1,max , PFC_k 1,min , PFC_k 1,adaptive , and VF. The segment AB 900s means that the UAV only follows part of segment AB during the second flight. The LOPPFs when the UAV follows the segments BC, CD, and EF with the method PFC_k 1,adaptive are the longest. The LOPPFs when the UAV follows the segments AB, DE, FA, and AB 900s are moderate compared with those obtained by the other three methods PFC_k 1,max , PFC_k 1,min , and VF. During the 900s's flight, the total LOPPFs by using the methods PFC_k 1,max , PFC_k 1,min , PFC_k 1,adaptive , and VF are 16,223.55 m, 16,508.06 m, 16,809.59 m and 16,515.96 m, respectively. This indicates that the UAV can fly on the most desired polygon path by using the method PFC_k 1,adaptive . Figure 11a shows the position comparison while following the circular path using the three methods. The desired circular path is defined as two concentric circles with circle A: x 2 + (y − 350) 2 − 250 = 0, and circle B x 2 + (y − 350) 2 − 350 = 0. The UAV first flew toward circle A. About 180 s later, the UAV started to switch from the position (0, 600) and flew toward circle B with a radius of 350 m.

Circular Path Following
The distance f (x, y) presented in Figure 11b shows that, with the parameter k 1 adaptive, the method PFC_k 1,adaptive inherits the advantages of the rapidity of the method PFC_k 1,max and the small overshoot of the method PFC_k 1,min . The error overshoots of f (x, y) for the first circular path following using the three methods PFC_k 1,max , PFC_k 1,min , and PFC_k 1,adaptive are 22.65 m, 11.07 m and 12.52 m, respectively. When switching to fly toward circle B, the error overshoots of f (x, y) using the methods PFC_k 1,max , PFC_k 1,min , and PFC_k 1,adaptive are 14.59 m, 2.25, and 3.03 m, respectively. Figure 11a shows the position comparison while following the circular path using the three methods. The desired circular path is defined as two concentric circles with circle A: √ 2 + ( − 350) 2 − 250 = 0, and circle B √ 2 + ( − 350) 2 − 350 = 0. The UAV first flew toward circle A. About 180 s later, the UAV started to switch from the position (0, 600) and flew toward circle B with a radius of 350m. The length of the predefined circular path followed (LOPCPF) is defined as the length of the actual flight path after the time that the UAV has converged to the desired circular path. Table 4 lists the LOPCPF, the convergence time, and the error overshoot for the UAV to follow the two circles A and B. It is determined that it takes only 10.60 s for the UAV to converge to circle B using the method PFC_k 1,adaptive . While using the methods PFC_k 1,max and PFC_k 1,min , the convergence times are 20.95 s and 14.83 s, respectively. During the 300 seconds' flight, the LOPCPF by using the three methods PFC_k 1,max , PFC_k 1,min , PFC_k 1,adaptive , and VF are 5356.88 m, 5662.37 m, 5742.11 m, and 5879.15 m, respectively. The above indicates that the method PFC_k 1,adaptive will still cause the UAV to fly the second most accurately on the desired circular path, with moderate convergence time and error overshoot.

Conclusions
This paper has considered the problem of horizontal curved-path following using fixed-wing UAV. The guidance strategies are derived using a kinematic model of the aircraft and using the Lyapunov stability theory. The control parameters in the guidance law are time-varying and adaptive to the initial states and dynamics of the corresponding nonlinear system. The rules of the time-varying P-like parameter are designed by using an exponential equation shown as (15), where its corresponding parameter τ is determined by using the fourth order Runge-Kutta algorithm and the bilinear interpolation method. The rules of the time-varying D-like parameter are designed based on the fuzzy logic technique. The stability of the corresponding nonautonomous nonlinear system is also guaranteed. Finally, we have demonstrated the effectiveness of the proposed strategies in a Matlab/Simulink simulation environment with an Aerosonde model. For the given square and circular paths, the method using the adaptive parameters can make the UAV fly more accurately on the target path based on the performance indexes LOPPF and LOPCPF. In the sense of path following, the proposed method provides a methodology that will be applied to realize the better path following of unmanned systems, including aerial, underwater, and ground-based robots.
In the actual flight process, the roll angle command is bounded, which should be considered in the parameter design of the controller. At the same time, if the bank angle command tracking control response of the UAV is very fast, the method described in this paper will be effective. If its response takes a certain time, the closed-loop roll dynamics must be considered in the design of controller. The closed-loop roll dynamics can be expressed as a first-order system. The follow-up research work will further design the path following controller by using the backstepping technique.
In the future, the closed-loop roll dynamics of the bank angle presented by a first-order system with the unmodeled parts will be used to generate the bank angle command in order to make the vehicle follow the predefined path more precisely. The method to estimate the disturbance described in [28] will also be considered to design a robust controller.
Author Contributions: Y.C. has contributed to this paper by carrying out the methodology and formulation, the supporting algorithms, and original draft preparation. N.L. has also contributed to this research by performing the simulations. W.Z. has contributed to this paper by analyzing how the parameters will influence the path-following performance. Y.W. was also involved in the aspect of the revision of the manuscript and in the literature review. His expertise in UAV has contributed towards optimizing the control parameters to improve control performance. Y.C., N.L., W.Z. and Y.W. discussed the results. All authors have read and agreed to the published version of the manuscript.