# Trajectory Tracking Outer Loop Regressor-Based Adaptive Controller for a Quadrotor
## 3 Main Result  
### Outer Loop Design  
The outer loop controller derivation is carried out for the system described in (6). The given outer loop scheme computes the required commands for the inner loop controller in order to achieve the objective (12). Figure 1: Block diagram of a quadrotor with inner loop controller, which leads to system (6). Defining the variable  
\[\mathbf{s}=\Gamma\mathbf{e}+\dot{\mathbf{e}}, \tag{13}\]  
where \(\Gamma\in\mathbb{R}^{4\times 4}\) is a positive definite diagonal matrix, the dynamics of the variable \(\mathbf{s}\in\mathbb{R}^{4}\) are given by  
\[\dot{\mathbf{s}}=\Gamma\dot{\mathbf{e}}+\ddot{\mathbf{q}}_{d}+K_{v}(\dot{\mathbf{q}}_{d}-\dot{ \mathbf{e}})-T(\psi)K_{u}\mathbf{u}-\delta(t). \tag{14}\]  
Assuming \(\theta_{\max}=\phi_{\max}\) from (8), it holds that [25]  
\[T(\psi)K_{u}=K_{u}T(\psi),\]  
allowing one to multiply (14) by \(K_{u}^{-1}\), obtaining  
\[\Lambda_{1}\dot{\mathbf{s}}=\Lambda_{1}\mathbf{f}_{1}(\ddot{\mathbf{q}}_{d},\dot{\mathbf{e}})+ \Lambda_{2}\dot{\mathbf{q}}-T(\psi)\mathbf{u}-\Lambda_{1}\delta(t), \tag{15}\]  
being \(\Lambda_{1}=K_{u}^{-1}\), \(\Lambda_{2}=K_{u}^{-1}K_{v}\), and \(\mathbf{f}_{1}(\ddot{\mathbf{q}}_{d},\dot{\mathbf{e}})=\Gamma\mathbf{e}+\ddot{\mathbf{q}}_{d}\). Equation (15) is linearly parameterizable as follows:  
\[\Lambda_{1}\dot{\mathbf{s}}=\Phi(\ddot{\mathbf{q}}_{d},\dot{\mathbf{q}}_{d},\dot{\mathbf{e}}) \mathbf{\Theta}-T(\psi)\mathbf{u}-\Lambda_{1}\delta(t), \tag{16}\]  
where  
\[\mathbf{\Theta}=\left[\frac{1}{g\theta_{\max}}\;\frac{1}{g\phi_{\max}}\;\frac{ \tau_{z}}{z_{\max}}\;\frac{\tau_{\psi}}{\psi_{\max}}\frac{d_{x}}{g\theta_{\max }}\;\frac{d_{y}}{g\phi_{\max}}\;\frac{d_{z}\tau_{z}+1}{\dot{z}_{\max}}\;\frac{ d_{y}\tau_{\psi}+1}{\dot{\psi}_{\max}}\right]^{\top}\in\mathbb{R}^{8}\]  
is the vector containing the system parameters which is bounded as \(\|\mathbf{\Theta}\|\leq\Theta_{B}\in\mathbb{R}\) with \(\Theta_{B}>0\), and  
\[\Phi(\ddot{\mathbf{q}}_{d},\dot{\mathbf{q}}_{d},\dot{\mathbf{e}})= \begin{bmatrix}\[PERSON]_{11} &0&0&0&\[PERSON]_{15}&0&0&0\\ 0&\[PERSON]_{22}&0&0&0&\[PERSON]_{26}&0&0\\ 0&0&\Phi_{33}&0&0&0&\Phi_{37}&0\\ 0&0&0&\Phi_{44}&0&0&0&\Phi_{48}\end{bmatrix} \in\mathbb{R}^{4\times 8},\]  
where  
\[ \begin{array}{llllll}\Phi_{11}=\Gamma_{11}\dot{e}_{x}+\dot{x}_{d},&\Phi_{33} =\Gamma_{33}\dot{e}_{z}+\dot{x}_{d},&\Phi_{15}=\dot{x},&\Phi_{37}=\dot{z},\\ \Phi_{22}=\Gamma_{22}\dot{e}_{y}+\dot{y}_{d},&\Phi_{44}=\Gamma_{44}\dot{e}_{ \psi}+\ddot{\Psi}_{d},&\Phi_{26}=\dot{y},&\Phi_{48}=\dot{\psi},\end{array} \]  
is the regression matrix. In order to stabilize systems (13) and (16), the following regressor-based adaptive controller is proposed:  
\[\mathbf{u} =T(\psi)^{-1}\big{[}K_{s}\mathbf{s}+K_{i}\mathbf{\xi}+\Phi(\ddot{\mathbf{q}}_{ d},\dot{\mathbf{q}}_{d},\dot{\mathbf{e}})\mathbf{\hat{\Theta}}\big{]}, \tag{17}\] \[\mathbf{\dot{\xi}} =\mathbf{s}, \tag{18}\]  
where \(K_{s}\) and \(K_{i}\in\mathbb{R}^{4\times 4}\) are positive definite diagonal matrices and \(\mathbf{\hat{\Theta}}\in\mathbb{R}^{8}\) is the estimation of the parameter vector \(\mathbf{\Theta}\in\mathbb{R}^{8}\), which is obtained through the following update law:  
\[\dot{\mathbf{\hat{\Theta}}}=N\Phi(\ddot{\mathbf{q}}_{d},\dot{\mathbf{q}}_{d},\dot{\mathbf{e}}) ^{\top}\mathbf{s}, \tag{19}\]  
where \(N\in\mathbb{R}^{8\times 8}\) is a positive definite diagonal matrix containing the adaptation gains. The dynamics of \(\mathbf{s}\) in (16) in a closed-loop with the proposed controller (17)-(19) is given by  
\[\Lambda_{1}\dot{\mathbf{s}}=-K_{s}\mathbf{s}-K_{i}\mathbf{\xi}-\Lambda_{1}\delta+\Phi(\ddot {\mathbf{q}}_{d},\dot{\mathbf{q}}_{d},\dot{\mathbf{e}})\mathbf{\tilde{\Theta}}, \tag{20}\]  
where  
\[\mathbf{\tilde{\Theta}}(t)=\mathbf{\Theta}-\mathbf{\hat{\Theta}}(t)\in\mathbb{R}^{8}\]  
is the parameter estimation error.