Paparazzi UAS  v5.8.2_stable-0-g6260b7c
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
stabilization_attitude_quat_indi.c File Reference

MAVLab Delft University of Technology This control algorithm is Incremental Nonlinear Dynamic Inversion (INDI) More...

+ Include dependency graph for stabilization_attitude_quat_indi.c:

Go to the source code of this file.

Macros

#define INDI_EST_SCALE   0.001
 
#define STABILIZATION_INDI_FILT_OMEGA   50.0
 
#define STABILIZATION_INDI_FILT_ZETA   0.55
 
#define STABILIZATION_INDI_FILT_OMEGA2   (STABILIZATION_INDI_FILT_OMEGA*STABILIZATION_INDI_FILT_OMEGA)
 
#define STABILIZATION_INDI_FILT_OMEGA_R   STABILIZATION_INDI_FILT_OMEGA
 
#define STABILIZATION_INDI_FILT_ZETA_R   STABILIZATION_INDI_FILT_ZETA
 
#define STABILIZATION_INDI_FILT_OMEGA2_R   (STABILIZATION_INDI_FILT_OMEGA_R*STABILIZATION_INDI_FILT_OMEGA_R)
 

Functions

void stabilization_attitude_init (void)
 
void stabilization_attitude_enter (void)
 
void stabilization_attitude_set_failsafe_setpoint (void)
 
void stabilization_attitude_set_rpy_setpoint_i (struct Int32Eulers *rpy)
 
void stabilization_attitude_set_earth_cmd_i (struct Int32Vect2 *cmd, int32_t heading)
 
static void attitude_run_indi (int32_t indi_commands[], struct Int32Quat *att_err, bool_t in_flight)
 
void stabilization_attitude_run (bool_t enable_integrator)
 
void stabilization_attitude_read_rc (bool_t in_flight, bool_t in_carefree, bool_t coordinated_turn)
 
void stabilization_indi_second_order_filter (struct FloatRates *input, struct FloatRates *filter_ddx, struct FloatRates *filter_dx, struct FloatRates *filter_x, float omega, float zeta, float omega_r)
 
void lms_estimation (void)
 

Variables

int32_t stabilization_att_indi_cmd [COMMANDS_NB]
 
struct FloatRates g1 = {STABILIZATION_INDI_G1_P, STABILIZATION_INDI_G1_Q, STABILIZATION_INDI_G1_R}
 
float g2 = STABILIZATION_INDI_G2_R
 
struct ReferenceSystem reference_acceleration
 
struct IndiVariables indi
 
struct Int32Eulers stab_att_sp_euler
 with INT32_ANGLE_FRAC More...
 
struct Int32Quat stab_att_sp_quat
 with INT32_QUAT_FRAC More...
 
struct FloatRates filtered_rate_estimation = {0., 0., 0.}
 
struct FloatRates filtered_rate_deriv_estimation = {0., 0., 0.}
 
struct FloatRates filtered_rate_2deriv_estimation = {0., 0., 0.}
 
struct FloatRates indi_u_estimation = {0., 0., 0.}
 
struct FloatRates udot_estimation = {0., 0., 0.}
 
struct FloatRates udotdot_estimation = {0., 0., 0.}
 
struct FloatRates g_est = {STABILIZATION_INDI_G1_P / INDI_EST_SCALE, STABILIZATION_INDI_G1_Q / INDI_EST_SCALE, STABILIZATION_INDI_G1_R / INDI_EST_SCALE}
 
float g2_est = STABILIZATION_INDI_G2_R / INDI_EST_SCALE
 
float mu = STABILIZATION_INDI_ADAPTIVE_MU
 
bool_t use_adaptive_indi = FALSE
 

Detailed Description

MAVLab Delft University of Technology This control algorithm is Incremental Nonlinear Dynamic Inversion (INDI)

This is a simplified implementation of the (soon to be) publication in the journal of Control Guidance and Dynamics: Adaptive Incremental Nonlinear Dynamic Inversion for Attitude Control of Micro Aerial Vehicles

Definition in file stabilization_attitude_quat_indi.c.

Macro Definition Documentation

#define INDI_EST_SCALE   0.001

Definition at line 79 of file stabilization_attitude_quat_indi.c.

Referenced by lms_estimation().

#define STABILIZATION_INDI_FILT_OMEGA   50.0
#define STABILIZATION_INDI_FILT_OMEGA2   (STABILIZATION_INDI_FILT_OMEGA*STABILIZATION_INDI_FILT_OMEGA)

Definition at line 99 of file stabilization_attitude_quat_indi.c.

#define STABILIZATION_INDI_FILT_OMEGA2_R   (STABILIZATION_INDI_FILT_OMEGA_R*STABILIZATION_INDI_FILT_OMEGA_R)

Definition at line 106 of file stabilization_attitude_quat_indi.c.

#define STABILIZATION_INDI_FILT_OMEGA_R   STABILIZATION_INDI_FILT_OMEGA
#define STABILIZATION_INDI_FILT_ZETA   0.55
#define STABILIZATION_INDI_FILT_ZETA_R   STABILIZATION_INDI_FILT_ZETA

Definition at line 103 of file stabilization_attitude_quat_indi.c.

Function Documentation

void lms_estimation ( void  )

Definition at line 324 of file stabilization_attitude_quat_indi.c.

References g2, g2_est, INDI_EST_SCALE, mu, FloatRates::p, PERIODIC_FREQUENCY, FloatRates::q, FloatRates::r, stabilization_indi_second_order_filter(), stateGetBodyRates_f(), IndiVariables::u_act_dyn, and use_adaptive_indi.

Referenced by attitude_run_indi().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void stabilization_attitude_init ( void  )

Definition at line 132 of file stabilization_attitude_quat_indi.c.

References DefaultPeriodic, and register_periodic_telemetry().

+ Here is the call graph for this function:

void stabilization_attitude_read_rc ( bool_t  in_flight,
bool_t  in_carefree,
bool_t  coordinated_turn 
)
void stabilization_attitude_set_earth_cmd_i ( struct Int32Vect2 cmd,
int32_t  heading 
)
void stabilization_attitude_set_failsafe_setpoint ( void  )
void stabilization_attitude_set_rpy_setpoint_i ( struct Int32Eulers rpy)

Definition at line 169 of file stabilization_attitude_quat_indi.c.

References int32_quat_of_eulers(), stab_att_sp_euler, and stab_att_sp_quat.

+ Here is the call graph for this function:

void stabilization_indi_second_order_filter ( struct FloatRates input,
struct FloatRates filter_ddx,
struct FloatRates filter_dx,
struct FloatRates filter_x,
float  omega,
float  zeta,
float  omega_r 
)

Definition at line 309 of file stabilization_attitude_quat_indi.c.

References float_rates_integrate_fi(), omega_r, FloatRates::p, PERIODIC_FREQUENCY, FloatRates::q, and FloatRates::r.

Referenced by attitude_run_indi(), lms_estimation(), and stabilization_attitude_run().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

struct FloatRates filtered_rate_2deriv_estimation = {0., 0., 0.}

Definition at line 75 of file stabilization_attitude_quat_indi.c.

struct FloatRates filtered_rate_deriv_estimation = {0., 0., 0.}

Definition at line 74 of file stabilization_attitude_quat_indi.c.

struct FloatRates filtered_rate_estimation = {0., 0., 0.}

Definition at line 73 of file stabilization_attitude_quat_indi.c.

struct FloatRates g1 = {STABILIZATION_INDI_G1_P, STABILIZATION_INDI_G1_Q, STABILIZATION_INDI_G1_R}

Definition at line 46 of file stabilization_attitude_quat_indi.c.

Referenced by gain_scheduling_periodic().

float g2 = STABILIZATION_INDI_G2_R
float g2_est = STABILIZATION_INDI_G2_R / INDI_EST_SCALE

Definition at line 81 of file stabilization_attitude_quat_indi.c.

Referenced by lms_estimation().

struct FloatRates g_est = {STABILIZATION_INDI_G1_P / INDI_EST_SCALE, STABILIZATION_INDI_G1_Q / INDI_EST_SCALE, STABILIZATION_INDI_G1_R / INDI_EST_SCALE}

Definition at line 80 of file stabilization_attitude_quat_indi.c.

struct IndiVariables indi
Initial value:
= {
{0., 0., 0.},
{0., 0., 0.},
{0., 0., 0.},
{0., 0., 0.},
{0., 0., 0.},
{0., 0., 0.},
{0., 0., 0.},
{0., 0., 0.},
{0., 0., 0.},
{0., 0., 0.}
}

Definition at line 56 of file stabilization_attitude_quat_indi.c.

struct FloatRates indi_u_estimation = {0., 0., 0.}

Definition at line 76 of file stabilization_attitude_quat_indi.c.

float mu = STABILIZATION_INDI_ADAPTIVE_MU

Definition at line 82 of file stabilization_attitude_quat_indi.c.

Referenced by lms_estimation().

struct ReferenceSystem reference_acceleration
Initial value:
= {STABILIZATION_INDI_REF_ERR_P,
STABILIZATION_INDI_REF_ERR_Q,
STABILIZATION_INDI_REF_ERR_R,
STABILIZATION_INDI_REF_RATE_P,
STABILIZATION_INDI_REF_RATE_Q,
STABILIZATION_INDI_REF_RATE_R,
}

Definition at line 48 of file stabilization_attitude_quat_indi.c.

int32_t stabilization_att_indi_cmd[COMMANDS_NB]

Definition at line 44 of file stabilization_attitude_quat_indi.c.

Referenced by stabilization_attitude_run().

struct FloatRates udot_estimation = {0., 0., 0.}

Definition at line 77 of file stabilization_attitude_quat_indi.c.

struct FloatRates udotdot_estimation = {0., 0., 0.}

Definition at line 78 of file stabilization_attitude_quat_indi.c.

bool_t use_adaptive_indi = FALSE

Definition at line 88 of file stabilization_attitude_quat_indi.c.

Referenced by lms_estimation().