# Quadcopter Adaptive Trajectory Tracking Control:
## 3 Trajectory Tracking Control: Adaptive Backstepping Design and Stability Analysis
### Horizontal Position Controller
This is the proposition to present an adaptive law which can address the aforementioned unknown parameter problem._  
The fourth Lyapunov candidate function with positive definite matrices \(\mathbf{Q}_{1}=\mathbf{Q}_{1}^{T}\) and \(\mathbf{Q}_{2}=\mathbf{Q}_{2}^{T}\in\mathbb{R}^{4\times 4}\) is shown in (38), while \(\hat{\mathbf{f}}\) and \(\hat{\mathbf{E}}\) are the estimated values of \(\Gamma\) and \(\mathbf{E}\), respectively:  
\[V_{4}= V_{3}+\frac{1}{2}\left(\dot{q}-r_{3}\right)^{T}\mathbf{E}\left( \dot{q}-r_{3}\right)+\frac{1}{2}\left(\Gamma-\hat{\Gamma}\right)^{T}\mathbf{Q} _{1}^{-1}\left(\Gamma-\hat{\Gamma}\right)+\frac{1}{2}\text{vec}\left(\mathbf{ E}-\hat{\mathbf{E}}\right)^{T}\mathbf{Q}_{2}^{-1}\text{vec}\left(\mathbf{E}- \hat{\mathbf{E}}\right) \tag{38}\] \[\dot{V}_{4}= -\zeta^{T}\mathbf{K}_{1}\xi-\left(V-r_{1}\right)^{T}\mathbf{K}_ {2}\left(V-r_{1}\right)-\left(\dot{q}-r_{2}\right)^{T}\mathbf{K}_{3}\left( \dot{q}-r_{2}\right)\] \[+\left(\dot{q}-r_{3}\right)^{T}\left(\mathbf{E}\ddot{q}-\mathbf{E }\dot{r}_{3}+\mathbf{B}(\dot{\phi},\dot{\theta})^{T}\left(\dot{\theta}-r_{2} \right)\right)-\left(\Gamma-\hat{\Gamma}\right)^{T}\mathbf{Q}_{1}^{-1}\hat{ \Gamma}-\text{vec}\left(\mathbf{E}-\hat{\mathbf{E}}\right)^{T}\mathbf{Q}_{2}^{- 1}\text{vec}\left(\dot{\hat{\mathbf{E}}}\right) \tag{39}\]  
The proposed intermediate control law (40) with positive definite matrix \(\mathbf{K}_{4}\in\mathbb{R}^{2\times 2}\) and the proposed adaptive laws (41) and (42) can be selected as:  
\[U= -\mathbf{B}(\dot{\phi},\theta)^{T}\left(\dot{\theta}-r_{2}\right) -\mathbf{K}_{4}\left(\dot{q}-r_{3}\right)-\mathbf{C}_{1}\left(\dot{\phi},\dot{ \theta},\dot{\psi}\right)\hat{\Gamma}+\hat{\mathbf{E}}\dot{r}_{3} \tag{40}\] \[\dot{\Gamma}= -\mathbf{Q}_{1}\mathbf{C}_{1}\left(\dot{\phi},\dot{\theta},\dot{ \psi}\right)^{T}\left(r_{3}-q\right)\] (41) \[\text{vec}\left(\dot{\hat{E}}\right)= -\mathbf{Q}_{2}\left(\dot{r}_{3}\otimes\left(\dot{q}-r_{3}\right)\right) \tag{42}\]  
**Theorem 1**. : _In order to achieve horizontal asymptotic tracking stability, there exist positive control parameters \(\mathbf{K}_{1}\), \(\mathbf{K}_{2}\), \(\mathbf{K}_{3}\), \(\mathbf{K}_{4}\), \(\mathbf{Q}_{1}\), and \(\mathbf{Q}_{2}\) such that the proposed control law (40) and adaptive laws (41), (42) can be applied to the system models (8) and (9) under Assumptions 1 and 3._Proof of Theorem 1.: By selecting appropriate positive constant matrices \(\mathbf{K}_{1}\), \(\mathbf{K}_{2}\), \(\mathbf{K}_{3}\), \(\mathbf{K}_{4}\), \(\mathbf{Q}_{1}\), and \(\mathbf{Q}_{2}\), the time-derivative of the fourth Lyapunov candidate function (39) becomes:  
\[\dot{V}_{4}= -\xi^{T}\mathbf{K}_{1}\xi-\left(V-r_{1}\right)^{T}\mathbf{K}_{2} \left(V-r_{1}\right)-\left(\vartheta-r_{2}\right)^{T}\mathbf{K}_{3}\left( \vartheta-r_{2}\right)-\left(\vartheta-r_{3}\right)^{T}\mathbf{K}_{4}\left( \vartheta-r_{3}\right) \tag{43}\] \[+\left(\Gamma-\Gamma\right)^{T}\mathbf{Q}^{-1}\left[\mathbf{QC}_ {1}\left(\phi,\dot{\theta}\right)^{T}\left(\vartheta-r_{3}\right)-\dot{ \Gamma}\right]-\mathrm{vec}\left(\mathbf{E}-\mathbf{\bar{E}}\right)^{T} \mathbf{Q}_{2}^{-1}\left[\mathrm{vec}\left(\dot{\mathbf{E}}\right)+\mathbf{Q }_{2}\left(r_{3}\otimes\left(\vartheta-r_{3}\right)\right)\right]\] \[b_{i-min}\leq b_{i}\leq b_{i-max} \tag{37}\]0  
It is clear that the fourth Lyapunov candidate function (38) \(V_{4}\in\kappa_{\infty}\) is a continuously differentiable and the time-derivative \(V_{4}\) (44) is negative semi-definite. Let \(M\) be the largest invariant set at all points \(\dot{V}_{4}=0\). Then, every solution from arbitrary initial states will approach \(M\) as \(t\rightarrow\infty\) (Theorem 4.4 in [44]), which ensures that the entire system is asymptotically stable. Whereas, the errors between the estimated unknown parameters \(\hat{\Gamma}\) and \(\mathrm{vec}\left(\dot{\mathbf{E}}\right)\) and their real values, i.e., \(\Gamma\) and \(\mathrm{vec}\left(\dot{\mathbf{E}}\right)\), are bounded and tend to constant values.