Paparazzi UAS  v5.0.5_stable-7-g4b8bbb7
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
motor_mixing.c File Reference

Motor Mixing. More...

+ 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_MAX_SATURATION_OFFSET   MAX_PPRZ/3
 
#define MOTOR_MIXING_MIN_MOTOR_STARTUP   MOTOR_MIXING_MIN_MOTOR
 

Functions

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_t motors_on, bool_t override_on, pprz_t in_cmd[])
 

Variables

static const int32_t roll_coef [MOTOR_MIXING_NB_MOTOR] = MOTOR_MIXING_ROLL_COEF
 
static const int32_t pitch_coef [MOTOR_MIXING_NB_MOTOR] = MOTOR_MIXING_PITCH_COEF
 
static const int32_t yaw_coef [MOTOR_MIXING_NB_MOTOR] = MOTOR_MIXING_YAW_COEF
 
static const int32_t thrust_coef [MOTOR_MIXING_NB_MOTOR] = MOTOR_MIXING_THRUST_COEF
 
struct MotorMixing motor_mixing
 

Detailed Description

Motor Mixing.

Handles the mapping of roll/pitch/yaw commands to actual motor commands.

Definition in file motor_mixing.c.

Macro Definition Documentation

#define INT32_MAX   (2147483647)

Definition at line 37 of file motor_mixing.c.

Referenced by motor_mixing_run().

#define INT32_MIN   (-2147483647-1)

Definition at line 33 of file motor_mixing.c.

Referenced by motor_mixing_run().

#define MOTOR_MIXING_MAX_MOTOR   MAX_PPRZ

Definition at line 44 of file motor_mixing.c.

Referenced by bound_commands(), and motor_mixing_run().

#define MOTOR_MIXING_MAX_SATURATION_OFFSET   MAX_PPRZ/3

Definition at line 51 of file motor_mixing.c.

Referenced by motor_mixing_run().

#define MOTOR_MIXING_MIN_MOTOR   0

Definition at line 43 of file motor_mixing.c.

Referenced by bound_commands(), motor_mixing_run(), and motor_mixing_run_spinup().

#define MOTOR_MIXING_MIN_MOTOR_STARTUP   MOTOR_MIXING_MIN_MOTOR

Definition at line 55 of file motor_mixing.c.

Referenced by motor_mixing_run_spinup().

#define MOTOR_MIXING_STOP_MOTOR   -MAX_PPRZ

Definition at line 47 of file motor_mixing.c.

Referenced by motor_mixing_init(), and motor_mixing_run().

Function Documentation

static void bound_commands ( void  )
inlinestatic

Definition at line 98 of file motor_mixing.c.

References MotorMixing::commands, motor_mixing, MOTOR_MIXING_MAX_MOTOR, and MOTOR_MIXING_MIN_MOTOR.

Referenced by motor_mixing_run().

+ Here is the caller graph for this function:

static void bound_commands_step ( void  )
inlinestatic

Definition at line 126 of file motor_mixing.c.

Referenced by motor_mixing_run().

+ Here is the caller graph for this function:

void motor_mixing_init ( void  )
void motor_mixing_run_spinup ( uint32_t  counter,
uint32_t  max_counter 
)
static void offset_commands ( int32_t  offset)
inlinestatic

Definition at line 92 of file motor_mixing.c.

References MotorMixing::commands, and motor_mixing.

Referenced by motor_mixing_run().

+ Here is the caller graph for this function:

Variable Documentation

const int32_t pitch_coef[MOTOR_MIXING_NB_MOTOR] = MOTOR_MIXING_PITCH_COEF
static

Definition at line 72 of file motor_mixing.c.

Referenced by motor_mixing_init(), and motor_mixing_run().

const int32_t roll_coef[MOTOR_MIXING_NB_MOTOR] = MOTOR_MIXING_ROLL_COEF
static

Definition at line 71 of file motor_mixing.c.

Referenced by motor_mixing_init(), and motor_mixing_run().

const int32_t thrust_coef[MOTOR_MIXING_NB_MOTOR] = MOTOR_MIXING_THRUST_COEF
static

Definition at line 74 of file motor_mixing.c.

Referenced by motor_mixing_run().

const int32_t yaw_coef[MOTOR_MIXING_NB_MOTOR] = MOTOR_MIXING_YAW_COEF
static

Definition at line 73 of file motor_mixing.c.

Referenced by motor_mixing_init(), and motor_mixing_run().