Motor mixing for multi-rotor systems
see http://wiki.paparazziuav.org/wiki/Rotorcraft_Configuration#Motor_Mixing
Example for airframe file
Add to your firmware section:
1 <module name="motor_mixing"/>
Module configuration options
Airframe file section
- section name:
MIXING
prefix: MOTOR_MIXING_
- name
TRIM_ROLL
value: 0
Description: roll trim
- name
TRIM_PITCH
value: 0
Description: pitch trim
- name
TRIM_YAW
value: 0
Description: yaw trim
- name
NB_MOTOR
value: 4
Description: number of motors
- name
SCALE
value: 256
Description: scaling factor
- name
ROLL_COEF
value: { 0, 0, -256, 256 }
Description: array of roll coefficient
- name
PITCH_COEF
value: { 256, -256, 0, 0 }
Description: array of pitch coefficient
- name
YAW_COEF
value: { -256, -256, 256, 256 }
Description: array of yaw coefficient
- name
THRUST_COEF
value: { 256, 256, 256, 256 }
Description: array of thurst coefficient
Module functions
Init Functions
These initialization functions are called once on startup.
Files
Header Files
The following headers are automatically included in modules.h
Source Files
Raw motor_mixing.xml file:
<!DOCTYPE module SYSTEM "module.dtd">
<module name="motor_mixing" dir="actuators" task="actuators">
<doc>
<description>
Motor mixing for multi-rotor systems
see http://wiki.paparazziuav.org/wiki/Rotorcraft_Configuration#Motor_Mixing
</description>
<section name="MIXING" prefix="MOTOR_MIXING_">
<define name="TRIM_ROLL" value="0" description="roll trim"/>
<define name="TRIM_PITCH" value="0" description="pitch trim"/>
<define name="TRIM_YAW" value="0" description="yaw trim"/>
<define name="NB_MOTOR" value="4" description="number of motors"/>
<define name="SCALE" value="256" description="scaling factor"/>
<define name="ROLL_COEF" value="{ 0, 0, -256, 256 }" description="array of roll coefficient"/>
<define name="PITCH_COEF" value="{ 256, -256, 0, 0 }" description="array of pitch coefficient"/>
<define name="YAW_COEF" value="{ -256, -256, 256, 256 }" description="array of yaw coefficient"/>
<define name="THRUST_COEF" value="{ 256, 256, 256, 256 }" description="array of thurst coefficient"/>
</section>
</doc>
<header>
<file name="motor_mixing.h" dir="subsystems/actuators"/>
</header>
<init fun="motor_mixing_init()"/>
<makefile target="!sim">
<define name="USE_MOTOR_MIXING"/>
<file name="motor_mixing.c" dir="subsystems/actuators"/>
</makefile>
</module>