# Control of an Omnidirectional UAV for Transportation and Manipulation Tasks
## 5 Stability Analysis  
By folding the control inputs (18), (28), and (29) into the ODQuad dynamics (14)-(16), the following set of equations can be written  
\[M_{pp}(\dot{p}_{0}-\gamma_{p})+M_{pb}(\ddot{\varphi}_{0}-\gamma_{ \phi})+M_{pb}\ddot{\delta}=\mathbf{0}_{3} \tag{32}\] \[M_{pp}^{\mathrm{T}}(\dot{p}_{0}-\gamma_{p})+M_{\phi\phi}(\ddot{ \varphi}_{0}-\gamma_{\phi})+M_{\phi\delta}(\ddot{\delta}-\gamma_{\delta})= \mathbf{0}_{3}\] (33) \[M_{ps}^{\mathrm{T}}(\ddot{p}_{0}-\gamma_{p})+M_{\phi\phi}^{ \mathrm{T}}(\ddot{\varphi}_{0}-\gamma_{\phi})+M_{\delta\delta}(\ddot{\delta}- \gamma_{\delta})=\mathbf{0}_{2}, \tag{34}\]  
where \(\mathbf{0}_{2}\) is the \((2\times 1)\) vector of zeros. By adding and subtracting \(M_{pb}\gamma_{\delta}\), (32) can be rearranged in the form  
\[M_{pp}(\ddot{p}_{0}-\gamma_{p})+M_{pb}(\ddot{\varphi}_{0}-\gamma_{\phi})+M_{ pb}(\ddot{\delta}-\gamma_{\delta})+M_{pb}\gamma_{\delta}=\mathbf{0}_{3}. \tag{35}\]  
By defining the vector \(\gamma\) and the block matrix \(\widetilde{M}\) as  
\[\gamma= \begin{bmatrix}\gamma_{p}\\ \gamma_{\phi}\\ \gamma_{\delta}\end{bmatrix} \in\mathbb{R}^{8},\qquad\widetilde{M}= \begin{bmatrix} \begin{array}{ccc}\mathbf{O}_{3}&\mathbf{O}_{3}&\mathbf{M}_{pb}\\ \mathbf{O}_{3}&\mathbf{O}_{3}&\mathbf{O}_{3\times 2}\\ \mathbf{O}_{2\times 3}&\mathbf{O}_{2\times 3}&\mathbf{O}_{2}\end{array} \end{bmatrix} \in\mathbb{R}^{8\times 8},\]  
where \(\mathbf{O}_{2}\) and \(\mathbf{O}_{2\times 3}\) are, respectively, the \((2\times 2)\) and \((2\times 3)\) null matrices, Equations (33)-(35) can be rewritten in the following compact form:  
\[M(\ddot{q}-\gamma)+\widetilde{M}\gamma=\mathbf{0}_{8}, \tag{36}\]  
where \(\mathbf{0}_{8}\) is the \((8\times 1)\) vector of zeros. By exploiting Equations (19), (20) and (27), the following error dynamics is obtained:  
\[\ddot{\boldsymbol{e}}+\boldsymbol{K}_{D}\dot{\boldsymbol{e}}+\boldsymbol{K}_{ P}\boldsymbol{e}+\boldsymbol{K}_{I}\int\boldsymbol{e}+\boldsymbol{M}^{-1} \widetilde{M}\gamma=\mathbf{0}_{8}, \tag{37}\]  
where \(\boldsymbol{e}=\boldsymbol{q}_{d}-\boldsymbol{q}\), with \(\boldsymbol{q}_{d}=[\boldsymbol{p}_{0,d}^{\mathrm{T}},\ \boldsymbol{\phi}_{0,d}^{\mathrm{T}},\ \delta_{d}^{\mathrm{T}}]^{ \mathrm{T}}\), and the matrices \(\boldsymbol{K}_{\star}\) (\(\star=\{I,P,D\}\)) are  
\[\boldsymbol{K}_{\star}=\mathrm{blkdiag}\big{\{}\boldsymbol{K}_{\star,p}, \boldsymbol{K}_{\star,\phi},\boldsymbol{K}_{\star,\phi}\big{\}}.\]  
Define the state vector \(\boldsymbol{z}= \begin{bmatrix}\boldsymbol{z}_{1}^{\mathrm{T}},\ \boldsymbol{z}_{2}^{\mathrm{T}},\ \boldsymbol{z}_{3}^{\mathrm{T}} \end{bmatrix} ^{\mathrm{T}}= \begin{bmatrix}\int\boldsymbol{e}^{\mathrm{T}},\ \boldsymbol{e}^{\mathrm{T}},\ \dot{ \boldsymbol{e}}^{\mathrm{T}}\end{bmatrix} ^{\mathrm{T}}\) and rewrite (37) in the state space form as  
\[ \begin{array}{rcl}\dot{\boldsymbol{z}}_{1}&=&\boldsymbol{z}_{2}\\ \dot{\boldsymbol{z}}_{2}&=&\boldsymbol{z}_{3}\\ \dot{\boldsymbol{z}}_{3}&=&-(\boldsymbol{K}_{D}\boldsymbol{z}_{3}+\boldsymbol {K}_{P}\boldsymbol{z}_{2}+\boldsymbol{K}_{I}\boldsymbol{z}_{1})-\boldsymbol{M }^{-1}\widetilde{M}\gamma,\end{array}  \tag{38}\]  
which can be rewritten as  
\[\dot{\boldsymbol{z}}= \begin{bmatrix}\begin{array}{ccc}\mathbf{O}_{8}& \boldsymbol{I}_{8}&\mathbf{O}_{8}\\ \mathbf{O}_{8}&\mathbf{O}_{8}&\boldsymbol{I}_{8}\\ -\boldsymbol{K}_{I}&-\boldsymbol{K}_{P}&-\boldsymbol{K}_{D}\end{array}\end{bmatrix}  \boldsymbol{z}+ \begin{bmatrix}\mathbf{0}_{8}\\ \mathbf{0}_{8}\\ -\boldsymbol{M}^{-1}\widetilde{M}\gamma\end{array}\end{bmatrix} =\boldsymbol{K }\boldsymbol{z}+\widetilde{\boldsymbol{\gamma}}, \tag{39}\]  
where \(\boldsymbol{I}_{8}\) and \(\mathbf{O}_{8}\) are the \((8\times 8)\) identity and null matrices, respectively. In other words, the system (39) can be seen as a _nominal_ linear system (\(\dot{\boldsymbol{z}}=\boldsymbol{K}\boldsymbol{z}\)) with a perturbation term \(\widetilde{\boldsymbol{\gamma}}\). Since matrix \(\boldsymbol{K}\) is in block companion form and can be proven to be Hurwitz [37], the nominal system is exponentially stable.