|  | Paparazzi UAS v7.0_unstable
    Paparazzi is a free software Unmanned Aircraft System. | 
Motor Mixing. More...
#include "modules/actuators/motor_mixing.h"#include "paparazzi.h"#include "modules/datalink/telemetry.h" Include dependency graph for motor_mixing.c:
 Include dependency graph for motor_mixing.c:Go to the source code of this file.
| Macros | |
| #define | INT32_MIN (-2147483647-1) | 
| #define | INT32_MAX (2147483647) | 
| #define | MOTOR_MIXING_MIN_MOTOR 0 | 
| #define | MOTOR_MIXING_MAX_MOTOR MAX_PPRZ | 
| #define | MOTOR_MIXING_STOP_MOTOR -MAX_PPRZ | 
| #define | MOTOR_MIXING_TRIM_ROLL 0 | 
| #define | MOTOR_MIXING_TRIM_PITCH 0 | 
| #define | MOTOR_MIXING_TRIM_YAW 0 | 
| #define | MOTOR_MIXING_MAX_SATURATION_OFFSET MAX_PPRZ/10 | 
| Maximum offset in case of saturation. | |
| #define | MOTOR_MIXING_MIN_MOTOR_STARTUP MOTOR_MIXING_MIN_MOTOR | 
| Functions | |
| static void | send_motor_mixing (struct transport_tx *trans, struct link_device *dev) | 
| void | motor_mixing_init (void) | 
| static void | offset_commands (int32_t offset) | 
| static void | bound_commands (void) | 
| static void | bound_commands_step (void) | 
| void | motor_mixing_run_spinup (uint32_t counter, uint32_t max_counter) | 
| void | motor_mixing_run (bool motors_on, bool override_on, pprz_t in_cmd[]) | 
Motor Mixing.
Handles the mapping of roll/pitch/yaw commands to actual motor commands.
Definition in file motor_mixing.c.
| #define INT32_MAX (2147483647) | 
Definition at line 37 of file motor_mixing.c.
| #define INT32_MIN (-2147483647-1) | 
Definition at line 33 of file motor_mixing.c.
Definition at line 44 of file motor_mixing.c.
Maximum offset in case of saturation.
If a saturation is reached (desired motor command outside of possible MIN_MOTOR/MAX_MOTOR range), this saturation_offset is applied to all motors in order to give attitude commands a higher priority than thrust. This setting limits the saturation_offset. Default is 10% of maximum command.
Definition at line 69 of file motor_mixing.c.
| #define MOTOR_MIXING_MIN_MOTOR 0 | 
Definition at line 43 of file motor_mixing.c.
| #define MOTOR_MIXING_MIN_MOTOR_STARTUP MOTOR_MIXING_MIN_MOTOR | 
Definition at line 73 of file motor_mixing.c.
Definition at line 47 of file motor_mixing.c.
| #define MOTOR_MIXING_TRIM_PITCH 0 | 
Definition at line 55 of file motor_mixing.c.
| #define MOTOR_MIXING_TRIM_ROLL 0 | 
Definition at line 51 of file motor_mixing.c.
| #define MOTOR_MIXING_TRIM_YAW 0 | 
Definition at line 59 of file motor_mixing.c.
Definition at line 136 of file motor_mixing.c.
References MotorMixing::commands, foo, motor_mixing, MOTOR_MIXING_MAX_MOTOR, MOTOR_MIXING_MIN_MOTOR, and MOTOR_MIXING_NB_MOTOR.
Referenced by motor_mixing_run().
 Here is the caller graph for this function:
 Here is the caller graph for this function:Definition at line 144 of file motor_mixing.c.
References MotorMixing::commands, foo, motor_mixing, and MOTOR_MIXING_NB_MOTOR.
Referenced by motor_mixing_run().
 Here is the caller graph for this function:
 Here is the caller graph for this function:Definition at line 109 of file motor_mixing.c.
References MotorMixing::commands, DefaultPeriodic, foo, motor_mixing, MOTOR_MIXING_NB_MOTOR, MOTOR_MIXING_STOP_MOTOR, MOTOR_MIXING_TRIM_PITCH, MOTOR_MIXING_TRIM_ROLL, MOTOR_MIXING_TRIM_YAW, MotorMixing::nb_failure, MotorMixing::nb_saturation, MotorMixing::override_enabled, MotorMixing::override_value, pitch_coef, register_periodic_telemetry(), roll_coef, send_motor_mixing(), MotorMixing::trim, and yaw_coef.
 Here is the call graph for this function:
 Here is the call graph for this function:Definition at line 193 of file motor_mixing.c.
References bound_commands(), bound_commands_step(), MotorMixing::commands, FALSE, foo, INT32_MAX, INT32_MIN, MAX_PPRZ, motor_mixing, MOTOR_MIXING_MAX_MOTOR, MOTOR_MIXING_MAX_SATURATION_OFFSET, MOTOR_MIXING_MIN_MOTOR, MOTOR_MIXING_NB_MOTOR, MOTOR_MIXING_SCALE, MOTOR_MIXING_STOP_MOTOR, MotorMixing::nb_failure, MotorMixing::nb_saturation, offset_commands(), MotorMixing::override_enabled, MotorMixing::override_value, pitch_coef, roll_coef, thrust_coef, MotorMixing::trim, and yaw_coef.
 Here is the call graph for this function:
 Here is the call graph for this function:Definition at line 168 of file motor_mixing.c.
References MotorMixing::commands, counter, foo, motor_mixing, MOTOR_MIXING_MIN_MOTOR, MOTOR_MIXING_MIN_MOTOR_STARTUP, and MOTOR_MIXING_NB_MOTOR.
Definition at line 128 of file motor_mixing.c.
References MotorMixing::commands, foo, motor_mixing, MOTOR_MIXING_NB_MOTOR, and offset.
Referenced by motor_mixing_run().
 Here is the caller graph for this function:
 Here is the caller graph for this function:| 
 | static | 
Definition at line 98 of file motor_mixing.c.
References MotorMixing::commands, dev, foo, motor_mixing, and MOTOR_MIXING_NB_MOTOR.
Referenced by motor_mixing_init().
 Here is the caller graph for this function:
 Here is the caller graph for this function:| struct MotorMixing motor_mixing | 
Definition at line 94 of file motor_mixing.c.
Referenced by actuators_hitl_periodic(), bound_commands(), bound_commands_step(), motor_mixing_init(), motor_mixing_run(), motor_mixing_run_spinup(), nps_autopilot_run_step(), offset_commands(), send_motor_mixing(), and send_status().
| 
 | static | 
Definition at line 90 of file motor_mixing.c.
Referenced by motor_mixing_init(), and motor_mixing_run().
| 
 | static | 
Definition at line 89 of file motor_mixing.c.
Referenced by motor_mixing_init(), and motor_mixing_run().
| 
 | static | 
Definition at line 92 of file motor_mixing.c.
Referenced by motor_mixing_run().
| 
 | static | 
Definition at line 91 of file motor_mixing.c.
Referenced by init_gazebo(), motor_mixing_init(), and motor_mixing_run().