# Nonsingular Terminal Sliding Mode Based Finite-Time Dynamic Surface Control for a Quadrotor UAV
## 3 Finite-Time ESO and DSC-Based Control Algorithm Design
### NTSMC and DSC-Based Finite-Time Attitude Controller Design  
Considering the system in (50), a controller based on the NTSMC and DSC techniques was designed.  
**Step1:** Define the following auxiliary variables  
\[e_{i1i}=y_{1i}-y_{1 di},e_{2i}=y_{2i}-\alpha_{fi} \tag{59}\]  
where \(y_{1 di}(i=1,2,3)\) denotes the desired attitude and \(\alpha_{fi}\) is the output of the finite-time filter. Construct the following virtual control law  
\[\alpha_{i}=\dot{y}_{1 di}-l_{2i}|e_{i1i}|^{c_{2i}}\text{sign}(e_{i1i}) \tag{60}\]  
with \(l_{2i}>0,0<c_{2i}<1(i=1,2,3)\).  
To solve the problem of the \"explosion of complexity\" in the traditional backstepping design, the finite-time filter is introduced  
\[\begin{cases}\dot{\alpha}_{fi}=\varphi_{2i}-\lambda_{3i}|\alpha_{fi}-\alpha_{i }|^{p_{3i}}\text{sign}(\alpha_{fi}-\alpha_{i})\\ \dot{\varphi}_{2i}=-\lambda_{4i}|\alpha_{fi}-\alpha_{i}|^{p_{4i}}\text{sign}( \alpha_{fi}-\alpha_{i})\end{cases} \tag{61}\]  
with \(0<p_{3i}<1\), \(p_{4i}=2p_{3i}-1\), \(\lambda_{3i}>0\), \(\lambda_{4i}>0(i=1,2,3)\). As shown in [44], \(\alpha_{fi}\) will converge to \(\alpha_{i}\) in finite time, namely \(|\alpha_{fi}-\alpha_{i}|=0\) after finite time.  
Consider the Lyapunov function \(V_{4i}=0.5e_{1i}^{2}\) with \(i=1,2,3\). The proof is similar to (33), and one can obtain  
\[\dot{V}_{4i}\leq-l_{2i}|e_{i1i}|^{c_{2i}+1}+e_{1i}e_{i2i} \tag{62}\]  
**Step2:** Design the nonsingular terminal sliding mode variable as  
\[s_{2i}= e_{i2i}+2\zeta\sqrt{\rho+|\text{arctan}(e_{i1i})|}(1+e_{i1i}^{2}) \text{sign}(e_{1i}) \tag{63}\]  
with \(i=1,2,3\). According to Remark 2, the finite-time stability of the nonsingular terminal sliding mode variable \(s_{2i}\) is guaranteed.  
The attitude controller is designed as  
\[u_{i}=-\frac{1}{f_{3i}\xi_{2}}[-f_{3i}k_{j}\xi_{1}y_{2i}+\hat{Z}_{4i}-\dot{ \alpha}_{fi}+f_{2i}^{\prime}+e_{2i}|s_{2i}|^{c_{2i}}\text{sign}(s_{2i})+e_{i1i }+\hat{a}_{2i}\text{sign}(s_{2i})] \tag{64}\]  
with \(\epsilon_{2i}>0\) and \(i=1,2,3\). \(\hat{a}_{2i}\) is the estimation of \(a_{2i}\), \(a_{2i}\) is the upper bound of the estimation error \(\hat{Z}_{4i}\), \(\hat{a}_{2i}\) is developed as  
\[\dot{\hat{a}}_{2i}=m_{2i}|s_{2i}|-n_{2i}\hat{a}_{2i} \tag{65}\]  
with \(\hat{a}_{2i}(0)\geq 0\), \(m_{2i}>0\) and \(n_{2i}>0\). According to Lemma 2 in [45], one can get \(0<\hat{a}_{2i}<\hat{a}_{2i}\), where \(\hat{a}_{2i}\) is positive scalar. \(f_{2i}^{\prime}\) can be expressed as  
\[f_{2i}^{\prime}=\begin{cases}\frac{\zeta\dot{\epsilon}_{4i}(1+4\epsilon_{4i}( \text{arctan}(\epsilon_{4i})-\rho))}{\sqrt{\rho-\text{arctan}(\epsilon_{4i}) }},\text{ if }e_{i1i}<0\\ 0,\text{ if }e_{i1i}=0\\ \frac{\zeta\dot{\epsilon}_{4i}(1+4\epsilon_{4i}(\text{arctan}(\epsilon_{4i}) +\rho))}{\sqrt{\rho+\text{arctan}(\epsilon_{4i})}},\text{ if }e_{i1i}>0\end{cases} \tag{66}\]  
**Theorem 4**.: _Consider the attitude subsystem presented in (50). If the NTSMC-based finite-time dynamic surface controllers is designed as (64), then the states of the system can be practically finite-time stabilized._Proof.: Choose a Lyapunov function  
\[V_{5i}=V_{4i}+\frac{1}{2}s_{2i}^{T}s_{2i}+\frac{1}{2m_{2i}}(\hat{a}_{2i}-a_{2i})^ {2} \tag{67}\]  
with \(i=1,2,3\). The proof process of Theorem 4 is similar to Theorem 2, and the attitude tracking control system will also converge into a small residual region after finite time. In order to save space, the certification step is omitted.  
**Remark 4**.: _The second Lyapunov method is used to judge the stability of the system. That is, a positive definite scalar function \(V(x)\) is defined as an imaginary generalized energy function, and then the stability of the system is judged according to the symbolic characteristics of \(\dot{V}(x)\). According to Lemmas 1-3, the finite-time stability of the system is proved in this paper._