# Adaptive Trajectory Tracking Algorithm of a Quadrotor with Sliding Mode Control and Multilayer Neural Network

Authors: Kang Niu; Di Yang; Xi Chen; Rong Wang; Jianqiao Yu
Journal: Complexity
 (2022)

---

## 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.


---

## Body

## 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 H∞ 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 Section2. 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τdγ=xdγ,ydγ,zdγT where γ∈0:γf. γf 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 Pt to τdγ. The desire trajectory τdγ and position Pt are shown in Figure 1.Figure 1
Trajectory tracking problem.


### 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ςe is assumed as the inertial coordinate denoted as ςe=Oe,xe,ye,ze, and it is located at the surface of the earth with xe in the direction of North, ye pointing West, and ze pointing opposite direction to the centre of the Earth.


#### 2.2.2. Body-Fixed Coordinate Frame

As can be seen in Figure1, the coordinate system denoted as ςb=Ob,xb,yb,zb is fixed to the quadrotor body. The origin of the body-sfixed reference frame coincides with the centre of the quadrotor. In this coordinate, xb points front rotor, yb points the left rotor, and zb 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,ςb and ςe 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 Lbe that transforms from ςe to ςb is as follows:(1)Leb=cθcψcθsψ−sθsϕsθcψ−cϕsψsϕsθsψ+cϕcψsϕcθcϕsθcψ+sϕsψcϕsθsψ−sϕcψcϕcθ.Using the same approach, the transformation matrixLbe that transforms from ςb to ςe is as follows:(2)Lbe=cθcψsϕsθcψ−cϕsψcϕsθcψ+sϕsψcθsψsϕsθsψ+cϕcψcϕsθsψ−sϕcψ−sθsϕcθcϕcθ.In (1) and (2), s∗c∗ represents sin∗ and cos∗ function, respectively. Then, from (1) and (2), it is clear that(3)Lbe=Leb−1.


## 2.1. Trajectory Tracking Definition

The desired trajectory be described by a curveτdγ=xdγ,ydγ,zdγT where γ∈0:γf. γf 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 Pt to τdγ. The desire trajectory τdγ and position Pt are shown in Figure 1.Figure 1
Trajectory tracking problem.


## 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ςe is assumed as the inertial coordinate denoted as ςe=Oe,xe,ye,ze, and it is located at the surface of the earth with xe in the direction of North, ye pointing West, and ze pointing opposite direction to the centre of the Earth.


### 2.2.2. Body-Fixed Coordinate Frame

As can be seen in Figure1, the coordinate system denoted as ςb=Ob,xb,yb,zb is fixed to the quadrotor body. The origin of the body-sfixed reference frame coincides with the centre of the quadrotor. In this coordinate, xb points front rotor, yb points the left rotor, and zb 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,ςb and ςe 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 Lbe that transforms from ςe to ςb is as follows:(1)Leb=cθcψcθsψ−sθsϕsθcψ−cϕsψsϕsθsψ+cϕcψsϕcθcϕsθcψ+sϕsψcϕsθsψ−sϕcψcϕcθ.Using the same approach, the transformation matrixLbe that transforms from ςb to ςe is as follows:(2)Lbe=cθcψsϕsθcψ−cϕsψcϕsθcψ+sϕsψcθsψsϕsθsψ+cϕcψcϕsθsψ−sϕcψ−sθsϕcθcϕcθ.In (1) and (2), s∗c∗ represents sin∗ and cos∗ function, respectively. Then, from (1) and (2), it is clear that(3)Lbe=Leb−1.


## 2.2.1. Inertial Coordinate Frame

In this paper, the earth coordinate frameςe is assumed as the inertial coordinate denoted as ςe=Oe,xe,ye,ze, and it is located at the surface of the earth with xe in the direction of North, ye pointing West, and ze pointing opposite direction to the centre of the Earth.


## 2.2.2. Body-Fixed Coordinate Frame

As can be seen in Figure1, the coordinate system denoted as ςb=Ob,xb,yb,zb is fixed to the quadrotor body. The origin of the body-sfixed reference frame coincides with the centre of the quadrotor. In this coordinate, xb points front rotor, yb points the left rotor, and zb 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,ςb and ςe 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 Lbe that transforms from ςe to ςb is as follows:(1)Leb=cθcψcθsψ−sθsϕsθcψ−cϕsψsϕsθsψ+cϕcψsϕcθcϕsθcψ+sϕsψcϕsθsψ−sϕcψcϕcθ.Using the same approach, the transformation matrixLbe that transforms from ςb to ςe is as follows:(2)Lbe=cθcψsϕsθcψ−cϕsψcϕsθcψ+sϕsψcθsψsϕsθsψ+cϕcψcϕsθsψ−sϕcψ−sθsϕcθcϕcθ.In (1) and (2), s∗c∗ represents sin∗ and cos∗ function, respectively. Then, from (1) and (2), it is clear that(3)Lbe=Leb−1.


## 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:(4)P˙=V,V˙=−ge+LebFthrust−1/mKtP˙,Θ˙=Rw,Jw˙=−w×Jw+M,where P=xyzT and V=x˙y˙z˙T refer to the quadrotor’s position and velocity vector, respectively. m is the mass, and g is the gravitational acceleration constant. e=001T is a unitary vector. Kt denotes the aerodynamic drag coefficient, which is a diagonal matrix. w=pqrT is body angular velocity and its time derivative w˙. Θ˙=ϕ˙θ˙ψ˙T represents rate of change of Euler angles, which denote roll, pitch, and yaw angles, respectively. The rotation matrix R from ςb and ςe is dependent on these three Euler angles. J represents the approximate inertia matrix. The rotation matrix R and the body inertia matrix J are denoted as follows:(5)R=1sϕtθcϕtθ0cϕ−sϕ0sϕ/cθsϕ/cθ,J=Jxx000Jyy000Jzz,where M is denoted as follows:(6)M=U2dU3dU4TU2=F4−F2U3=F3−F1U4=F4+F2−F3−F1.In addition,Fthrust represents the resultant thrust force defined as follows:(7)Fthrust=00U1T,U1=∑i=14Fi.


### 3.1. Linearization

From (5), the rotation matrix R can be simplified by making the assumption that the body angular velocities w and rate of change of Euler angles Θ˙ are equal if perturbations from hover condition are small. Then, the rotation matrix R can be written as follows:(8)R=100010001.Finally, the relation between body angular velocitiesw and rate of change of Euler angles Θ˙ becomes(9)w=Θ˙.Combining all these equations, the dynamic model of a quadrotor can be written in the following form:(10)x1x2x3x4x5x6x7x8x9x10x11x12=x2Iy−Izx4x6/Ix+U2d/Ixx4Iz−Ixx2x6/Iy+U3d/Iyx6Ix−Iyx2x4/Iz+U4/Izx8uxU1/m−kxx8/mx10uyU1/m−kyx10/mx12−g+uzU1/m−kzx12/m,where ux,uy,anduz are(11)ux=cx1sx3cx5+sx1sx5uy=cx1sx3cx5+sx1sx5uz=cx1cx3,


## 3.1. Linearization

From (5), the rotation matrix R can be simplified by making the assumption that the body angular velocities w and rate of change of Euler angles Θ˙ are equal if perturbations from hover condition are small. Then, the rotation matrix R can be written as follows:(8)R=100010001.Finally, the relation between body angular velocitiesw and rate of change of Euler angles Θ˙ becomes(9)w=Θ˙.Combining all these equations, the dynamic model of a quadrotor can be written in the following form:(10)x1x2x3x4x5x6x7x8x9x10x11x12=x2Iy−Izx4x6/Ix+U2d/Ixx4Iz−Ixx2x6/Iy+U3d/Iyx6Ix−Iyx2x4/Iz+U4/Izx8uxU1/m−kxx8/mx10uyU1/m−kyx10/mx12−g+uzU1/m−kzx12/m,where ux,uy,anduz are(11)ux=cx1sx3cx5+sx1sx5uy=cx1sx3cx5+sx1sx5uz=cx1cx3,


## 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 Figure2.Figure 2
Sigma-Pi neural network structure.As shown in Figure2, 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. Xi is an N-dimensional vector, and xi is the ith element of X. Wij is an adjustable weight from Xi layer to jth quadrature neurons in hidden layer, and hidden layer also has Wjk which is an adjustable weight from jth quadrature neurons to summation neurons. Choosing different hidden layer, there is an involved weight matrix between each layer. hij is the jth quadrature neurons for ith output. YN is the output of the neural network. Then, the equation of Sigma-Pi neural network is as follows:(12)hkm=∏i=1m⋯∑i=1k∏i=1jxiWijβ+θijξjk+θkm,YN=σ∑i=1ηhkmζmnN=1⋯N.In (12), m is the net layers of neural network excepting output layer. When m=1, the hidden layer just has a signal net layer with quadrature neurons. σx denotes the nonlinear activation function and is selected as the logistic function, σx=1/1+e−x for all the results reported in this paper. β represents the basic function vector. θij denotes the adjustable threshold of the jth quadrature neurons of the ith 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 Figure3.Figure 3
Control structure.As shown in Figure3, 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.Figure 4
Position control structure.As shown in Figures4 and 5, UNN 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.Figure 5
Attitude control structure.


### 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:(13)X˙1=X2X˙2=fX1,X2,U,M+UNN−e˜,where X1=ϕθψxyzT presents the Euler angles and position of the quadrotor; UNN represents the neural network control input; e˜=eϕeθeψexeyezT denotes the modelling error; U represents the input generated by rotors; and M 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 inputUNN 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 UNN can be written as follows:(14)YN=∏i=1jxiWijTβ+θijUNN=YNN=1⋯n,where β represents basis function vector which is defined as follows:(15)β=kronkronC1,C2,C3,where kron represents the Kronecker product.To design the adaptive control law, the paper defines thatUNN8 is the optimal neural network control input. Then, we will get the following equation:(16)YN∗=∏i=1jxiWij∗Tβ+θij∗UNN∗=YN∗N=1⋯n,UNN−UNN∗=YN−YN∗=∏i=1jxiW˜ij∗Tβ+θ˜ij∗,where W˜ij∗T represents the optimal weight coefficient matrix; then, the error between the optimal control input and the modelling error can be expressed as follows:(17)UNN−e˜=∏i=1jxiWij∗Tβ+UNN−e˜.So, choosing different hidden layers, we will get different Sigma-Pi neural network control inputUNN.


#### 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.(18)W˜˙ijϕ∗=−sκ2∏i=1jxiβ/λϕW˜˙ijθ∗=−sκ4∏i=1jxiβ/λϕW˜˙ijψ∗=−sκ6∏i=1jxiβ/λψ.Proof.
Firstly, the roll anglex1ϕ tracking error can be defined as follows:(19)e1=x1−x1d.
Then, the first-order differential equatione˙1 can be obtained as the following equations:(20)e˙1=x˙1−x˙1d.
According to (22) and (23), we can construct the sliding surface as follows:(21)s=e˙1+c1e1.
Then, the first-order differential functions˙ can be defined as the following equation:(22)s˙=c1e˙1+e¨1=c1e˙1+x˙2−x¨1d=c1x2−x˙1d+κ1x4x6+U2+UNNϕκ2−x¨1d−e˜ϕ,where κ1=Iy−Iz/Ix and κ2=d/Ix.
According to (23), we can select the control law U2 as follows:(23)U2=1K2−c1x2−x1d−K1x4x6+x1d+e˜ϕ−ηsgns−UNNϕ∗.
Substituting into (22) and (23), the first-order differential s function is as follows:(24)s˙=κ2UNNϕ−UNNϕ∗−ηsgns=κ2∏i=1jxiW˜ijϕ∗Tβ+θ˜ij∗−ηsgns,where η≥κ2θ˜ij∗.
Then, the paper defines the Lyapunov function related tos and W˜ijϕ∗T.(25)Vs,W˜ijϕ∗T=12s2+12λW˜ijϕ∗TW˜ijϕ∗.
Then, the first-order differential equationV˙s,W˜ijϕ∗T can be defined as the following equation:(26)V˙s,W˜ijϕ∗T=ss˙+λW˜ijϕ∗TW˜˙ijϕ∗=sκ2∏i=1jxiW˜ijϕ∗Tβ+θ˜ijϕ∗−ηsgns+λW˜ijϕ∗TW˜˙ijϕ∗,=−ηs+sκ2∏i=1jxiW˜ijϕ∗Tβ+sκ2θ˜ijϕ∗+λW˜ijϕ∗TW˜˙ijϕ∗,=−ηs+sκ2θ˜ijϕ∗+W˜ijϕ∗Tsκ2∏i=1jxiβ+λW˜˙ijϕ∗.
According to (26), we will define the adaptive control law as follows:(27)W˜˙ijϕ∗=−sκ2∏i=1jxiβλϕ.
Substituting into (26) and (27), the first-order differential V˙s,W˜ijϕ∗T function is as follows:(28)V˙s,W˜ijϕ∗T=−ηs+sκ2θ˜ijϕ∗≤0.
According to (29), when η≥κ2θ˜ijϕ∗, the Lyapunov function V˙s,W˜ijϕ∗T≤0. 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.(29)U3=1κ3−c2x4−x˙3d−κ3x2x6+x¨3d+e˜θ−ηsgns−UNNθ∗,W˜˙ijθ∗=−sκ4∏i=1jxiβ,λθU4=1κ6−c3x6−x˙5d−κ5x4x2+x¨5d+e˜ψ−ηsgns−UNNψ∗,W˜˙ijψ∗=−sκ6∏i=1jxiβλψ,where κ3,κ4,κ5,andκ6 are defined as follows:(30)κ1=Iy−IzIx,κ2=dIx,κ3=Iz−IxIy,κ4=dIy,κ5=Ix−IyIz,κ6=dIz.


#### 4.3.2. Position Control Law Design

Theorem 2.
The adaptive position control law with three-layer neural network in thex,y,andz direction is defined as follows:(31)W˜˙ijx∗=−ux∏i=1jxiβλxm,W˜˙ijy∗=−uy∏i=1jxiβλym,W˜˙ijz∗=−uz∏i=1jxiβλzm.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 thex,y,andz direction. Firstly, we will define the tracking error in x direction as follows:(32)e4=x7−x7d.Then, the first-order differential equatione˙4 can be obtained as the following equations:(33)e˙4=x˙7−x˙7d.According to (32) and (33), we can construct the sliding surface as follows:(34)s=c4e4+e˙4.Then, the first-order differential functions˙ can be defined as the following equation:(35)s˙=c4e˙4+e¨4=c4e˙4+x˙8−x¨7d=c4x8−x˙7d+x˙8−x¨7d−e˜x.According to (11), x˙8 is defined as follows:(36)x˙8=uxU1+UNNxm−κ7x8,where κ7=kx/m. Then, we can get the function s˙ as follows:(37)s˙=c4e˙4+e¨4=c4e˙4+x˙8−x¨7d=c4x8−x˙7d+uxU1+UNNxm−κ7x8−x¨7d−e˜x.Then,(38)s˙=uxU1−UNNx∗m−ηsgnx=ux∏i=1jxiW˜ijx∗Tβ+θ˜ijx∗m−ηsgnx,where η≥θ˜ijx∗.Then, we can define the Lyapunov function which is related tos and W˜ijx∗T.(39)Vs,W˜ijx∗T=12s2+12λW˜ijx∗TW˜ijx∗.Then, the first-order differential equationV˙s,W˜ijx∗T can be defined as the following equation:(40)V˙s,W˜ijx∗T=ss˙+λW˜ijx∗TW˜˙ijx∗=sux∏i=1jxiW˜ijx∗Tβ+θ˜ijx∗m−ηsgns+λW˜ijx∗TW˜˙ijx∗,=sux∏i=1jxiW˜ijx∗Tβ+θ˜ijx∗m−ηs+λW˜ijx∗TW˜˙ijx∗,=−ηs+suxθ˜ijx∗m+sW˜ijx∗Tux∏i=1jxiβm+λW˜˙ijx∗.According to equations (13), (31), and (38), V˙s,W˜ijx∗T can be written as follows:(41)V˙s,W˜ijx∗T=ss˙+λW˜ijx∗TW˜˙ijx∗=−ηs+suxθ˜ijx∗m+sW˜ijx∗Tux∏i=1jxiβm+λW˜˙ijx∗,≤−ηs+suxθ˜ijx∗m,≤−ηs+sθ˜ijx∗≤0.According to (41), the Lyapunov function V˙s,W˜ijx∗T≤0. The system is stable.Using the same method, we can get the adaptive Sigma-Pi neural network control law in theyandz direction.(42)W˜˙ijy∗=−uy∏i=1jxiβλym,W˜˙ijz∗=−uz∏i=1jxiβλzm.


## 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 Figure2.Figure 2
Sigma-Pi neural network structure.As shown in Figure2, 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. Xi is an N-dimensional vector, and xi is the ith element of X. Wij is an adjustable weight from Xi layer to jth quadrature neurons in hidden layer, and hidden layer also has Wjk which is an adjustable weight from jth quadrature neurons to summation neurons. Choosing different hidden layer, there is an involved weight matrix between each layer. hij is the jth quadrature neurons for ith output. YN is the output of the neural network. Then, the equation of Sigma-Pi neural network is as follows:(12)hkm=∏i=1m⋯∑i=1k∏i=1jxiWijβ+θijξjk+θkm,YN=σ∑i=1ηhkmζmnN=1⋯N.In (12), m is the net layers of neural network excepting output layer. When m=1, the hidden layer just has a signal net layer with quadrature neurons. σx denotes the nonlinear activation function and is selected as the logistic function, σx=1/1+e−x for all the results reported in this paper. β represents the basic function vector. θij denotes the adjustable threshold of the jth quadrature neurons of the ith 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 Figure3.Figure 3
Control structure.As shown in Figure3, 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.Figure 4
Position control structure.As shown in Figures4 and 5, UNN 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.Figure 5
Attitude control structure.


## 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:(13)X˙1=X2X˙2=fX1,X2,U,M+UNN−e˜,where X1=ϕθψxyzT presents the Euler angles and position of the quadrotor; UNN represents the neural network control input; e˜=eϕeθeψexeyezT denotes the modelling error; U represents the input generated by rotors; and M 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 inputUNN 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 UNN can be written as follows:(14)YN=∏i=1jxiWijTβ+θijUNN=YNN=1⋯n,where β represents basis function vector which is defined as follows:(15)β=kronkronC1,C2,C3,where kron represents the Kronecker product.To design the adaptive control law, the paper defines thatUNN8 is the optimal neural network control input. Then, we will get the following equation:(16)YN∗=∏i=1jxiWij∗Tβ+θij∗UNN∗=YN∗N=1⋯n,UNN−UNN∗=YN−YN∗=∏i=1jxiW˜ij∗Tβ+θ˜ij∗,where W˜ij∗T represents the optimal weight coefficient matrix; then, the error between the optimal control input and the modelling error can be expressed as follows:(17)UNN−e˜=∏i=1jxiWij∗Tβ+UNN−e˜.So, choosing different hidden layers, we will get different Sigma-Pi neural network control inputUNN.


### 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.(18)W˜˙ijϕ∗=−sκ2∏i=1jxiβ/λϕW˜˙ijθ∗=−sκ4∏i=1jxiβ/λϕW˜˙ijψ∗=−sκ6∏i=1jxiβ/λψ.Proof.
Firstly, the roll anglex1ϕ tracking error can be defined as follows:(19)e1=x1−x1d.
Then, the first-order differential equatione˙1 can be obtained as the following equations:(20)e˙1=x˙1−x˙1d.
According to (22) and (23), we can construct the sliding surface as follows:(21)s=e˙1+c1e1.
Then, the first-order differential functions˙ can be defined as the following equation:(22)s˙=c1e˙1+e¨1=c1e˙1+x˙2−x¨1d=c1x2−x˙1d+κ1x4x6+U2+UNNϕκ2−x¨1d−e˜ϕ,where κ1=Iy−Iz/Ix and κ2=d/Ix.
According to (23), we can select the control law U2 as follows:(23)U2=1K2−c1x2−x1d−K1x4x6+x1d+e˜ϕ−ηsgns−UNNϕ∗.
Substituting into (22) and (23), the first-order differential s function is as follows:(24)s˙=κ2UNNϕ−UNNϕ∗−ηsgns=κ2∏i=1jxiW˜ijϕ∗Tβ+θ˜ij∗−ηsgns,where η≥κ2θ˜ij∗.
Then, the paper defines the Lyapunov function related tos and W˜ijϕ∗T.(25)Vs,W˜ijϕ∗T=12s2+12λW˜ijϕ∗TW˜ijϕ∗.
Then, the first-order differential equationV˙s,W˜ijϕ∗T can be defined as the following equation:(26)V˙s,W˜ijϕ∗T=ss˙+λW˜ijϕ∗TW˜˙ijϕ∗=sκ2∏i=1jxiW˜ijϕ∗Tβ+θ˜ijϕ∗−ηsgns+λW˜ijϕ∗TW˜˙ijϕ∗,=−ηs+sκ2∏i=1jxiW˜ijϕ∗Tβ+sκ2θ˜ijϕ∗+λW˜ijϕ∗TW˜˙ijϕ∗,=−ηs+sκ2θ˜ijϕ∗+W˜ijϕ∗Tsκ2∏i=1jxiβ+λW˜˙ijϕ∗.
According to (26), we will define the adaptive control law as follows:(27)W˜˙ijϕ∗=−sκ2∏i=1jxiβλϕ.
Substituting into (26) and (27), the first-order differential V˙s,W˜ijϕ∗T function is as follows:(28)V˙s,W˜ijϕ∗T=−ηs+sκ2θ˜ijϕ∗≤0.
According to (29), when η≥κ2θ˜ijϕ∗, the Lyapunov function V˙s,W˜ijϕ∗T≤0. 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.(29)U3=1κ3−c2x4−x˙3d−κ3x2x6+x¨3d+e˜θ−ηsgns−UNNθ∗,W˜˙ijθ∗=−sκ4∏i=1jxiβ,λθU4=1κ6−c3x6−x˙5d−κ5x4x2+x¨5d+e˜ψ−ηsgns−UNNψ∗,W˜˙ijψ∗=−sκ6∏i=1jxiβλψ,where κ3,κ4,κ5,andκ6 are defined as follows:(30)κ1=Iy−IzIx,κ2=dIx,κ3=Iz−IxIy,κ4=dIy,κ5=Ix−IyIz,κ6=dIz.


### 4.3.2. Position Control Law Design

Theorem 2.
The adaptive position control law with three-layer neural network in thex,y,andz direction is defined as follows:(31)W˜˙ijx∗=−ux∏i=1jxiβλxm,W˜˙ijy∗=−uy∏i=1jxiβλym,W˜˙ijz∗=−uz∏i=1jxiβλzm.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 thex,y,andz direction. Firstly, we will define the tracking error in x direction as follows:(32)e4=x7−x7d.Then, the first-order differential equatione˙4 can be obtained as the following equations:(33)e˙4=x˙7−x˙7d.According to (32) and (33), we can construct the sliding surface as follows:(34)s=c4e4+e˙4.Then, the first-order differential functions˙ can be defined as the following equation:(35)s˙=c4e˙4+e¨4=c4e˙4+x˙8−x¨7d=c4x8−x˙7d+x˙8−x¨7d−e˜x.According to (11), x˙8 is defined as follows:(36)x˙8=uxU1+UNNxm−κ7x8,where κ7=kx/m. Then, we can get the function s˙ as follows:(37)s˙=c4e˙4+e¨4=c4e˙4+x˙8−x¨7d=c4x8−x˙7d+uxU1+UNNxm−κ7x8−x¨7d−e˜x.Then,(38)s˙=uxU1−UNNx∗m−ηsgnx=ux∏i=1jxiW˜ijx∗Tβ+θ˜ijx∗m−ηsgnx,where η≥θ˜ijx∗.Then, we can define the Lyapunov function which is related tos and W˜ijx∗T.(39)Vs,W˜ijx∗T=12s2+12λW˜ijx∗TW˜ijx∗.Then, the first-order differential equationV˙s,W˜ijx∗T can be defined as the following equation:(40)V˙s,W˜ijx∗T=ss˙+λW˜ijx∗TW˜˙ijx∗=sux∏i=1jxiW˜ijx∗Tβ+θ˜ijx∗m−ηsgns+λW˜ijx∗TW˜˙ijx∗,=sux∏i=1jxiW˜ijx∗Tβ+θ˜ijx∗m−ηs+λW˜ijx∗TW˜˙ijx∗,=−ηs+suxθ˜ijx∗m+sW˜ijx∗Tux∏i=1jxiβm+λW˜˙ijx∗.According to equations (13), (31), and (38), V˙s,W˜ijx∗T can be written as follows:(41)V˙s,W˜ijx∗T=ss˙+λW˜ijx∗TW˜˙ijx∗=−ηs+suxθ˜ijx∗m+sW˜ijx∗Tux∏i=1jxiβm+λW˜˙ijx∗,≤−ηs+suxθ˜ijx∗m,≤−ηs+sθ˜ijx∗≤0.According to (41), the Lyapunov function V˙s,W˜ijx∗T≤0. The system is stable.Using the same method, we can get the adaptive Sigma-Pi neural network control law in theyandz direction.(42)W˜˙ijy∗=−uy∏i=1jxiβλym,W˜˙ijz∗=−uz∏i=1jxiβλzm.


## 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.(18)W˜˙ijϕ∗=−sκ2∏i=1jxiβ/λϕW˜˙ijθ∗=−sκ4∏i=1jxiβ/λϕW˜˙ijψ∗=−sκ6∏i=1jxiβ/λψ.Proof.
Firstly, the roll anglex1ϕ tracking error can be defined as follows:(19)e1=x1−x1d.
Then, the first-order differential equatione˙1 can be obtained as the following equations:(20)e˙1=x˙1−x˙1d.
According to (22) and (23), we can construct the sliding surface as follows:(21)s=e˙1+c1e1.
Then, the first-order differential functions˙ can be defined as the following equation:(22)s˙=c1e˙1+e¨1=c1e˙1+x˙2−x¨1d=c1x2−x˙1d+κ1x4x6+U2+UNNϕκ2−x¨1d−e˜ϕ,where κ1=Iy−Iz/Ix and κ2=d/Ix.
According to (23), we can select the control law U2 as follows:(23)U2=1K2−c1x2−x1d−K1x4x6+x1d+e˜ϕ−ηsgns−UNNϕ∗.
Substituting into (22) and (23), the first-order differential s function is as follows:(24)s˙=κ2UNNϕ−UNNϕ∗−ηsgns=κ2∏i=1jxiW˜ijϕ∗Tβ+θ˜ij∗−ηsgns,where η≥κ2θ˜ij∗.
Then, the paper defines the Lyapunov function related tos and W˜ijϕ∗T.(25)Vs,W˜ijϕ∗T=12s2+12λW˜ijϕ∗TW˜ijϕ∗.
Then, the first-order differential equationV˙s,W˜ijϕ∗T can be defined as the following equation:(26)V˙s,W˜ijϕ∗T=ss˙+λW˜ijϕ∗TW˜˙ijϕ∗=sκ2∏i=1jxiW˜ijϕ∗Tβ+θ˜ijϕ∗−ηsgns+λW˜ijϕ∗TW˜˙ijϕ∗,=−ηs+sκ2∏i=1jxiW˜ijϕ∗Tβ+sκ2θ˜ijϕ∗+λW˜ijϕ∗TW˜˙ijϕ∗,=−ηs+sκ2θ˜ijϕ∗+W˜ijϕ∗Tsκ2∏i=1jxiβ+λW˜˙ijϕ∗.
According to (26), we will define the adaptive control law as follows:(27)W˜˙ijϕ∗=−sκ2∏i=1jxiβλϕ.
Substituting into (26) and (27), the first-order differential V˙s,W˜ijϕ∗T function is as follows:(28)V˙s,W˜ijϕ∗T=−ηs+sκ2θ˜ijϕ∗≤0.
According to (29), when η≥κ2θ˜ijϕ∗, the Lyapunov function V˙s,W˜ijϕ∗T≤0. 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.(29)U3=1κ3−c2x4−x˙3d−κ3x2x6+x¨3d+e˜θ−ηsgns−UNNθ∗,W˜˙ijθ∗=−sκ4∏i=1jxiβ,λθU4=1κ6−c3x6−x˙5d−κ5x4x2+x¨5d+e˜ψ−ηsgns−UNNψ∗,W˜˙ijψ∗=−sκ6∏i=1jxiβλψ,where κ3,κ4,κ5,andκ6 are defined as follows:(30)κ1=Iy−IzIx,κ2=dIx,κ3=Iz−IxIy,κ4=dIy,κ5=Ix−IyIz,κ6=dIz.


## 4.3.2. Position Control Law Design

Theorem 2.
The adaptive position control law with three-layer neural network in thex,y,andz direction is defined as follows:(31)W˜˙ijx∗=−ux∏i=1jxiβλxm,W˜˙ijy∗=−uy∏i=1jxiβλym,W˜˙ijz∗=−uz∏i=1jxiβλzm.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 thex,y,andz direction. Firstly, we will define the tracking error in x direction as follows:(32)e4=x7−x7d.Then, the first-order differential equatione˙4 can be obtained as the following equations:(33)e˙4=x˙7−x˙7d.According to (32) and (33), we can construct the sliding surface as follows:(34)s=c4e4+e˙4.Then, the first-order differential functions˙ can be defined as the following equation:(35)s˙=c4e˙4+e¨4=c4e˙4+x˙8−x¨7d=c4x8−x˙7d+x˙8−x¨7d−e˜x.According to (11), x˙8 is defined as follows:(36)x˙8=uxU1+UNNxm−κ7x8,where κ7=kx/m. Then, we can get the function s˙ as follows:(37)s˙=c4e˙4+e¨4=c4e˙4+x˙8−x¨7d=c4x8−x˙7d+uxU1+UNNxm−κ7x8−x¨7d−e˜x.Then,(38)s˙=uxU1−UNNx∗m−ηsgnx=ux∏i=1jxiW˜ijx∗Tβ+θ˜ijx∗m−ηsgnx,where η≥θ˜ijx∗.Then, we can define the Lyapunov function which is related tos and W˜ijx∗T.(39)Vs,W˜ijx∗T=12s2+12λW˜ijx∗TW˜ijx∗.Then, the first-order differential equationV˙s,W˜ijx∗T can be defined as the following equation:(40)V˙s,W˜ijx∗T=ss˙+λW˜ijx∗TW˜˙ijx∗=sux∏i=1jxiW˜ijx∗Tβ+θ˜ijx∗m−ηsgns+λW˜ijx∗TW˜˙ijx∗,=sux∏i=1jxiW˜ijx∗Tβ+θ˜ijx∗m−ηs+λW˜ijx∗TW˜˙ijx∗,=−ηs+suxθ˜ijx∗m+sW˜ijx∗Tux∏i=1jxiβm+λW˜˙ijx∗.According to equations (13), (31), and (38), V˙s,W˜ijx∗T can be written as follows:(41)V˙s,W˜ijx∗T=ss˙+λW˜ijx∗TW˜˙ijx∗=−ηs+suxθ˜ijx∗m+sW˜ijx∗Tux∏i=1jxiβm+λW˜˙ijx∗,≤−ηs+suxθ˜ijx∗m,≤−ηs+sθ˜ijx∗≤0.According to (41), the Lyapunov function V˙s,W˜ijx∗T≤0. The system is stable.Using the same method, we can get the adaptive Sigma-Pi neural network control law in theyandz direction.(42)W˜˙ijy∗=−uy∏i=1jxiβλym,W˜˙ijz∗=−uz∏i=1jxiβλzm.


## 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 Table1. 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.Table 1
Parameters of the quadrotor.
SymbolDescriptionValueMMass of quadrotor0.76 kgGAcceleration of gravity9.81 m/s2JInertia0.0056kx, ky, kzAerodynamic drag0.1DCoefficient arm length0.225 mKfThrust coefficient of rotor6.7 kg.m/s2Table 2
Parameters of the computer.
Computer nameThinkPad E480ProcessorCore i5-8250Basic frequency1.8GhzRAM8.00 GSSD512GMatlab version2018b


### 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 Table3. Simulation results are shown in Figures 6–8.Table 3
Parameters of desired trajectory.
SymbolDescriptionValuex1Desire trajectory (x1)t/sy1Desire trajectory (y1)3 ∗ sin(t/4 + pi/2)/mz1Desire trajectory (z1)3 + 3 ∗ sin(t/4)/mx1Init (x1)0/my1Init (y1)1/mz1Init (z1)0/mFigure 6
Tracking the reference trajectory with different hidden layers neural network.Figure 7
The tracking error with different hidden layers neural network.Figure 8
The attitude angle with different hidden layers neural network.As can be seen in Figure6, 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 Figure7. 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 Figure8, 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.Table 4
Parameters of “8-shaped” 3D spiral curve.
SymbolDescriptionValuex1Desire trajectory (x1)8 − 8cos (pi (t − 4)/6)/my1Desire trajectory (y1)4sin (pi (t − 4)/3)/mz1Desire trajectory (z1)−0.1 (1-exp (−0.3 t))/mx1Init (x1)8/my1Init (y1)3/mz1Init (z1)0/mFigure 9
The result of tracking desire trajectory in 3D.Figure 10
The resault of tracking desire trajectory in 2D.Figure 11
The curve of trajectory tracking error.Figure 12
The curve of attitude angle.Figures9 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.Figure11 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.Figure12 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 inx,y,andz 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.Table 5
Parameters of desire trajectory.
SymbolDescriptionValuex1Desire trajectory (x1)t/sy1Desire trajectory (y1)3 ∗ sin(t/4 + pi/2)/mz1Desire trajectory (z1)3 + 3 ∗ sin(t/4)/mx1Init (x1)0/my1Init (y1)3/mz1Init (z1)0/mWhite noise-xNoise power 0.01—/NWhite noise-yNoise power 0.5—/NWhite noise-zNoise power 0.01—/NAs shown in Table5, 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.Figure 13
The curve of external noise force.Figure 14
The trajectory tracking curve in 3D.Figure 15
The trajectory tracking curve in each direction.Figure 16
The curve of tracking error.Figure 17
The curve of attitude angle.As can be seen in Figures14 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.Figure16 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.Figure17 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.


## 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 Table3. Simulation results are shown in Figures 6–8.Table 3
Parameters of desired trajectory.
SymbolDescriptionValuex1Desire trajectory (x1)t/sy1Desire trajectory (y1)3 ∗ sin(t/4 + pi/2)/mz1Desire trajectory (z1)3 + 3 ∗ sin(t/4)/mx1Init (x1)0/my1Init (y1)1/mz1Init (z1)0/mFigure 6
Tracking the reference trajectory with different hidden layers neural network.Figure 7
The tracking error with different hidden layers neural network.Figure 8
The attitude angle with different hidden layers neural network.As can be seen in Figure6, 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 Figure7. 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 Figure8, 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.Table 4
Parameters of “8-shaped” 3D spiral curve.
SymbolDescriptionValuex1Desire trajectory (x1)8 − 8cos (pi (t − 4)/6)/my1Desire trajectory (y1)4sin (pi (t − 4)/3)/mz1Desire trajectory (z1)−0.1 (1-exp (−0.3 t))/mx1Init (x1)8/my1Init (y1)3/mz1Init (z1)0/mFigure 9
The result of tracking desire trajectory in 3D.Figure 10
The resault of tracking desire trajectory in 2D.Figure 11
The curve of trajectory tracking error.Figure 12
The curve of attitude angle.Figures9 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.Figure11 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.Figure12 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 inx,y,andz 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.Table 5
Parameters of desire trajectory.
SymbolDescriptionValuex1Desire trajectory (x1)t/sy1Desire trajectory (y1)3 ∗ sin(t/4 + pi/2)/mz1Desire trajectory (z1)3 + 3 ∗ sin(t/4)/mx1Init (x1)0/my1Init (y1)3/mz1Init (z1)0/mWhite noise-xNoise power 0.01—/NWhite noise-yNoise power 0.5—/NWhite noise-zNoise power 0.01—/NAs shown in Table5, 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.Figure 13
The curve of external noise force.Figure 14
The trajectory tracking curve in 3D.Figure 15
The trajectory tracking curve in each direction.Figure 16
The curve of tracking error.Figure 17
The curve of attitude angle.As can be seen in Figures14 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.Figure16 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.Figure17 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.



---

*Source: 1457532-2022-08-22.xml*