#### Abstract

A guidance law has been designed to guide the small unmanned aerial vehicle towards the predefined horizontal smooth path. The guidance law only needs the mathematical expression for the predefined path, the positions, and the velocities of the vehicle in the horizontal inertial frame. The stability of the guidance law has been demonstrated by the Lyapunov stability arguments. In order to improve the path following performance, one of the parameters of the guidance law is tuned by using the fuzzy logic which will still keep its stability. The simulation experiments in the Matlab/Simulink environment to realize the square-, circular-, and the athletics track-style paths following are given to verify the effectiveness of the proposed method. The simulation results show that the path following performance will be improved with smaller overshoot and oscillation amplitude and shorter arrival time with the parameter tuned.

#### 1. Introduction

In the past decades, the small unmanned aerial vehicles (UAVs) have been widely applied in the military and civilian domains with their ability of automation, such as fire detection, surveillance, aerial photography over the disaster area, and forbidden area monitoring [1]. To realize these functions, it is required that the UAVs have the capability of tracking or following the predefined path or trajectory accurately.

During recent years, the approaches to realize the path following or trajectory tracking control of a small unmanned aerial vehicle appear on the linear and nonlinear control methods. The linear techniques include the PID and linear quadratic regulator (LQR), while the nonlinear methods mostly appear on the backstepping technique, the fuzzy logic based control, the sliding mode control, and the model predictive control (MPC).

While applying linear methods, in [2], the outer-loop design for translational motion is based on the PD controller together with the disturbance accommodating control method to estimate the aerodynamic force. Compared to the traditional PID technique, Luo et al. applied the directional fractional order (PI) method to the lateral control of a small fixed-wing unmanned aerial vehicle with its parameters tuned based on the mathematical model [3]. However, the PID controller has little robustness to the disturbance, and it is mostly used in the lateral/longitudinal maneuvers by reducing the lateral deviation from a desired flight path. The genetic algorithm has also been used to optimize the control parameters of the trajectory tracking control law which will improve the tracking performance [4]. But it needs more calculation which makes it limited to be applied on the low-cost autopilot. In [5], the linear quadratic regulator (LQR) with an adaptive running cost was applied to generate the lateral acceleration command to guide the vehicle towards the path. Lee et al. used the LQR technique to reach the path following by finding the optimal state feedback law where its state is the combination of the lateral attitudes, the cross-track, and heading errors [6]. However, the heading and cross-track errors should be saturated to make the system stable due to the limitation of the linear region.

Alternative approaches to realize the path following are based on the nonlinear techniques, which include the intelligent control, the Lyapunov stability based control, and model predictive control. For using the intelligent method, an adaptive neuron-fuzzy inference system based flight controller has been designed to realize the autonomous flight [7]. Cancemi et al. applied the fuzzy logic to generate the heading reference which will guide the UAV towards the predefined waypoint trajectory [8]. The fuzzy based method was implemented in the hardware-in-the-loop simulation. The fuzzy logic method can reach better track performance compared to the traditional PID controller.

Based on the Lyapunov stability theory, the sliding mode and backstepping techniques are often applied. In [9, 10], the sliding mode control technique together with the vector field is used to guide the UAV towards the desired path. A spatial sliding mode controller [10] defined as a stable differential operator with respect to a defined spatial variable is presented to track the predefined path. Liang et al. applied the vector field for the vehicle to reach the planar path following by using the sliding mode control [11]. In [12, 13], Ren applied the backstepping techniques to obtain the velocity and roll angle control laws to track the predefined path. Brezoescu obtained the direction control of the UAV with the help of the adaptive backstepping method in the presence of the crosswind, which has been tested in simulation [14]. For real flight tests, the backstepping technique is usually used as the inner loop to stabilize the dynamics of the UAV [15]. Based on the MPC technique, a nonlinear model predictive controller is used to design the high level controller based on the kinematic model of the UAV to follow the line path [16]. In [17], an adaptive NMPC that varies the control horizon is used for design as the tracking layer to follow the predefined path by minimizing the mean and maximum errors between the reference path and the UAV. For normal MPC tracking controller, the error can converge fast with respect to its predictive ability, but there exist some static state error and some wave control due to the computational accuracy, limited predictive horizon, and weight matrixes selection.

Motivated by the above discussions, it can be found that the guidance control laws generated by the Lyapunov-stable based methods are usually simple and useful. In our preview works [18], a Lyapunov-stable based nonlinear control law has been designed to guide the UAV towards the predefined line path. In this paper, we have expanded the result to a class of smooth curve-type path in the horizontal plane. The proposed guidance law generated for the smooth path still has one of its parameters tuned by the fuzzy logic, which will make the vehicles fly towards the predefined path more directly and smoothly.

In the outer loop, with the altitude held by a simple PI controller, the concept of vector field which has been applied in fixed-wing UAV to generate the heading rate command was adopted [19]. However, the authors only considered the straight line and circular-type path for the fixed-wing UAV. In this study, we have expanded the result to a class of smooth curve-type path in the 2D plane. While applying the vector field to generate the heading rate command, the necessary information including the ground speed, position, and heading angle is measured by a GPS/INS integrated navigation system. Additionally, the asymptotic approximation to the desired path is demonstrated by use of the sliding mode approach and Lyapunov stability arguments.

The organization of this paper is as follows. In the next section, the problem description is presented. In Section 3, a Lyapunov-stable nonlinear controller is designed to generate desired course rate to guide the UAV towards the planar smooth path together with a key parameter of the controller tuned by the fuzzy logic technique. The simulation results in Matlab/Simulink environment to realize the square-, circular-, and the athletics track-style paths are given in Section 4. Finally, some concluding remarks are summarized in Section 5.

#### 2. Problem Description

Small fixed-wing UAVs equipped with low-level flight controller, which can provide altitude- and airspeed-hold functions, are assumed to be used for the path following. The following kinematics of the UAV in inertial horizontal frame can be used for the controller design:where is the inertial position of the UAV, and are the corresponding components of the wind velocity, is the airspeed, is the heading, and is the commanded heading rate. By introducing the ground speed and the course shown in Figure 1, the kinematics of the UAV (see (1)) can be expressed as

Following [9, 10], with another assumption that the autopilot can provide the course-hold function adopted, by introducing the course rate control , the system shown as (2) becomes as follows:

The relation between the heading rate and course rate is given by [11]

For flying a UAV, it has the fact that the airspeed is larger than the wind speed . When there is no wind, = 1, which means that the course of the UAV equals its heading angle. So it can be easily derived that . In the following, we control the UAV’s course instead of its heading. The command design is based on model (3). Therefore, the motions of the UAV can be expressed in terms of the ground speed and the course angle. Since the ground speed contains the information of wind velocity, the wind disturbance rejection will be naturally considered by using the inertial measurements [9, 18].

#### 3. Planar Smooth Path Following

##### 3.1. Normal Planar Smooth Path Following Controller

Consider a generic desired smooth path in the horizontal plane which can be described as a continuously differentiable implicit function with

In this paper, the desired path shown as (5) is a generic curve. Since it is not trivial to express the distance from a generic curve in closed form, the curve function instead of the Euclidean distance from the curve is used as the distance function [20]; that is, . The partial derivatives of with respect to and are

The magnitude of corresponding gradient is denoted as . With the distance function defined above, is a scalar filed, and it can indicate whether or not the point lies on the curve . In order to avoid the vehicle being trapped in the center point of the closed curve (such as the center of a circle), an interesting domain is defined as , where is a positive constant. When the vehicle’s initial position is within, the following control law shown as (7) will guide the UAV towards the desired path in finite time. where is a positive constant. ; is an arbitrary chosen positive value, and the saturation function is defined as Here, the saturation function is used to limit distance, just because if the initial distance from the path is sufficiently high and without the saturation function, the UAV will perform unnecessary endless loops away from the desired path. It should be noted that the term in (7) can guarantee that the vehicle will fly along the given path when the distance to the curve is zero.

For analyzing the stability of the path tracking control law shown as (7), two other following variables and are introduced as

Equations (9) show that tends to zero as the distance from the curve tends to zero, and tends to zero as tends to the direction of the desired line. So we have

The derivatives of the introduced variables are shown as follows:

Theorem 1. *If is a positive constant, , and , where and are positive constants, then the stable equilibrium points of system (11) equal the set . Furthermore, they are all uniformly asymptotically stable.*

*Proof. *Rewrite system (11) as with and defined asLet . Since , , the solutions to are the set . Firstly, the stable equilibrium points are . Without loss of generality, we consider the equilibrium point . Define the domain .

The Lyapunov candidate function is chosen asSince and for all , if , then on . Furthermore,where and are continuous positive definite functions on . Additionally, we have the fact thatIt can be derived that is a continuous positive definite function on the domain . Then, the equilibrium point is uniformly asymptotically stable [21]. Similarly, the equilibrium points in the set are all uniformly asymptotically stable.

The following text indicates that the points in the set are unstable when , and are all positive constants. Without loss of generality, we focus on the point and define the domain asThen, on the domain , the function can be expressed asIt can be found that is continuously differentiable on . The following Jacobian matrix can be derived as [21]By solving the eigenvalues of matrix , it gets that one of them equals , which is positive. Hence, the point is unstable [21]. Similarly, the equilibrium points in the set are all unstable.

##### 3.2. The Phase Plot of System (11) with Different Parameters

In order to analyze the dynamic performance of the nonlinear system (11), the line style and the circle style paths are chosen as the case study. For the line style path, the function is chosen as with , while for the circle style path following, the function is chosen as , where and represent the center and the radius of the circle, respectively. It can be found that with the circle style path function chosen as above, the magnitude of corresponding gradient . Thus Figure 2 which presents the phase plot of system (11) with can display the dynamics of the line- or the circle-style path following.

**(a)**

**(b)**

Figure 2(a) shows the dynamics of the nonlinear system (11) under different initial values. It displays the fact that if the vehicle is far away from the desired path, the vehicle will firstly adjust the course to an approximate invariant value and then flies towards the path until the absolute value of the distance is smaller than . Finally, some oscillations appear while the vehicle is approaching the desired path.

During the proof process of Theorem 1, the positive parameter is variable if it is larger than a given positive constant, while the parameter is chosen as a positive constant to get (15) which is used to be one of the conditions to guarantee the stability. Thus, the following study only considers how the variable parameter will influence the performance of the proposed guidance law.

Figure 2(b) shows the different trajectories of system (11) with the control parameters couple as , , , and but under the same initial conditions, respectively. The system is convergent for the given parameters couple. However, the convergence speeds are quite different due to the different control parameters. With larger parameter , the trajectories in the plane of phases tend to equilibrium more directly. Nevertheless, while implementing the control law on a real vehicle, if the vehicle flies near the predefined path, the control law is similar to the traditional PD controller. The larger parameter will lead to high-frequency oscillations and weaken the disturbance rejection. The following subsection shows how to adjust the parameter to improve the path following performance.

##### 3.3. Path Following Controller with Gain Tuned by Fuzzy Logic (FL_PFC)

As stated in the last subsection, the control gain should be adjusted to improve the path following performance. In [8], the authors have applied the fuzzy logic to generate the guidance law. Due to its simple structure and comprehensible concept, we adopted the advantages of the fuzzy logic and applied it to tune the control gain . Figure 3 presents the general structure of the proposed controller. The control parameter is adjusted around a given nominal value dynamically by the fuzzy logic unit as where is the output of the fuzzy logic unit for adjusting the parameter . As (13) and (15) show, while taking the procedure of (19), the adjusting parameter should be larger than a given positive constant; then system (11) has the asymptotically stable equilibrium points .

Figure 4 shows the triangular, Z-shaped, and S-shaped membership functions used for the fuzzification of the inputs and output, that is, the distance , the derivative of the distance , and the adjusting parameter . Here, 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.

**(a)**

**(b)**

**(c)**

Table 1 presents the rule base used for adjusting the parameter . The fuzzy rule base contains 49 rules which will generate based distance and its derivative with respect to the time . For example, the rule (IF is PS AND is PS THEN is NS) is based on the consideration that if the UAV is flying near the predefined path, the total control command should not be large. With the negative small parameter , the parameter and the corresponding are reduced. The well-known min-max inference method and the center-of-area defuzzification procedure are used to execute the fuzzy unit.

Figure 5 shows the input-output characteristics of the fuzzy logic unit. The minimum of the output is −0.0007302. In this paper, the control parameters and are chosen as 0.0006 and 0.0008, respectively. Then one has the fact that is always positive with .

#### 4. Simulations

The simulations about the proposed controller were studied in the Matlab/Simulink environment [19]. The Aerosonde UAV model [22] was applied as a test vehicle while doing the simulation, where the UAV model was designed by using the Aerosim Aeronautical Simulation Block Set [23] which provides a complete set of tools for development of detailed 6-degree-of-freedom nonlinear models. Figure 6 presents the Simulink model which contains the proposed smooth path following controller, static inner loop controller, and the UAV model used for the simulation studies. The inputs of the smooth path following controller from the states are the inertial position and velocity which will be used to generate the vehicle’s current course.

The initial position of the UAV was at the origin of the local coordinate system, and its initial heading was set as 360 deg north, respectively. For simulation, the initial inertial speed of the UAV was set as 25 m/s. In order to test the performance of the proposed controller, the wind with 8 m/s from 270 deg west was added to the model of the UAV as shown in Figure 6. The simulation sample time was set as 50 ms. While conducting the simulations, we applied the proposed method to follow three types of planar path, that is, the square-, circular-, and athletics track-style paths in Matlab environment, respectively.

*Case 1 (square path following). *The desired horizontal square path was defined with four waypoints, , , , and , as shown in Figure 7(a). The comparison of the path following with the methods PFC and FL_PFC can also be seen in Figure 7(a). Figure 7(b) is the comparison of the distance while following the predefined square path with the controllers PFC and FL_PFC. While executing the square line path following, the predefined behavior that the UAV will switch course in advance with 200 meters was adopted, which results in the sharp changes of about 200 meters. The elliptic marks A, B, C, D, E, and F in Figure 7(b) indicate that the overshoot of the path following and the oscillation amplitude by using the method FL_PFC are both smaller than those by using the method PFC. And the maximum overshoots and time difference of arrival (TDOA, defined as the time difference () between the two methods for the vehicle to do the switching maneuver near the waypoint) displayed in the areas A, B, C, D, E, and F are listed in Table 2.

Figure 7(c) shows the parameterused for the methods FL_PFC and PFC, respectively. With adjusted, the course rate command was derived to drive the UAV to follow the path with better performance as shown in Figure 7(b). Figure 7(d) presents the comparison of the inertial velocity while following the predefined path with the two proposed methods. The inertial velocity is changing due to the influence of the constant wind speed. However, the inertial velocity with the method FL_PFC is smoother than that with the method PFC. It indicates that the following performance is modified by the fuzzy logic rule. By adjusting the parameter , the overshoots and oscillation will be reduced, and the quickness of the path following will be maintained. It can also be seen from the TDOA listed in Table 2 that, by using the method FL_PFC, the vehicle can reach the set waypoints more quickly. So if a predefined flight path is long, the vehicle can finish it with shorter time by using the method FL_PFC.

**(a)**

**(b)**

**(c)**

**(d)**

As Figure 7(d) and Table 2 show, while turning near the point (2100, −1900), the maximum overshoot in the area C presents the fact 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 deg west influences the turning of the UAV dramatically. With the method PLC, the maximum overshoot in area C is 29.26 m; in contrast, that with the method FL_PFC is only 4.576 m. This result demonstrates the effectiveness of the path following controller FL_PFC.

*Case 2 (circular path following). *The desired horizontal circular path was defined as . Figure 8(a) shows that the vehicle will follow the predefined circular path after the approximation of transition with an approximate invariant course value. The zoom in detail in Figure 8(b) indicates that the vehicle can reach the predefined path with smaller overshoot by using the method FL_PFC. The oscillations that appear from time of 80 s to 110 s were caused by the wind disturbance.

**(a)**

**(b)**

**(c)**

**(d)**

*Case 3 (athletics track-style path following). *In this case, the athletics track-style path was adopted by combining the line-style and circular-style paths together. The simulation results are shown in Figure 9. Figure 9(b) indicates that, compared with the method PFC, the method FL_PFC will guide the UAV towards the predefined path faster together with smaller oscillation amplitude.

**(a)**

**(b)**

#### 5. Conclusions

A horizontal smooth path following guidance law for a small unmanned air vehicle is presented in this paper. With the combination of the Lyapunov stability and the inference ability of fuzzy logic, the proposed path following controller FL_PFC still has its stability guaranteed by the mechanism of the Lyapunov stability arguments and adopts the simple structure of the method PFC. With a key parameter of the guidance law adjusted based on fuzzy logic technique, the path following performance was improved with smaller overshoot and oscillation amplitude and shorter reaching time even in the presence of wind with 8 m/s. The proposed methods were successfully implemented in following three types of planar path, that is, the square-, circular-, and athletics track-style paths via simulations in the Matlab/Simulink environment.

Our future work will focus on developing a 3D smooth path following controller; the control parameters will also be adjusted with the help of the fuzzy logic or optimization techniques to improve the path following performance.

#### Conflicts of Interest

The authors declare that they have no conflicts of interest.

#### Acknowledgments

This work was supported by the National Natural Science Foundation of China (no. 61503172), the National High Technology Research and Development Program of China (no. 2011AA040202), and the 2016 Provincial Program to Fostering Distinguished Young Scholars of Scientific Research in Universities of Fujian Province.