Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
eff_scheduling_rotwing_V2.c File Reference
#include "modules/ctrl/eff_scheduling_rotwing_V2.h"
#include "generated/airframe.h"
#include "state.h"
#include "modules/actuators/actuators.h"
#include "modules/core/abi.h"
#include "filters/low_pass_filter.h"
#include "modules/ins/ins_ext_pose.h"
#include "firmwares/rotorcraft/oneloop/oneloop_andi.h"
#include "generated/modules.h"
+ Include dependency graph for eff_scheduling_rotwing_V2.c:

Go to the source code of this file.

Macros

#define FORCE_ONELOOP
 
#define WING_ROTATION_CAN_ROTWING_ID   ABI_BROADCAST
 ABI binding wing position data. More...
 

Functions

void eff_scheduling_rotwing_update_wing_angle (void)
 
void eff_scheduling_rotwing_update_airspeed (void)
 
void ele_pref_sched (void)
 
void update_attitude (void)
 
void sum_EFF_MAT_RW (void)
 Function that sums g1 and g2 to obtain the g1_g2 matrix. More...
 
void init_RW_Model (void)
 
void calc_G1_G2_RW (void)
 
static void wing_position_cb (uint8_t sender_id UNUSED, struct act_feedback_t *pos_msg, uint8_t num_act)
 
void eff_scheduling_rotwing_init (void)
 
void eff_scheduling_rotwing_periodic (void)
 

Variables

float actuator_state_filt_vect [EFF_MAT_COLS_NB] = {0}
 
float G2_RW [EFF_MAT_COLS_NB] = {0}
 
float G1_RW [EFF_MAT_ROWS_NB][EFF_MAT_COLS_NB] = {0}
 
float EFF_MAT_RW [EFF_MAT_ROWS_NB][EFF_MAT_COLS_NB] = {0}
 
static float flt_cut_ap = 2.0e-3
 
static float flt_cut = 1.0e-4
 
struct FloatEulers eulers_zxy_RW_EFF
 
static Butterworth2LowPass skew_filt
 
bool airspeed_fake_on = false
 
float airspeed_fake = 0.0
 
float ele_eff = 19.36
 
float roll_eff = 5.5
 
float yaw_eff = 0.390
 
float ele_min = 0.0
 
struct RW_Model RW
 
static abi_event wing_position_ev
 
float skew_meas = 0.0
 
float time = 0.0
 

Detailed Description

Author
Tomaso De Ponti T.M.L.nosp@m..DeP.nosp@m.onti@.nosp@m.tude.nosp@m.lft.n.nosp@m.l The control effectiveness scheduler for the rotating wing drone type

Definition in file eff_scheduling_rotwing_V2.c.

Macro Definition Documentation

◆ FORCE_ONELOOP

#define FORCE_ONELOOP

Definition at line 34 of file eff_scheduling_rotwing_V2.c.

◆ WING_ROTATION_CAN_ROTWING_ID

#define WING_ROTATION_CAN_ROTWING_ID   ABI_BROADCAST

ABI binding wing position data.

Definition at line 96 of file eff_scheduling_rotwing_V2.c.

Function Documentation

◆ calc_G1_G2_RW()

◆ eff_scheduling_rotwing_init()

void eff_scheduling_rotwing_init ( void  )

◆ eff_scheduling_rotwing_periodic()

void eff_scheduling_rotwing_periodic ( void  )

◆ eff_scheduling_rotwing_update_airspeed()

void eff_scheduling_rotwing_update_airspeed ( void  )
inline

Definition at line 401 of file eff_scheduling_rotwing_V2.c.

References airspeed_fake, airspeed_fake_on, RW_Model::as, RW_Model::as2, RW, stateGetAirspeed_f(), and time.

Referenced by eff_scheduling_rotwing_periodic().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ eff_scheduling_rotwing_update_wing_angle()

void eff_scheduling_rotwing_update_wing_angle ( void  )
inline

◆ ele_pref_sched()

void ele_pref_sched ( void  )

Definition at line 418 of file eff_scheduling_rotwing_V2.c.

References RW_Model::as, ELE_MAX_AS, ele_min, ELE_MIN_AS, RW_Model::ele_pref, RW, and ZERO_ELE_PPRZ.

Referenced by eff_scheduling_rotwing_periodic().

+ Here is the caller graph for this function:

◆ init_RW_Model()

◆ sum_EFF_MAT_RW()

void sum_EFF_MAT_RW ( void  )

Function that sums g1 and g2 to obtain the g1_g2 matrix.

It also undoes the scaling that was done to make the values readable FIXME: make this function into a for loop to make it more adaptable to different configurations

Definition at line 294 of file eff_scheduling_rotwing_V2.c.

References RW_Model::att, RW_attitude::cphi, RW_attitude::cpsi, RW_attitude::ctheta, wing_model::dLdtheta, EFF_MAT_COLS_NB, EFF_MAT_ROWS_NB, EFF_MAT_RW, flt_cut, flt_cut_ap, G1_RW, G2_RW, wing_model::L, RW_Model::m, RW_Model::P, P, RW, RW_aD, RW_aE, RW_aN, RW_ap, RW_aq, RW_ar, RW_aX, RW_aZ, RW_attitude::sphi, RW_attitude::spsi, RW_attitude::stheta, RW_Model::T, mesonh.mesonh_atmosphere::T, and RW_Model::wing.

Referenced by eff_scheduling_rotwing_periodic().

+ Here is the caller graph for this function:

◆ update_attitude()

◆ wing_position_cb()

static void wing_position_cb ( uint8_t sender_id  UNUSED,
struct act_feedback_t pos_msg,
uint8_t  num_act 
)
static

Definition at line 102 of file eff_scheduling_rotwing_V2.c.

References skew_meas.

Referenced by eff_scheduling_rotwing_init().

+ Here is the caller graph for this function:

Variable Documentation

◆ actuator_state_filt_vect

float actuator_state_filt_vect[EFF_MAT_COLS_NB] = {0}

Definition at line 37 of file eff_scheduling_rotwing_V2.c.

◆ airspeed_fake

float airspeed_fake = 0.0

Definition at line 77 of file eff_scheduling_rotwing_V2.c.

Referenced by eff_scheduling_rotwing_update_airspeed().

◆ airspeed_fake_on

bool airspeed_fake_on = false

Definition at line 76 of file eff_scheduling_rotwing_V2.c.

Referenced by eff_scheduling_rotwing_update_airspeed().

◆ EFF_MAT_RW

◆ ele_eff

float ele_eff = 19.36

Definition at line 78 of file eff_scheduling_rotwing_V2.c.

Referenced by calc_G1_G2_RW(), and init_RW_Model().

◆ ele_min

float ele_min = 0.0

Definition at line 81 of file eff_scheduling_rotwing_V2.c.

Referenced by ele_pref_sched(), and oneloop_andi_enter().

◆ eulers_zxy_RW_EFF

struct FloatEulers eulers_zxy_RW_EFF

Definition at line 71 of file eff_scheduling_rotwing_V2.c.

Referenced by update_attitude().

◆ flt_cut

float flt_cut = 1.0e-4
static

Definition at line 71 of file eff_scheduling_rotwing_V2.c.

Referenced by sum_EFF_MAT_RW().

◆ flt_cut_ap

float flt_cut_ap = 2.0e-3
static

Definition at line 70 of file eff_scheduling_rotwing_V2.c.

Referenced by sum_EFF_MAT_RW().

◆ G1_RW

float G1_RW[EFF_MAT_ROWS_NB][EFF_MAT_COLS_NB] = {0}

Definition at line 68 of file eff_scheduling_rotwing_V2.c.

Referenced by calc_G1_G2_RW(), and sum_EFF_MAT_RW().

◆ G2_RW

float G2_RW[EFF_MAT_COLS_NB] = {0}

Definition at line 67 of file eff_scheduling_rotwing_V2.c.

Referenced by calc_G1_G2_RW(), oneloop_andi_run(), and sum_EFF_MAT_RW().

◆ roll_eff

float roll_eff = 5.5

Definition at line 79 of file eff_scheduling_rotwing_V2.c.

Referenced by init_RW_Model().

◆ RW

◆ skew_filt

◆ skew_meas

float skew_meas = 0.0

◆ time

◆ wing_position_ev

abi_event wing_position_ev
static

Definition at line 99 of file eff_scheduling_rotwing_V2.c.

Referenced by eff_scheduling_rotwing_init().

◆ yaw_eff

float yaw_eff = 0.390