Paparazzi UAS v7.1_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
eff_scheduling_rotwing_nB.c File Reference
#include "modules/ctrl/eff_scheduling_rotwing_nB.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_nB.h"
#include "generated/modules.h"
Include dependency graph for eff_scheduling_rotwing_nB.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.

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.
void init_RW_Model (void)
void calc_G1_G2_RW (void)
float calc_thrust_curve (float k1, float k2, float k3, float u)
float calc_thrust_curve_d (float k1, float k2, float u)
void calc_all_thrust_curve (void)
void init_all_thrust_curve (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}
bool manual_roll = false
bool manual_pitch = false
bool manual_yaw = false
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}
float I_inv [3][3] = {0}
static float flt_cut_a = 1.0e-6
static float flt_cut_ap = 2.0e-6
static float flt_cut = 1.0e-6
struct FloatEulers eulers_zxy_RW_EFF
static Butterworth2LowPass skew_filt
static Butterworth2LowPass phi_filt
static Butterworth2LowPass theta_filt
static Butterworth2LowPass psi_filt
int G2_on = 0
bool airspeed_fake_on = false
float airspeed_fake = 0.0
float ele_eff = 19.36
float roll_eff = 8.9
float yaw_eff = 0.237
float ele_min = 0.0
struct RW_Model RW
int thrust_curve = 1.0
float temp_mQ_k = 1.37
static abi_event wing_position_ev
float skew_meas = 0.0
static float sim_time = 0.0f

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_nB.c.

Macro Definition Documentation

◆ FORCE_ONELOOP

#define FORCE_ONELOOP

Definition at line 34 of file eff_scheduling_rotwing_nB.c.

◆ WING_ROTATION_CAN_ROTWING_ID

#define WING_ROTATION_CAN_ROTWING_ID   ABI_BROADCAST

ABI binding wing position data.

Definition at line 111 of file eff_scheduling_rotwing_nB.c.

Function Documentation

◆ calc_all_thrust_curve()

void calc_all_thrust_curve ( void )

Definition at line 499 of file eff_scheduling_rotwing_nB.c.

References actuator_state_1l, calc_thrust_curve_d(), RW, RW_G_SCALE, temp_mQ_k, and thrust_curve.

Referenced by calc_G1_G2_RW().

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

◆ calc_G1_G2_RW()

void calc_G1_G2_RW ( void )

Definition at line 256 of file eff_scheduling_rotwing_nB.c.

References calc_all_thrust_curve(), G1_RW, G2_on, G2_RW, I_inv, RW, RW_ap, RW_aq, RW_ar, and RW_aZ.

Referenced by eff_scheduling_rotwing_periodic().

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

◆ calc_thrust_curve()

float calc_thrust_curve ( float k1,
float k2,
float k3,
float u )

Definition at line 489 of file eff_scheduling_rotwing_nB.c.

Referenced by init_all_thrust_curve().

Here is the caller graph for this function:

◆ calc_thrust_curve_d()

float calc_thrust_curve_d ( float k1,
float k2,
float u )

Definition at line 493 of file eff_scheduling_rotwing_nB.c.

Referenced by calc_all_thrust_curve(), and init_all_thrust_curve().

Here is the caller graph for this function:

◆ 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 460 of file eff_scheduling_rotwing_nB.c.

References airspeed_fake, airspeed_fake_on, FloatRates::r, RW, sim_time, and stateGetBodyRates_f().

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

Definition at line 438 of file eff_scheduling_rotwing_nB.c.

References float_quat_of_eulers(), RW, skew_filt, skew_meas, and update_butterworth_2_low_pass().

Referenced by eff_scheduling_rotwing_periodic().

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

◆ ele_pref_sched()

void ele_pref_sched ( void )

Definition at line 479 of file eff_scheduling_rotwing_nB.c.

References ELE_MAX_AS, ele_min, ELE_MIN_AS, RW, and ZERO_ELE_PPRZ.

Referenced by eff_scheduling_rotwing_periodic().

Here is the caller graph for this function:

◆ init_all_thrust_curve()

void init_all_thrust_curve ( void )

Definition at line 532 of file eff_scheduling_rotwing_nB.c.

References calc_thrust_curve(), calc_thrust_curve_d(), and RW.

Referenced by init_RW_Model().

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

◆ init_RW_Model()

void init_RW_Model ( void )

Definition at line 144 of file eff_scheduling_rotwing_nB.c.

References ele_eff, init_all_thrust_curve(), RW, and RW_G_SCALE.

Referenced by eff_scheduling_rotwing_init().

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

◆ 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 332 of file eff_scheduling_rotwing_nB.c.

References COMMAND_PITCH, COMMAND_ROLL, EFF_MAT_COLS_NB, EFF_MAT_ROWS_NB, EFF_MAT_RW, flt_cut, flt_cut_a, flt_cut_ap, G1_RW, G2_RW, manual_pitch, manual_roll, manual_yaw, P, RW, RW_aD, RW_aE, RW_aN, RW_ap, RW_aq, RW_ar, RW_aZ, and RW_Model::T.

Referenced by eff_scheduling_rotwing_periodic().

Here is the caller graph for this function:

◆ update_attitude()

void update_attitude ( void )

Definition at line 238 of file eff_scheduling_rotwing_nB.c.

References eulers_zxy_RW_EFF, float_eulers_of_quat_zxy(), phi_filt, psi_filt, RW, stateGetNedToBodyQuat_f(), theta_filt, and update_butterworth_2_low_pass().

Referenced by eff_scheduling_rotwing_init(), and eff_scheduling_rotwing_periodic().

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

◆ wing_position_cb()

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

Definition at line 117 of file eff_scheduling_rotwing_nB.c.

References skew_meas, UNUSED, and wing_position_cb().

Here is the call 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_nB.c.

◆ airspeed_fake

float airspeed_fake = 0.0

Definition at line 86 of file eff_scheduling_rotwing_nB.c.

Referenced by eff_scheduling_rotwing_update_airspeed().

◆ airspeed_fake_on

bool airspeed_fake_on = false

Definition at line 85 of file eff_scheduling_rotwing_nB.c.

Referenced by eff_scheduling_rotwing_update_airspeed().

◆ EFF_MAT_RW

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

Definition at line 72 of file eff_scheduling_rotwing_nB.c.

◆ ele_eff

float ele_eff = 19.36

Definition at line 87 of file eff_scheduling_rotwing_nB.c.

Referenced by calc_G1_G2_RW(), and init_RW_Model().

◆ ele_min

float ele_min = 0.0

Definition at line 90 of file eff_scheduling_rotwing_nB.c.

◆ eulers_zxy_RW_EFF

struct FloatEulers eulers_zxy_RW_EFF

Definition at line 78 of file eff_scheduling_rotwing_nB.c.

◆ flt_cut

float flt_cut = 1.0e-6
static

Definition at line 76 of file eff_scheduling_rotwing_nB.c.

◆ flt_cut_a

float flt_cut_a = 1.0e-6
static

Definition at line 74 of file eff_scheduling_rotwing_nB.c.

◆ flt_cut_ap

float flt_cut_ap = 2.0e-6
static

Definition at line 75 of file eff_scheduling_rotwing_nB.c.

◆ G1_RW

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

Definition at line 71 of file eff_scheduling_rotwing_nB.c.

◆ G2_on

int G2_on = 0

Definition at line 84 of file eff_scheduling_rotwing_nB.c.

◆ G2_RW

float G2_RW[EFF_MAT_COLS_NB] = {0}

Definition at line 70 of file eff_scheduling_rotwing_nB.c.

◆ I_inv

float I_inv[3][3] = {0}

Definition at line 73 of file eff_scheduling_rotwing_nB.c.

◆ manual_pitch

bool manual_pitch = false

Definition at line 67 of file eff_scheduling_rotwing_nB.c.

◆ manual_roll

bool manual_roll = false

Definition at line 66 of file eff_scheduling_rotwing_nB.c.

◆ manual_yaw

bool manual_yaw = false

Definition at line 68 of file eff_scheduling_rotwing_nB.c.

◆ phi_filt

Butterworth2LowPass phi_filt
static

Definition at line 80 of file eff_scheduling_rotwing_nB.c.

◆ psi_filt

Butterworth2LowPass psi_filt
static

Definition at line 82 of file eff_scheduling_rotwing_nB.c.

◆ roll_eff

float roll_eff = 8.9

Definition at line 88 of file eff_scheduling_rotwing_nB.c.

◆ RW

struct RW_Model RW

Definition at line 92 of file eff_scheduling_rotwing_nB.c.

◆ sim_time

float sim_time = 0.0f
static

Definition at line 459 of file eff_scheduling_rotwing_nB.c.

Referenced by eff_scheduling_rotwing_update_airspeed().

◆ skew_filt

◆ skew_meas

float skew_meas = 0.0

◆ temp_mQ_k

float temp_mQ_k = 1.37

Definition at line 95 of file eff_scheduling_rotwing_nB.c.

◆ theta_filt

Butterworth2LowPass theta_filt
static

Definition at line 81 of file eff_scheduling_rotwing_nB.c.

◆ thrust_curve

int thrust_curve = 1.0

Definition at line 94 of file eff_scheduling_rotwing_nB.c.

◆ wing_position_ev

abi_event wing_position_ev
static

Definition at line 114 of file eff_scheduling_rotwing_nB.c.

◆ yaw_eff

float yaw_eff = 0.237

Definition at line 89 of file eff_scheduling_rotwing_nB.c.