Difference between revisions of "RotorcraftMixing"

From PaparazziUAV
Jump to navigation Jump to search
Line 16: Line 16:
Under the same assumption, the torque produced by each rotor can also be assumed to be in the same direction and proportional to the square of the rotational speed.
Under the same assumption, the torque produced by each rotor can also be assumed to be in the same direction and proportional to the square of the rotational speed.


The moment produced by each rotor around the CG, expressed in body frame can then be writen
The torque produced by each rotor around the CG, expressed in body frame can then be writen


<math>
<math>
\overrightarrow{M}_{i}^{B} = \begin{pmatrix}X_i C_t \omega_i^2\\Y_i C_t \omega_i^2\\D_i C_m \omega_i^2\end{pmatrix}
\overrightarrow{M}_{i}^{B} = \begin{pmatrix}Y_i C_t \omega_i^2\\X_i C_t \omega_i^2\\D_i C_m \omega_i^2\end{pmatrix}
</math>
</math>
Where <math>C_t</math> is a "thrust" coefficient and <math>Cd</math> is a "torque" coefficient. It has been measured experimentally that <math>\frac{Ct}{Cm} \approx 10</math> on a mikrokopter.
Where <math>C_t</math> is a "thrust" coefficient and <math>Cm</math> is a "torque" coefficient. It has been measured experimentally that <math>\frac{Ct}{Cm} \approx 10</math> on a mikrokopter.


As a first approximation we can consider that the rotational speed of the propeller is proportional to the square root of the applied command <math>u_i</math>
As a first approximation we can consider that the rotational speed of the propeller is proportional to the square root of the applied command <math>u_i</math>
Line 30: Line 30:




This allows us to express the momentum produced by the set of rotors as
This allows us to express the torque produced by the set of rotors as


<math>
<math>
\overrightarrow{M}^{B} = \sum_{i} \overrightarrow{M}_{i}^{B} =   
\overrightarrow{M}^{B} = \sum_{i} \overrightarrow{M}_{i}^{B} =   
   \begin{pmatrix}
   \begin{pmatrix}
    K C_t \sum_{i} Y_i u_i\\
     K C_t \sum_{i} X_i u_i\\
     K C_t \sum_{i} X_i u_i\\
    K C_t \sum_{i} Y_i u_i\\
     K C_m \sum_{i} D_i u_i
     K C_m \sum_{i} D_i u_i
   \end{pmatrix}
   \end{pmatrix}
Line 47: Line 47:
   K C_t
   K C_t
   \begin{pmatrix}
   \begin{pmatrix}
    Y_1&Y_2&\ldots&Y_n\\
     X_1&X_2&\ldots&X_n\\
     X_1&X_2&\ldots&X_n\\
    Y_1&Y_2&\ldots&Y_n\\
     \frac{C_m}{Ct}D_1&\frac{C_m}{Ct}D_2&\ldots&\frac{C_m}{Ct}D_n
     \frac{C_m}{Ct}D_1&\frac{C_m}{Ct}D_2&\ldots&\frac{C_m}{Ct}D_n
   \end{pmatrix}
   \end{pmatrix}
Line 89: Line 89:
A =
A =
   \begin{pmatrix}
   \begin{pmatrix}
    0.17 &-0.17 &0.25&-0.25& 0.33 &-0.33 \\
   -0.35 &-0.35 &0  & 0  & 0.35 & 0.35 \\
   -0.35 &-0.35 &0  & 0  & 0.35 & 0.35 \\
    0.17 &-0.17 &0.25&-0.25& 0.33 &-0.33 \\
   -0.1  & 0.1  &0.1 &-0.1 &-0.1  & 0.1
   -0.1  & 0.1  &0.1 &-0.1 &-0.1  & 0.1
   \end{pmatrix}
   \end{pmatrix}
Line 100: Line 100:
B =  
B =  
   \begin{pmatrix}
   \begin{pmatrix}
  - 0.714 &   0.241 & - 1.465  \\
    0.24  & -0.71 & -1.47 \\
  - 0.714 & - 0.241 &   1.465  \\
  -0.241 & -0.71 & 1.47 \\
     0     &   0.929 &   2.441  \\
     0.93  & 0.   & 2.44 \\
    0     & - 0.929 & - 2.441  \\
  -0.93  & 0.   & -2.44 \\
     0.714 &   0.687 & - 1.094  \\
     0.69  & 0.71 & -1.09 \\
    0.714 & - 0.687 &   1.094
  -0.69  & 0.71 & 1.09
   \end{pmatrix}
   \end{pmatrix}
</math>
</math>
Line 113: Line 113:
\tilde{B} =  
\tilde{B} =  
   \begin{pmatrix}
   \begin{pmatrix}
  -75  &  25 & -154 \\
    25  & -75  & -154 \\
   -75 & -25 &  154 \\
   -25 & -75  &  154 \\
    0 97 &  256 \\
    97 &   0 &  256 \\
    & -97 & -256 \\
  -97  &  0  & -256 \\
     75 72 & -115 \\
     72 75  & -115 \\
    75  & -72 &  115
  -72  &  75  &  115
  \end{pmatrix}
  \end{pmatrix}
</math>
</math>


which in turns yelds the following supervision section
which in turns yelds the following supervision section
<pre>
  <section name="SUPERVISION" prefix="SUPERVISION_">
    <define name="MIN_MOTOR" value="3"/>
    <define name="MAX_MOTOR" value="200"/>
    <define name="TRIM_A" value="0"/>
    <define name="TRIM_E" value="0"/>
    <define name="TRIM_R" value="0"/>
    <define name="NB_MOTOR" value="6"/>
    <define name="SCALE" value="256"/>
    <define name="ROLL_COEF"  value="{  25, -25,  97, -97,  72,  72}"/>
    <define name="PITCH_COEF"  value="{ -75, -75,  0,  0,  75,  75}"/>
    <define name="YAW_COEF"    value="{-154, 154, 256,-256, -115, 115}"/>
    <define name="THRUST_COEF" value="{ 256, 256, 256, 256,  256, 256}"/>
  </section>
</pre>
The above computation can be performed using the following simple octave script
<pre>
A = [
  0.17  -0.17  0.25  -0.25  0.33  -0.33
  -0.35  -0.35  0.    0.    0.35    0.35
  -0.1    0.1    0.1  -0.1  -0.1    0.1
];
B = pinv(A)
m = max(max(B));
Btilde =  round(B*256/m)

Revision as of 17:35, 28 January 2011

This page describe how to compute "mixing" for an arbitrary multirotors configuration.

Hexa 3D.png

Introduction

"Mixing" consist in converting rotational accelerations commands computed by the autopilot into throttle commands for each of the motor controllers.

Let us consider a vehicle comprising a set of identical fixed pitch rotors located at coordinates and spinning in the same plane in the direction at a rotational speed .

Assuming a quasi hovering regime, the force produced by each rotor can be considered normal to the rotor plane and proportional to the square of its rotational speed. Expressed in body frame ( front, right, down ), this leads to

Under the same assumption, the torque produced by each rotor can also be assumed to be in the same direction and proportional to the square of the rotational speed.

The torque produced by each rotor around the CG, expressed in body frame can then be writen

Where is a "thrust" coefficient and is a "torque" coefficient. It has been measured experimentally that on a mikrokopter.

As a first approximation we can consider that the rotational speed of the propeller is proportional to the square root of the applied command


This allows us to express the torque produced by the set of rotors as

which can be rewriten as a matrix vector product

is a matrix describing the geometric positions of our rotors and is the vector of throttle commands for our set of motor controllers.

In order to express the command applied to each power train as a function of the momentum we want to apply to our vehicle, we need to find , a matrix such as

If has rank 3, we know that such a matrix exists (yeah, we can't do 2 rotors or have all rotors aligned), and in this case, we have the relationship

We know that one solution of this equation is the Moore-Penrose pseudoinverse of . Furthermore, this solution is the one leading to the power train command vector having the smallest euclidian norm, which is interesting as it optimizes the repartion of our control effort across our power trains.

Example

Let's consider the following H hexarotors configuration.

Hexa h.png

The first two lines of the matrix represent the coordinates of each rotor in the plan, and the third line the direction in which they spin.

Normalizing yelds

which in turns yelds the following supervision section

   <section name="SUPERVISION" prefix="SUPERVISION_">
    <define name="MIN_MOTOR" value="3"/>
    <define name="MAX_MOTOR" value="200"/>
    <define name="TRIM_A" value="0"/>
    <define name="TRIM_E" value="0"/>
    <define name="TRIM_R" value="0"/>
    <define name="NB_MOTOR" value="6"/>
    <define name="SCALE" value="256"/>
    <define name="ROLL_COEF"   value="{  25, -25,  97, -97,   72,  72}"/>
    <define name="PITCH_COEF"  value="{ -75, -75,   0,   0,   75,  75}"/>
    <define name="YAW_COEF"    value="{-154, 154, 256,-256, -115, 115}"/>
    <define name="THRUST_COEF" value="{ 256, 256, 256, 256,  256, 256}"/>
  </section>

The above computation can be performed using the following simple octave script

A = [
   0.17   -0.17   0.25  -0.25   0.33   -0.33
  -0.35   -0.35   0.     0.     0.35    0.35
  -0.1     0.1    0.1   -0.1   -0.1     0.1
];

B = pinv(A)

m = max(max(B));

Btilde =  round(B*256/m)