# Robust Backstepping Control Applied to UAVs for Pest Recognition in Maize Crops
## 4 Control Strategy Applied to the Quadrotor
### Controller for Subsystem \(x-\theta\)  
Dynamics related with translational motion along \(x\)-axis and the pitch angle \(\theta\) around the \(y\)-axis are described by  
\[ \begin{array}{l}\ddot{x}=-\frac{1}{m}\sin\theta u_{s}\\ \ddot{\theta}=\dot{\phi}\dot{\psi}\frac{u_{x}-L_{x}}{l_{y}}+\frac{l}{l_{y}} \tau_{\theta}+\delta(\vartheta,t),\end{array}  \tag{19}\]  
where \(c_{3}=\frac{L_{x}-L_{x}}{l_{y}}\), \(u_{s}\
eq 0\), and \(c_{4}=\frac{l}{l_{y}}\). Let \(x_{5}=x\), \(x_{6}=\dot{x}\), \(x_{7}=\theta\) and \(x_{8}=\dot{\theta}\). Then, the state space representation is given by  
\[ \begin{array}{l}\dot{x_{5}}=x_{6}\\ \dot{x_{6}}=-\frac{1}{m}\sin x_{7}u_{s}\\ \dot{x_{7}}=x_{8}\\ \dot{x_{8}}=\dot{\phi}\dot{\psi}c_{3}+c_{4}\tau_{\theta}+\delta(\vartheta,t). \end{array}  \tag{20}\]  
Considering the first and second equations of the state space representation (20) and defining the virtual input as follows:  
\[u_{1x}=\sin x_{7}=-\frac{m}{u_{s}}u_{x}, \tag{21}\]  
then, according to the backstepping methodology [26]\(x_{6}=\mu(x_{5})=-\alpha_{5}x_{5}\), for \(\alpha_{5}>0\). Notice that the selected virtual input \(\sin(x_{7})\) produces bounded control signals and it is appropriate to the physical constrains of the UAV: \(x_{7}\in[\frac{-\pi}{4},\frac{\pi}{4}]\). These equations can be rewritten as follows:  
\[ \begin{array}{l}x_{5}=-\alpha_{5}x_{5}\\ x_{6}=u_{x},\end{array} \]  
where \(u_{x}=-(1+\alpha_{5}k_{5})x_{5}-(\alpha_{5}+k_{5})x_{6}\) is the control input, computed with the Lyapunov function \(V_{1}(x_{5})=\frac{1}{2}x_{5}\). Replacing \(u_{x}\) into Equation (21), it yields to  
\[u_{1x}=\frac{m}{u_{s}}(d_{1}x_{5}+d_{2}x_{6}), \tag{22}\]  
where \(d_{1}=1+\alpha_{5}k_{5}\) and \(d_{2}=\alpha_{5}+k_{5}\). Next, the iterative methodology of backstepping is applied; taking the first three equations of the state space representation (20), the subsystem is rewritten as  
\[ \begin{array}{l}\begin{bmatrix}\dot{x}_{5}\\ \dot{x}_{6}\end{bmatrix}=\begin{bmatrix}x_{6}\\ 0\end{bmatrix}+\begin{bmatrix}0\\ -\frac{u_{s}}{m}\end{bmatrix}\sin x_{7}\\ \dot{\tau}=x_{8}=u_{2x},\end{array}  \tag{23}\]  
In this case, \(\vartheta=(x_{5},x_{6})^{T}\), and \(\zeta=x_{7}\). The modified backstepping structure, proposed by [11], is applied for system (23) considering the Lyapunov function  
\[V_{2}=V_{2}(x_{5},x_{6})=\frac{1}{2}x_{5}^{2}+\frac{\beta_{1}}{2}(x_{6}+\alpha _{5}x_{5})^{2}.\]  
The virtual input \(\mu_{1}=\mu_{1}(x_{5},x_{6})=\frac{m}{u_{s}}(d_{1}x_{5}+d_{2}x_{6})\) is defined as \(u_{1x}\), given in Equation (2  
where  
\[\frac{\partial(\mu_{1}(x_{5},x_{6}))}{\partial x_{5}} = \frac{\cos x_{7}\cos x_{11}d_{1}}{p},\] \[\frac{\partial(\mu_{1}(x_{5},x_{6}))}{\partial x_{6}} = \frac{\cos x_{7}\cos x_{11}d_{2}}{p},\] \[\frac{\partial(V_{2}(x_{5},x_{6}))}{\partial x_{6}} = \beta_{1}\alpha_{5}x_{5}+\beta_{1}x_{6},\]  
So, the virtual input \(u_{2x}\) is  
\[u_{2x} = \left(\frac{k_{6}d_{1}\cos x_{11}}{p}+\frac{\beta_{1}\alpha_{5}p}{ \cos^{2}x_{7}\cos x_{11}}\right)x_{5}\] \[+ \left(\frac{d_{1}\cos x_{11}+k_{6}d_{2}\cos x_{11}}{p}+\frac{ \beta_{1}p}{\cos^{2}x_{7}\cos x_{11}}\right)x_{6}-(d_{2}+k_{6})\tan x_{7}\]  
Finally, the whole state space representation (20) is considered with \(\vartheta=(x_{5},x_{6},x_{7})^{T}\), \(\zeta=x_{8}\), and for  
\[\tau_{\theta}=\frac{1}{c_{4}}[-\dot{\vartheta}\dot{\psi}c_{3}+\tau_{\theta a}], \tag{26}\]  
this subsystem can be rewritten as  
\[ \begin{bmatrix}\dot{x}_{5}\\ \dot{x}_{6}\\ \dot{x}_{7}\end{bmatrix} = \begin{bmatrix}x_{6}\\ -\frac{p\sin x_{7}}{\cos x_{7}\cos x_{11}}\\ 0\end{bmatrix} + \begin{bmatrix}0\\ 0\\ 1\end{bmatrix}