# Virtual work (generalized forces) for rotation with Euler angles (quadcopter modeling)

Tags:
1. Jul 29, 2015

### space_voyager

Here is what we know from virtual work:
$$\delta W=\sum_{i=1}^N{\vec F_i\cdot\delta\vec r_{i}}$$
Where $N$ is the number of bodies in the system. I am considering a quadcopter, modeled as a rigid body so it is just one body and we have:
$$\delta W=\vec F\cdot\delta\vec r$$
My question concerns only rotational dynamics, so let's focus on just the torques. Let us rename $\vec F$ to $\vec M$ just to make it clear that we are talking about torques (moments):
$$\delta W=\vec M \cdot \delta\vec r$$
Expressed in the quadcopter frame (call it frame $B$), the moments exerted by the propellers on the quadcopter are, generally:
$$\vec M=\begin{bmatrix} \tau_x^B \\ \tau_y^B \\ \tau_z^B \end{bmatrix}$$
Because we are talking about moments, the "position" vector $\vec r$ actually holds the rotations expressed in the same frame as $\vec M$. Because I express $\vec M$ in the $B$ frame, I need to express the rotations in the $B$ frame. I am using the Tait-Bryan Euler angle convention. Starting from the inertial frame $I$ then:

1. Yaw by $\psi$ around $z_I$, the result is the $\{x',y',z'\}$ frame
- Corresponding rotation matrix is $R_\psi$
2. Pitch by $\theta$ around $y'$, the result is the $\{x'',y'',z''\}$ frame
- Corresponding rotation matrix is $R_\theta$
3. Roll by $\phi$ around $x''$, the result is the $\{x_B,y_B,z_B\}$ frame
- Corresponding rotation matrix is $R_\phi$

You see that each Euler angle is in a different frame: $\psi$ is in the $I$ frame, $\theta$ is in the $(')$ frame and $\phi$ is in the $('')$ frame. From what I know, we transform between angular rates in the $B$ frame and the Euler angle time derivatives using:

$$\dot\omega=R_\phi\begin{bmatrix}\dot\phi\\0\\0\end{bmatrix}+ R_\phi R_\theta\begin{bmatrix}0\\\dot\theta\\0\end{bmatrix}+ R_\phi R_\theta R_\psi\begin{bmatrix}0\\0\\\dot\psi\end{bmatrix}$$

However, $\dot\omega$ is not integrable (see sub-section 3.17 of http://people.mech.kuleuven.be/~bruyninc/tmp/HermanBruyninckx-robotics.pdf). Therefore angles in the body frame as such do not exist and I cannot simply write:

$$\vec r=R_\phi\begin{bmatrix}\phi\\0\\0\end{bmatrix}+ R_\phi R_\theta\begin{bmatrix}0\\\theta\\0\end{bmatrix}+ R_\phi R_\theta R_\psi\begin{bmatrix}0\\0\\\psi\end{bmatrix}$$

Where $\vec r$ is our "position" vector in the virtual work equation containing three angles in the $B$ frame identifying the quad-copter's attitude. The end motivation is to apply the generalized force relation:
$$Q_j=\sum_{i=1}^N{\vec F_i \cdot \frac{\partial \vec r_i}{\partial q_j}}$$
Where $q_j$ are the generalized coordinates, for me these are:

$q_1=\phi$
$q_2=\theta$
$q_3=\psi$

I really appreciate your help for my question: find the expression for the generalized forces $Q_j$ (well, generalized torque really in this case).

2. Aug 3, 2015