# A Robust Fixed-Time Sliding Mode Control for Quadrotor UAV
## 3 Robust Stabilization
### Desired Modes for the y-Axis Dynamics of the Vertical Displacement  
From Equation (5b), it follows that:  
\[\dot{y}=\tan\phi(g+r)\pm\tan\phi^{d}(g+r)+\Gamma_{y} \tag{7}\]  
where we have  
\[\dot{y}=\tan\phi^{d}(g+r)+e^{\prime}_{y}(g+r)+\Gamma_{y} \tag{8}\]  
and the nonlinear error is:  
\[e^{\prime}_{y}=\tan\phi-\tan\phi^{d} \tag{9}\]  
In addition, \(\tan\phi^{d}\) is considered as the desired virtual control input. The following variable is defined. \[\
u_{y}=\dot{y}+k_{y}(y-y_{d}) \tag{10}\]  
Differentiating, we obtain \(\
u_{y}\). \[\dot{\
u}_{y}=\dot{y}+k_{y}\dot{y} \tag{11}\]  
with \(k_{y}>0\) and after introducing Equation (8):  
\[\dot{\
u}_{y}=\dot{y}+k_{y}\dot{y}=(\tan\phi^{d}(g+r)+e^{\prime}(g+r))+k_{y} \dot{y}+\Gamma_{y} \tag{12}\]  
in order to obtain the following expression. \[\dot{\
u}_{y}=-\
u_{y}+e_{y} \tag{13}\]where the error \(e_{y}\) is:  
\[e_{y}=e_{y}^{\prime}(g+r) \tag{14}\]  
We proposed the desired virtual control input \(\tan\phi^{d}\) such that:  
\[(g+r)\tan\phi^{d}+e_{y}^{\prime}(g+r)+k_{y}\dot{y}=-v_{y}+e_{y}^{\prime}(g+r)+ \Gamma_{y} \tag{15}\]  
getting \(\tan\phi^{d}\). \[(g+r)\tan\phi^{d}=-v_{y}-k_{y}\dot{y} \tag{16}\]  
From Equations (9), (14) and (16), it follows that:  
\[\dot{y}=\tan\phi^{d}(g+r)+e^{\prime}_{y}(g+r)+\Gamma_{y} \tag{8}\]0  
Differentiating the above:  
\[\dot{y}=\tan\phi^{d}(g+r)+e^{\prime}_{y}(g+r)+\Gamma_{y} \tag{8}\]1  
Differentiating again and introducing Equation (5b), it follows that:  
\[\dot{y}=\tan\phi^{d}(g+r)+e^{\prime}_{y}(g+r)+\Gamma_{y} \tag{8}\]2  
It is important to mention that \(\Gamma_{y}\) is the double derivative of the perturbation in the translational movement of \(y\) and \(\Gamma_{\phi}\) is the perturbation in the rotational movement of \(\phi\). Notice that the second- and third-order derivatives of \(r,x\) and \(v_{x}\) which appear above can be computed as a function of their first-order derivatives as follows. From Equations (3) and (5c):  
\[ \begin{split} r&=-k_{z}\dot{z}-k_{z}(z-z_{d})\\ \dot{r}&=-k_{z}r-k_{z}\dot{z}\\ \ddot{r}&=-k_{z}\dot{r}-k_{z}\dot{r}\end{split}  \tag{20}\]  
where \(z_{d}>0\) is a constant, from Equation (5b):  
\[ \begin{split}\dot{y}=\tan\phi(g+r)+\Gamma_{y}\\ y^{(3)}&=\frac{\dot{\phi}}{\cos^{2}\phi}(g+r)+ \tan\phi\dot{r}+\dot{\Gamma}_{y}\end{split}  \tag{21}\]  
and from Equation (10) is substituted. \[ \begin{split} v_{y}&=\dot{y}+k_{y}(y-y_{d})\\ \dot{v}_{y}&=\dot{y}+k_{y}\dot{y}\\ \ddot{v}_{y}&=y^{(3)}+k_{y}\dot{y}\end{split}  \tag{22}\]  
In view of Equation (19), a sliding surface \(s_{ey}\) is proposed:  
\[s_{ey}\triangleq e_{y}+\beta_{y}e_{y} \tag{23}\]  
Then, we propose a Lyapunov function at Equation (23):  
\[V=\frac{1}{2}s_{ey}^{2} \tag{24}\]Differentiating the above, we have  
\[\dot{V}=s_{xy}=s_{ey}(\bar{e}_{y}+\beta_{y}e_{y}),\ \ \beta_{y}>0 \tag{25}\]  
The following robust sliding mode controller is now proposed. \[\bar{e}_{y}+\beta_{y}\dot{e}_{y}=-k_{1y}\operatorname{sgn}(s_{ey})-k_{2y}|s_{ey }|^{s_{y}}\operatorname{sgn}(s_{ey})-k_{3y}|s_{ey}|^{\gamma_{y}}\operatorname {sgn}(s_{ey})-k_{4y}y \tag{26}\]  
Then, it leads to:  
\[\dot{V} =-2k_{1y}|s_{ey}|-2k_{2y}|s_{ey}|^{s_{y}+1}-2k_{3y}|s_{ey}|^{\gamma _{y}+1}-2k_{4y}y^{2}\] \[\leq-2\big{(}k_{1y}-\delta_{y}\big{)}|s_{ey}|-2k_{2y}|s_{ey}|^{s_{ y}+1} \tag{27}\] \[\leq-2\big{(}k_{1y}-\delta_{y}\big{)}V(s_{ey})^{\frac{1}{2}}-2k_{ 2y}V(s_{ey})^{\frac{s_{y}+1}{2}}\]  
The corresponding gains of this axis are the same as in the following section. Let us now obtain \(\tau_{\phi}\) and add a sliding mode controller.