# Control of an Omnidirectional UAV for Transportation and Manipulation Tasks
## 7 Simulation Results  
The proposed controller has been tested via numerical simulation in the MATLAB(r) SimMechanics environment. The geometric and dynamic parameters of the ODQuad as well as details on the multi-body SimMechanics model can be found in [17]. In order to verify the effectiveness and the robustness of the controller, simulations in free-space motion and in the presence of contact with an object have been conducted. In the first one, in order to show the capability of controlling both position and orientation at same time, a trajectory in free-space has been commanded to the vehicle platform; in the latter simulation, the behavior in the presence of a task requiring grasp and transportation of an object has been tested. The following realistic assumptions have been considered:  
* reliable, but noisy, measurements of the platform position and orientation are available, e.g., provided by a motion capture system and an IMU;
* white noise has been added to measures of the platform position (with standard deviation \(10^{-2}\) m) and orientation (with standard deviation \(10^{-2}\) rad);
* the angular positions of the roll and pitch joints are available via sensors usually integrated into the servomotors, while the angular velocities are obtained via numerical filtering. Thus, the orientation of the rotor frame relative to the platform frame can be computed via (1);
* centrifugal and Coriolis terms have been neglected in control laws (18), (28), and (29);
* viscous friction has been included in the simulation model but not considered in the control design. The control gains that are reported in Table 1 have been tuned via a trial-and-error procedure by taking into account that the internal loop must be faster than the outer one and with the goal of minimizing the tracking error. The observer gain is reported in Table 2, and it has been set via a trial-and-error procedure by looking for the best trade-off between the convergence rate and the robustness to measurement noise. \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline
**Gain** & \multicolumn{2}{c}{**Value**} & \multicolumn{2}{c}{**Gain**} & \multicolumn{2}{c}{**Value**} & \multicolumn{2}{c}{**Gain**} & \multicolumn{2}{c}{**Value**} \\ \hline \multirow{3}{*}{\(K_{P,p}\)} & \(\begin{bmatrix}25&0&0\\ 0&25&0\\ 0&0&25\end{bmatrix}\) & \multirow{3}{*}{\(\mathbf{K}_{D,p}\)} & \(\begin{bmatrix}6.3&0&0\\ 0&6.3&0\\ 0&0&6.3\end{bmatrix}\) & \multirow{3}{*}{\(\mathbf{K}_{I,p}\)} & \(\begin{bmatrix}0.025&0&0\\ 0&0.025&0\\ 0&0&0.025\\ 0&0&0.025\end{bmatrix}\) \\  & \(\begin{bmatrix}375&0&0\\ 0&375&0\\ 0&0&125\end{bmatrix}\) & \multirow{3}{*}{\(\mathbf{K}_{D,\phi}\)} & \(\begin{bmatrix}25.5&0&0\\ 0&25.5&0\\ 0&0&8.5\end{bmatrix}\) & \multirow{3}{*}{\(\mathbf{K}_{I,\phi}\)} & \(\begin{bmatrix}150&0\\ 0&150&0\\ 0&0&50\end{bmatrix}\) \\  & \(\begin{bmatrix}375&0\\ 0&375\end{bmatrix}\) & \multirow{3}{*}{\(\mathbf{K}_{D,\delta}\)} & \(\begin{bmatrix}25.5&0\\ 0&25.5\\ \end{bmatrix}\) & \multirow{3}{*}{\(\mathbf{K}_{I,\delta}\)} & \(\begin{bmatrix}150&0\\ 0&150\end{bmatrix}\) \\  & & & & & & \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Gain matrices for the auxiliary inputs (19), (20) and (27). In order verify the trajectory tracking capabilities, in the first simulation case study, time-varying desired position (see Figure 3a) and orientation (see Figure 3b) are commanded to the ODQuad platform. As previously remarked, it is worth noticing that, differently from common quadrotors, motion involving all six degrees of freedom can been assigned. The obtained results are reported in Figure 4a,b in terms of position \((\mathbf{p}_{0,d}-\mathbf{p}_{0})\) and orientation \((\mathbf{\phi}_{0,d}-\mathbf{\phi}_{0})\) errors. In both cases, satisfactory performance is achieved, since the maximum position error is about 5 mm along the axes \(x\) and \(y\) and 15 mm along the \(z\) axis, while the orientation error oscillates around zero, with some peaks below 5 deg.