Abstract
To improve the trajectory tracking accuracy, the anti-jamming performance, and the environment adaptability of a quadrotor, the paper proposes a new adaptive trajectory tracking algorithm with multilayer neural network and sliding mode control method. The major difference between other related approaches is that the paper uses the multilayer neural network in the system and the neural network is online computing in the whole process. Firstly, the paper establishes the quadrotor dynamic model and introduces the conception of Sigma-Pi neural network. Then, the paper adds the neural network to the attitude and trajectory tracking control loop. Moreover, the paper designs the adaptive neural network control law. At last, to illustrate the stability of the adaptive control law, the paper gives the Lyapunov stability analysis. Finally, to demonstrate the effectiveness of the method, the paper gives different types of simulation. Comparing with different cases, when increasing the layer of the neural network, the trajectory tracking performance becomes better. In addition, introducing multilayer neural network into the system could improve the anti-interference ability of the system and has a high-precision in tracking the desire trajectory.
1. Introduction
Nowadays, the quadrotor UAV is widely applied both in military and civilian areas [1–3]. At the same time, all these applications drive a continuous progress in path planning, system stability analysis, and trajectory tracking areas [4]. All these areas consisted of tracking the desire trajectory, designing a high control accuracy algorithm, and improving the environment adaptability of a quadrotor and others. However, it is well known that the quadrotor UAV is a strong nonlinear, underactuated, and highly coupled system [5]. So, how to design a proper control algorithm to tack the desire trajectory and improve the accuracy and stability of the system has become challenging research.
To research these problems, researchers have proposed many methods all over the world. FOPD (Robust Fractional-Order PD) Controller is researched for a Wheeled Mobile Robot (WMR) in reference [6], which firstly presents an improved flat phase property as a robust controller tuning specification to improve the controlled system robustness while this reference just considers how to guarantee the stability of the system and the tracking error is very large. To stabilize the translational and rotational motion of a quadrotor system and enforce it to track a given trajectory with minimum energy and error, a NLPID (nonlinear proportional integral derivative) controller is proposed in reference [7], where their parameters are tuned using a genetic algorithm (GA) to minimize a multiobjective output performance index. However, this reference just analyzes the certain conditions on the gains of the NLPID controllers and the tracking performance is very poor. To improve the system’s transient responses, the genetic self-tuning PID algorithm is studied for the aerosonde UAV model in reference [8]. Though the GA is introduced to the PID algorithm to improve the intelligence degree, it does not analyze the pitching, rolling, and yawing characteristic of the UAV and the simulation is too simple. In reference [9], the strategies for Model Predictive Control (MPC) design and implementation for UAV are discussed. The main idea of this literature is the system identification techniques which are used to derive an estimate of the system model while the tracking performance and the environmental adaptability is so poor. To avoid the frequent periodic execution of the control tasks and reduce the computing cost, an event-trigger-based fractional-order sliding mode control strategy is investigated in reference [10]. All simulations results demonstrated that the proposed controller based on the event-triggered technique can track the attitude command well. In reference [11], a new controller including an estimate of the external disturbance is proposed to deal with the presence of constant wind disturbance. When considering the external disturbance, this method just introduces the constant wind disturbance. A new adaptive controller is designed by using adaptive output feedback linearization and optimal control techniques in reference [12]. Simulation results show that the tracking errors is very large. An integrator backstepping approach is proposed in [13]. Several numerical simulation results verify the effectiveness in yaw direction. However, in this paper, it just uses this method in position control of the quadrotor. To deal with a quadrotor in the existence of matched disturbances, a barrier function adaptive nonsingular terminal sliding mode controller is designed in reference [14]. Several numerical simulations show the tracking performance using this method, while in this paper we will track more difficult curve and improve the external disturbance force. When considering input-delay, model uncertainty, and wind disturbance, an adaptive super-twisting terminal sliding mode control approach is designed in reference [15]. Comparing with the traditional sliding mode control method, the adaptive compensation term and the integral term are introduced to construct the sliding surfaces. Several simulations are provided to demonstrate the validation and success of planned control technique. As in [16], the Backstepping, Feedback Linearization control-oriented algorithms, NLGL, and Carrot-Chasing geometric algorithm are implemented and a quadrotor simulation platform is compared. Considering the disturbances and input constraints, the paper proposes a novel finite-time backstepping approach to tackle the trajectory tracking problem of quadrotors in reference [17]. Several contrast simulations demonstrate the effectiveness and superiority of the method. However, it is obvious that the performance is not better with large angle manoeuvring. To solve the parametric uncertainties and external disturbances, an extended state observer-based robust dynamic surface trajectory tracking controller is designed in reference [18]. The main idea of this literature is that it designs the extended state observers to online estimate the unmeasurable velocity states and lumped disturbances existed in translational and rotational dynamics, respectively, based on the separate outer-and inner-loop control methodologies. From different simulations, we will conclude that this method can track different shaped trajectories, but the tracking error is large. To track the moving target, a Fuzzy-PI controller is developed in [19]. It uses the position data as input to adjust the parameters of the PI controller. Several simulations of a quadcopter tracking a moving target are conducted in different environments to verify the performance of the system.
Above all these classical trajectory tracking methods, many researchers start introducing neural network into the UAV control system, especially in recent years. In reference [20], an adaptive switch controller (ASC) is proposed for the nonlinear multi-input multi-output system (MIMO). In this paper, the ASC is an online switch between the neural network adaptive PID (APID) controller and the neural network indirect adaptive controller (IAC). Through this method is workable, it does not consider any disturbance or parameter perturbation and just track the 2D curve. A robust neural adaptive BS control is designed to deal with the limitations proposed in [21]. Using this method, a neural approximator is introduced to estimate and compensate for the perturbations. In [22], the BP neural network is just used to train the flight data before constructing the related dynamic model and BP neural network plays a very weak role during the flight course. To deal with the UAV landing on a ground marker, an autonomous quadrotor landing algorithm using deep reinforcement learning is proposed in [23]. From all simulations, it is clear that this method just uses deep reinforcement learning approach to train the landing data. An adaptive dynamic controller to track a trajectory in 3D space is proposed in [24]. This controller structure consists of a kinematic controller that generates reference commands to a dynamic compensator in charge of changing the reference commands according to the system dynamics. Using this method, the parameters of the dynamic compensator are directly updated during navigation, configuring a directly updated self-tuning regulator with input error, aiming at reducing the tracking errors, thus improving the system performance in task accomplishment. However, the tracking performance is poor. In [25], the performance and accuracy of the inner control loop providing attitude control are investigated when using intelligent flight control systems trained with state-of-the art RL algorithms, deep deterministic gradient policy (DDGP),trust region policy optimization (TRPO) and proximal policy optimization (PPO). However, this method just develops an open-source high-fidelity simulation environment to train a flight controller attitude control of a quadrotor through RL off-line training.
In a word, it is clear that when using neural network in the UAV control system, all those previous researchers often use signal layer neural network or use it to train the flight data off-line. However, the prominent disadvantage of using signal layer neural network and off-line calculation is that the environment adaptability is very poor. So, to improve the trajectory tracking accuracy and the environmental adaptability, the multilayer neural network is introduced into the control system and the major difference between previous methods is that the multiplayer neural network is online calculation. So, after introducing the conception of neural network, it is added to the quadrotor dynamic model to compensate the model error and external disturbance. Moreover, the neural network is added to the attitude and trajectory tracking control loop, and then taking three layers neural network as an example, the paper designs the adaptive neural network control law. At last, to illustrate the stability, the paper gives the Lyapunov stability analysis.
The rest of the paper is organized as follows: the trajectory tacking problem is defined in Section 2. In Section 3, the quadrotor dynamic model is presented. Section 4 gives the Sigma-Pi neural network and designs the Sigma-Pi neural network control law. The stability analysis of the control law will also be given in this section. Section 5 reports the comparative simulation results of different algorithms and discusses their performance. Finally, Section 6 points out some conclusions about the proposal. The future recommendation is given in Section 7.
2. Trajectory Tracking Problem
In this paper, it addresses the trajectory tracking control problem of a quadrotor. This problem is defined as making a quadrotor track the pre-established trajectory in 3D space.
2.1. Trajectory Tracking Definition
The desired trajectory be described by a curve where . represents the total virtual arc length in the space. Then, the trajectory tracking problem can be regarded as designing an appropriate controller that ensures convergence of the position to . The desire trajectory and position are shown in Figure 1.

2.2. Coordinate Definition
To describe the relative motion of the quadrotor, the coordinate frames are defined as follows.
2.2.1. Inertial Coordinate Frame
In this paper, the earth coordinate frame is assumed as the inertial coordinate denoted as , and it is located at the surface of the earth with in the direction of North, pointing West, and pointing opposite direction to the centre of the Earth.
2.2.2. Body-Fixed Coordinate Frame
As can be seen in Figure 1, the coordinate system denoted as is fixed to the quadrotor body. The origin of the body-sfixed reference frame coincides with the centre of the quadrotor. In this coordinate, points front rotor, points the left rotor, and points the direction such that the orthogonal triad and right-hand rule are satisfied. The detailed information of this coordinate is shown in Figure 1.
2.2.3. Transformation Matrices
As defined previously, and will be used in the derivation of the dynamic model. By making successive rotations around corresponding axis, one can obtain the transformations matrices. Then, using this approach, the transformation matrix that transforms from to is as follows:
Using the same approach, the transformation matrix that transforms from to is as follows:
In (1) and (2), represents and function, respectively. Then, from (1) and (2), it is clear that
3. Quadrotor Dynamic Model
Before presenting the dynamic model, the paper considers that the quadrotor is a grid body and be just affected by gravity, thrust, and aerodynamic drag during the flight. Then, using Newton’s equations of motion for translational and rotational dynamics, the dynamic model of the quadrotor will be obtained as follows:where and refer to the quadrotor’s position and velocity vector, respectively. is the mass, and is the gravitational acceleration constant. is a unitary vector. denotes the aerodynamic drag coefficient, which is a diagonal matrix. is body angular velocity and its time derivative . represents rate of change of Euler angles, which denote roll, pitch, and yaw angles, respectively. The rotation matrix from and is dependent on these three Euler angles. represents the approximate inertia matrix. The rotation matrix and the body inertia matrix are denoted as follows:where is denoted as follows:
In addition, represents the resultant thrust force defined as follows:
3.1. Linearization
From (5), the rotation matrix can be simplified by making the assumption that the body angular velocities and rate of change of Euler angles are equal if perturbations from hover condition are small. Then, the rotation matrix can be written as follows:
Finally, the relation between body angular velocities and rate of change of Euler angles becomes
Combining all these equations, the dynamic model of a quadrotor can be written in the following form:where are
4. Sigma-Pi Neural Network and Adaptive Control Law Design
4.1. Sigma-Pi Neural Network
Like other neural networks, the Sigma-Pi neural network also consists of input layer, hidden layer, and output layer. The hidden layer consisted of the summation neurons and quadrature neurons. The advantages of this structure are that it not only preserves the highly nonlinear mapping ability but also increases the flexibility of the network. So, according to the specific problem, one can construct the appreciate networks to improve the learning efficiency. The typical structure of Sigma-Pi neural network is shown in Figure 2.

As shown in Figure 2, the command and the state feedback consist the input space of neural network. The hidden layer is composed of alternating summation neurons and quadrature neurons. is an N-dimensional vector, and is the element of . is an adjustable weight from layer to quadrature neurons in hidden layer, and hidden layer also has which is an adjustable weight from quadrature neurons to summation neurons. Choosing different hidden layer, there is an involved weight matrix between each layer. is the quadrature neurons for output. is the output of the neural network. Then, the equation of Sigma-Pi neural network is as follows:
In (12), is the net layers of neural network excepting output layer. When , the hidden layer just has a signal net layer with quadrature neurons. denotes the nonlinear activation function and is selected as the logistic function, for all the results reported in this paper. represents the basic function vector. denotes the adjustable threshold of the quadrature neurons of the output. In this paper, it will talk about adding the neural network to attitude and position control system.
4.2. Sigma-Pi Neural Network Control Structure
To design the corresponding Sigma-Pi neural network control law, this paper will combine the sliding mode control method. The control structure is shown in Figure 3.

As shown in Figure 3, it includes trajectory references module, command filter module, controller, adaptive control module, dynamics module, and sliding mode control module. The adaptive control structure is shown in Figure 4.

As shown in Figures 4 and 5, represents the control input calculated by neural networks. The number of hidden layers and neurons is determined by the specific problem. In this paper, we will discuss the one or three hidden layers Sigma-Pi neural network.

4.3. Adaptive Control Law Design
In this section, this paper will design the adaptive control law. Combining (4) and considering the modelling error, equation (4) can be written as follows:where presents the Euler angles and position of the quadrotor; represents the neural network control input; denotes the modelling error; represents the input generated by rotors; and denotes the moment generated by fours rotors.
In this paper, the neural network is used to compensate the tracking error. If we choose different hidden layers, the control input will be different. If we chose a signal hidden layer, the neural network will become a neural network with the input layer and a signal hidden layer with quadrature neurons. Then, the neural network control input can be written as follows:where represents basis function vector which is defined as follows:where kron represents the Kronecker product.
To design the adaptive control law, the paper defines that is the optimal neural network control input. Then, we will get the following equation:where represents the optimal weight coefficient matrix; then, the error between the optimal control input and the modelling error can be expressed as follows:
So, choosing different hidden layers, we will get different Sigma-Pi neural network control input .
4.3.1. Attitude Control Law Design
The attitude control law will be designed in this section, and then the paper will give the appropriate Lyapunov-type stability analysis.
Theorem 1. The adaptive attitude control law with three layers neural network for yaw, roll, and pitch is defined as follows.
Proof. Firstly, the roll angle tracking error can be defined as follows:Then, the first-order differential equation can be obtained as the following equations:According to (22) and (23), we can construct the sliding surface as follows:Then, the first-order differential function can be defined as the following equation:where and .
According to (23), we can select the control law as follows:Substituting into (22) and (23), the first-order differential s function is as follows:where .
Then, the paper defines the Lyapunov function related to and .Then, the first-order differential equation can be defined as the following equation:According to (26), we will define the adaptive control law as follows:Substituting into (26) and (27), the first-order differential function is as follows:According to (29), when , the Lyapunov function . The system is stable.
Using the same method, we can get the adaptive Sigma-Pi neural network control law of the pitch and the yaw channel.where are defined as follows:
4.3.2. Position Control Law Design
Theorem 2. The adaptive position control law with three-layer neural network in the direction is defined as follows:
To reduce the trajectory tracking error, the paper also adds the Sigma-Pi neural network to quadrotor position control loop. Using the same method, we can get the Sigma-Pi neural network compensation control law in the direction. Firstly, we will define the tracking error in direction as follows:
Then, the first-order differential equation can be obtained as the following equations:
According to (32) and (33), we can construct the sliding surface as follows:
Then, the first-order differential function can be defined as the following equation:
According to (11), is defined as follows:where . Then, we can get the function as follows:
Then,where .
Then, we can define the Lyapunov function which is related to and .
Then, the first-order differential equation can be defined as the following equation:
According to equations (13), (31), and (38), can be written as follows:
According to (41), the Lyapunov function . The system is stable.
Using the same method, we can get the adaptive Sigma-Pi neural network control law in the direction.
5. Numerical Simulation
In this section, several numerical examples will be introduced to demonstrate the effectiveness of the adaptive control law. The simulation parameters of quadrotor are shown in Table 1. In this paper, to solve the problem and simulate all experiments, we all use Matlab Simulink software and the computer we used is ThinkPad E480. The parameter of this computer is shown in Table 2.
5.1. Case A: Simulation with Different Hidden Layers
In this case, the paper will demonstrate that the tracking performance will be better when increasing the hidden layers. So, the paper uses different hidden layers neural network to track the same curve. The desired curve is shown in Table 3. Simulation results are shown in Figures 6–8.



As can be seen in Figure 6, it illustrates the trajectory tracking results using different hidden layers neural network. These three curves are reference curve, the tracking curve with a signal hidden layer, and the tracking curve with 3 hidden layers. It is clear that the quadrotor can soon track the desire trajectory using three hidden layers neural network. To be more specific, it is observed that with increase in hidden layer, the tracking performance becomes better.
The curve of tracking error by using neural network with different hidden layers is shown in Figure 7. It is obvious that the tracking error with three hidden layers neural network is obviously small in each direction. To be more specific, we can also observe that using three hidden layers neural network, the track error will be soon converged to 0 before 4s in each direction. So, we can conclude that with the increase in network layers, the tracking error will be soon converged and the tracking time can also be decreased.
As can be seen in Figure 8, it gives the attitude angle change of the quadrotor by using different hidden layers neural network. By contrast, we can observe that with the increase in the hidden layer, the attitude angle jitter is obviously eliminated. It also demonstrates that introducing the neural network into the attitude control loop can improve the stability of the system. At the same time, it can decrease the jitter of the control system.
5.2. Case B: Tracking 3D “8-Shaped” Spiral Curve
In this simulation, the paper will evaluate the lift, sideslip, and forward performances of a quadrotor to track the “8-shaped” spiral curve using three hidden layers neural network. Comparing with reference [24], we increase the tracking difficulty that the initial position error is larger and improve the frequency of sine curves. The desired curve parameters are shown in Table 4. All these simulation results are shown in Figures 9–12.




Figures 9 and 10 show the result of tracking “8-shaped” curve based on the adaptive trajectory tracking method proposed in this paper. From different perspectives, we can observe that the quadrotor can soon track the desire trajectory. It is also demonstrated that the quadrotor has a better performance in lift, sideslip, and forward. Comparing with reference [24], the tracking performance is better, even increasing the tracking difficulty.
Figure 11 shows the trajectory tracking error curve when tracking the “8-shaped” curve. Comparing with reference [28], when tracking the same 8-shaped trajectory, it is obvious that the tracking error in each direction is very small and the initial tracking error will be soon converged to 0 before 3 s.
Figure 12 shows the change of attitude angle. It is obvious that despite the initial attitude angle fluctuates greatly, the attitude will be soon converged. The main reason for this phenomenon is that the difference between the initial position, pointing and the desire position, pointing.
5.3. Case C: Anti-Interference Simulation
To verify the disturbance rejection properties of the method, we will add the external disturbance which effects the translation motion in direction. In the simulation, the quadrotor will also track the 3D curve used in Case A and uses three hidden layers neural network to compensate the tracking error. The involved 3D curve parameters are shown in Table 5.
As shown in Table 5, the paper will regard the white noise as the external disturbance force added to the system and the units of this force is N. The corresponding disturbance force curve is shown in Figure 13. As shown in Figure 13, it is clear that the change of the noise force is so random and the magnitude of the force is bigger than reference [10]. So, this type of the external force is very suitable to verify the disturbance rejection properties of the method proposed in this paper. The trajectory tracking results in disturbance circumstance are shown in Figures 13–17.





As can be seen in Figures 14 and 15, even adding the external disturbance to the system, the quadrotor still tracks the desire curve well. In addition, we can also observe that when disturbances occur, the tracking curve fluctuates slightly. However, the quadrotor will soon be stabilized.
Figure 16 shows the trajectory tracking error curve of the quadrotor. It is obvious that despite adding the strong noise to the system, the tracking error in each direction is very small and the initial tracking error will be soon converged to 0 before 4 s. As a whole, the system is unaffected by the noise force. Comparing with reference [26], it is clear that the method proposed in this paper has a strong anti-interference feature.
Figure 17 shows the change of the attitude angle. It is obvious that when adding the noise force to each direction, the involved Euler angles fluctuate slightly. This illustrates that introducing the neural network to the system can improve the ability of anti-inference. It also demonstrates that the external disturbances can be successfully rejected.
6. Conclusions
This paper proposes a new adaptive trajectory tracking algorithm of the quadrotor by introducing multilayer neural network into the system. First of all, the paper gives the dynamic model of the quadrotor. Then, the principle of Sigma-Pi neural network was introduced. At the same time, the paper designs the corresponding adaptive control law and gives the Lyapunov-type stability analysis. To demonstrate the effectiveness of the method proposed in this paper, several involved simulations are given. By comparison, using the adaptive control method proposed in this paper can decrease the tracking error and improve the stability of the system. We also conclude that with increasing the neural network layer, the trajectory tracking performance is becoming better.
7. Future Recommendations
Though a new adaptive trajectory tracking algorithm is better than traditional process especially in having a high-precision in trajectory tracking, the stability of the system is improved. There remain many problems such as how to transplant the adaptive trajectory tracking algorithm to the platform. In our experience, we cordially recommend the Xilinx-Z7 platform. When transplanting the algorithm, we will face how to simplify the algorithm model to increase computational efficiency. We will continue researching all these problems in the future.
Data Availability
The data used to support the findings of this study are available from the corresponding author upon request.
Conflicts of Interest
The authors declare that they have no conflicts of interest.
Acknowledgments
The authors would like to thank the support of the flight control lab of Beijing University of Technology for this research. This study was supported by the National Natural Science Foundation of China (no. 61673212) and the Natural Science Foundation of Jiangsu Province (no. BK20161490).