## 4 Robots Modeling and Control
### The Control Strategy for the UAV  
Our UAV is the quadrotor Bebop 2, Parrot Inc., in X-configuration, whose body and global frame are illustrated in Figure 7. Its translational coordinates are defined as \(\mathbf{x}= \begin{bmatrix}x&y&z\end{bmatrix} ^{\top}\) and its attitude is described by the vector \(\boldsymbol{\eta}= \begin{bmatrix}\phi&\theta&\psi\end{bmatrix} ^{\top}\), which contains the Tait-Bryan angles of rotation, pitch and yaw, both related to the global frame \(\langle w\rangle\). Because Bebop 2 has an autopilot, we can assume that its in-flight stabilization is the responsibility of the embedded firmware. Consequently, for tasks performed in near-hovering operations, the UAV response can be modeled by a more simplistic set of equations, useful for the proposal of flight controllers. Given this fact, its simplified dynamic model in the global frame can be written as  
\[ \begin{bmatrix}\check{x}\\ \check{y}\\ \check{z}\\ \check{y}\end{bmatrix} = \begin{bmatrix}k_{1}\cos\psi&-k_{3}\sin\psi&0&0\\ k_{1}\sin\psi&k_{3}\cos\psi&0&0\\ 0&0&k_{5}&0\\ 0&0&0&k_{7}\end{bmatrix}\begin{bmatrix}u_{v_{z}}\\ u_{v_{y}}\\ u_{z}\\ u_{\check{y}}\end{bmatrix} - \begin{bmatrix}k_{2}\cos\psi&-k_{4}\sin\psi&0&0\\ k_{2}\sin\psi&k_{4}\cos\psi&0&0\\ 0&0&k_{6}&0\\ 0&0&0&k_{8}\end{bmatrix}\begin{bmatrix}v_{x}\\ v_{y}\\ z\\ \psi\end{bmatrix} , \tag{7}\]  
or in the compact formulation as \(\check{\mathbf{q}}=\mathbf{F}_{1}\mathbf{u}-\mathbf{F}_{2}\mathbf{v}\). As stated in [30], such a model is obviously not a complete description of rotorcraft dynamics. However, this formulation accurately describes the influence of high-level control signals on the vehicle's maneuvers. From (7), \(v_{x}\) and \(v_{y}\) are the linear velocity along \(x-\) and \(y-\)axis of the UAV body frame, whereas \(\check{z}\) and \(\check{\psi}\) are the linear and angular velocities along and around the \(z\)-axis, respectively, in the global frame. For experimental purposes, the Bebop's firmware provides the processed data readout of these variables. Finally, \(\mathbf{u}\in[-1,1]\) is the normalized control signals. In summary, \(u_{v_{x}}\) and \(u_{v_{y}}\) represent pitch and roll commands, which indirectly causes a linear velocity and a displacement along the \(x_{B}\)- and \(y_{8}\)-axis, respectively. In addition, \(u_{z}\) and \(u_{\check{\psi}}\) represent the inputs associated with \(\check{z}\) and \(\check{\psi}\), respectively. In order to perform a positioning task, let us propose the control law  
\[\mathbf{u}=\mathbf{F}_{1}^{-1}(\boldsymbol{\eta}+\mathbf{F}_{2}\mathbf{v}), \quad\text{with}\quad\boldsymbol{\eta}=\check{\mathbf{q}}_{d}+\mathbf{K}_{d} \check{\mathbf{q}}+\mathbf{K}_{p}\check{\mathbf{q}}, \tag{8}\]  
where \(\check{\mathbf{q}}=\mathbf{q}_{d}-\mathbf{q}\) is the pose error, and \(\mathbf{K}_{d}\) and \(\mathbf{K}_{p}\) are positive defined gain matrices. Notice that this controller design follows the inverse dynamic formulation. Figure 7: Reference system for Parrot Bebop 2 UAV, according to Tait-Bryan angles. In order to demonstrate the system stability in the closed loop, let us take the following radially unlimited Lyapunov candidate function  
\[V(\mathbf{\hat{q}},\mathbf{\hat{q}})=\frac{1}{2}\mathbf{\hat{q}}^{\intercal}\mathbf{ K}_{p}\mathbf{\hat{q}}+\frac{1}{2}\mathbf{\hat{q}}^{\intercal}\mathbf{\hat{q}}>0. \tag{9}\]  
By applying the first time derivative, and then replacing (7) and (8), we get  
\[ \begin{split}\dot{V}(\mathbf{\hat{q}},\mathbf{\hat{q}})& =\mathbf{\hat{q}}^{\intercal}\mathbf{K}_{p}\mathbf{\hat{q}}+ \mathbf{\hat{q}}^{\intercal}(\mathbf{F}_{1}\mathbf{u}-\mathbf{F}_{2}\mathbf{v} )\\ &=\mathbf{\hat{q}}^{\intercal}\mathbf{K}_{p}\mathbf{\hat{q}}+ \mathbf{\hat{q}}^{\intercal}\big{(}-\mathbf{K}_{d}\mathbf{\hat{q}}-\mathbf{K} _{p}\mathbf{\hat{q}}\big{)}\\ &=-\mathbf{\hat{q}}^{\intercal}\mathbf{K}_{d}\mathbf{\hat{q}} \leq 0.\end{split}  \tag{10}\]  
From the [PERSON] theory, we can conclude that \(\mathbf{\hat{q}}\to 0\) for \(t\to\infty\).