# Adaptive Backstepping Control of Quadrotor UAVs with Output Constraints and Input Saturation
## 3 Adaptive Backstepping Controller Design  
In this section, a BLF-based ANNBC with DSC, adaptive neural network and anti-saturation strategy is designed for the UAV control system with internal uncertainties, external disturbances and input-output constraints. A stability proof is given.  
Due to the presence of four inputs and six outputs for UAVs, it is difficult to perform a unified controller design directly. In addition, there is a strong coupling relationship between each control output of the UAV. As shown in Figure 2, a tandem control scheme is used to design the UAV controller. The controller adopts double closed-loop control. The outer loop is the position controller, and the inner loop is the attitude controller. The desired trajectory is \((x_{d},y_{d},z_{d})\) and \(\psi_{d}\), and the desired attitude angles \([\phi_{d},\theta_{d}]\) are computed by the position controller. The attitude tracking is achieved through the inner loop. RBFneural networks are used to compensate system uncertainties and they are trained online according to tracking errors \(\big{(}e_{x},e_{y},e_{z},e_{\phi},e_{\theta},e_{\psi}\big{)}\). \(\Big{(}\hat{f}_{x},\hat{f}_{y},\hat{f}_{z},\hat{f}_{\phi},\hat{f}_{\theta},\hat{f }_{\psi}\Big{)}\) represent the outputs of the RBF neural networks.  
It can be seen from Figure 2 that \((\phi_{d},\theta_{d})\) are unknown. Two intermediate variables \(u_{x},u_{y}\) are introduced to calculate \((\phi_{d},\theta_{d})\). The intermediate variables \(u_{x},u_{y}\) are defined as  
\[\begin{cases}u_{x}=\text{sin}\psi\text{sin}\phi+\text{cos}\psi\text{sin}\theta \text{cos}\phi\\ u_{y}=\text{sin}\psi\text{sin}\theta\text{cos}\phi-\text{cos}\psi\text{sin}\phi \end{cases} \tag{9}\]  
According to Equation (9), we can obtain  
\[\begin{cases}\phi_{d}=\arcsin\big{(}u_{x}\text{sin}\psi-u_{y}\text{cos}\psi \big{)}\\ \theta_{d}=\arcsin\frac{u_{x}\text{cos}\psi+u_{y}\text{sin}\psi}{\cos\phi_{d}} \end{cases} \tag{10}\]  
where \(u_{x}\) and \(u_{y}\) are the control law of \(x\) and \(y\) channels, respectively. \(\psi\) is the actual yaw angle of the UAV, which can be obtained by sensors.  
**Remark 1**.: _For constrained nonlinear systems, input saturation is approximated by using a smoothing function in [31,32]. The method will make the tracking error affected by the amplitude of the reference signal. Take a simple system \(dx=(Px+u(v))dt\), for example, assuming that \(P=2\), \(u_{M}=2,u_{m}=-2\), \(|x(0)|\leq 2\), \(y=x\), we can obtain \(|y(t)|\leq e^{-t}|x(0)|+\big{(}1-e^{-t}\big{)}u_{M}\leq 4\) by integration. At this time, if the amplitude of the smoothing function \(y_{r}(t)=8\), then \(|y(t)-y_{r}(t)|\geq 4\). It means that when the amplitude of the reference signal is larger, the tracking error will become larger. It has an impact on the tracking performance of the system._  
This paper applies a new anti-saturation strategy to the quadrotor UAV to solve the input saturation problem. Each channel of the UAV dynamics model is a second-order nonlinear system, so consider the following anti-saturation auxiliary system  
\[\begin{cases}d\lambda_{i1}=(\lambda_{i2}-p_{i1}\lambda_{i1})dt\\ d\lambda_{i2}=(\Delta u-p_{i2}\lambda_{i2})dt\end{cases} \tag{11}\]  
where \(\lambda_{i1},\lambda_{i2}\) is the design variable of the auxiliary system and \(\lambda_{i1}(0)=0,\lambda_{i2}(0)=0\). \(p_{i1}\) and \(p_{i2}\) are positive constants to be designed. \(\Delta u\) is the input saturation error defined as \(\Delta u=u(v)-v\).  
Figure 2: UAV tandem control scheme.