Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
stabilization_indi_simple.h File Reference
+ Include dependency graph for stabilization_indi_simple.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  Indi_gains
 
struct  IndiEstimation
 
struct  IndiVariables
 

Functions

void stabilization_indi_init (void)
 Function that initializes important values upon engaging INDI. More...
 
void stabilization_indi_enter (void)
 Function that resets important values upon engaging INDI. More...
 
void stabilization_indi_rate_run (bool in_flight, struct StabilizationSetpoint *rate_sp, struct ThrustSetpoint *thrust, int32_t *cmd)
 Does the INDI calculations. More...
 
void stabilization_indi_attitude_run (bool in_flight, struct StabilizationSetpoint *att_sp, struct ThrustSetpoint *thrust, int32_t *cmd)
 runs stabilization indi More...
 
void stabilization_indi_simple_reset_r_filter_cutoff (float new_cutoff)
 

Variables

struct IndiVariables indi
 

Data Structure Documentation

◆ Indi_gains

struct Indi_gains

Definition at line 49 of file stabilization_indi.h.

+ Collaboration diagram for Indi_gains:
Data Fields
struct FloatRates att
struct FloatRates rate

◆ IndiEstimation

struct IndiEstimation

Definition at line 47 of file stabilization_indi_simple.h.

+ Collaboration diagram for IndiEstimation:
Data Fields
struct FloatRates g1
float g2
float mu
Butterworth2LowPass rate[3]
float rate_d[3]
float rate_dd[3]
Butterworth2LowPass u[3]
float u_d[3]
float u_dd[3]

◆ IndiVariables

struct IndiVariables

Definition at line 59 of file stabilization_indi_simple.h.

+ Collaboration diagram for IndiVariables:
Data Fields
struct FloatRates act_dyn
bool adaptive Enable adataptive estimation.
struct FloatRates angular_accel_ref
float attitude_max_yaw_rate Maximum yaw rate in atttiude control in rad/s.
float cutoff_r
struct FloatRates du
struct IndiEstimation est Estimation parameters for adaptive INDI.
struct FloatRates g1
float g2
struct Indi_gains gains
float max_rate Maximum rate in rate control in rad/s.
Butterworth2LowPass rate[3]
float rate_d[3]
Butterworth2LowPass u[3]
struct FloatRates u_act_dyn
struct FloatRates u_in

Function Documentation

◆ stabilization_indi_attitude_run()

void stabilization_indi_attitude_run ( bool  in_flight,
struct StabilizationSetpoint att_sp,
struct ThrustSetpoint thrust,
int32_t cmd 
)

runs stabilization indi

Parameters
in_flightenable integrator only in flight
att_spattitude stabilization setpoint
thrustthrust setpoint
[out]outputcommand vector

Function that should be called to run the INDI controller

Parameters
in_flightnot used
rate_controlrate control enabled, otherwise attitude control

Definition at line 765 of file stabilization_indi.c.

References angular_rate_ref, Indi_gains::att, float_quat_inv_comp_norm_shortest(), float_quat_tilt_twist(), IndiVariables::gains, indi, indi_gains, FloatRates::p, FloatRates::q, FloatQuat::qx, FloatQuat::qy, FloatQuat::qz, FloatRates::r, Indi_gains::rate, RATES_ADD, StabilizationSetpoint::sp, stab_att_sp_euler, stab_att_sp_quat, stab_sp_from_rates_f(), stab_sp_to_eulers_i(), stab_sp_to_quat_f(), stab_sp_to_quat_i(), stab_sp_to_rates_f(), stabilization_indi_rate_run(), stateGetNedToBodyQuat_f(), FloatVect3::x, FloatVect3::y, and FloatVect3::z.

Referenced by stabilization_attitude_run().

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

◆ stabilization_indi_enter()

void stabilization_indi_enter ( void  )

Function that resets important values upon engaging INDI.

Don't reset inputs and filters, because it is unlikely to switch stabilization in flight, and there are multiple modes that use (the same) stabilization. Resetting the controller is not so nice when you are flying. FIXME: Ideally we should detect when coming from something that is not INDI

Definition at line 445 of file stabilization_indi.c.

References IndiVariables::angular_accel_ref, ddu_estimation, du_estimation, FLOAT_RATES_ZERO, float_vect_zero(), indi, indi_init_filters(), Int32Eulers::psi, stab_att_sp_euler, stabilization_attitude_get_heading_i(), IndiVariables::u_act_dyn, and IndiVariables::u_in.

Referenced by stabilization_attitude_enter(), and stabilization_rate_enter().

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

◆ stabilization_indi_init()

◆ stabilization_indi_rate_run()

void stabilization_indi_rate_run ( bool  in_flight,
struct StabilizationSetpoint sp,
struct ThrustSetpoint thrust,
int32_t cmd 
)

Does the INDI calculations.

Parameters
in_flightboolean that states if the UAV is in flight or not
sprate setpoint
thrustthrust setpoint
cmdoutput command array

Function that calculates the INDI commands

Parameters
in_flighttrue aircraft is flying
sprate setpoint
thrustthrust setpoint
cmdoutput command array

Definition at line 520 of file stabilization_indi.c.

References acceleration_body_x_filter, ACCELS_FLOAT_OF_BFP, IndiVariables::act_dyn, actuator_lowpass_filters, actuator_state, actuator_state_filt_vect, actuator_state_filt_vectd, actuator_state_filt_vectdd, angular_accel_ref, IndiVariables::angular_accel_ref, angular_acceleration, IndiVariables::attitude_max_yaw_rate, body_accel_f, Bwls, IndiVariables::du, estimation_input_lowpass_filters, estimation_output_lowpass_filters, estimation_rate_d, estimation_rate_dd, filter_pqr(), finite_difference_from_filter(), float_mat_vect_mul(), FLOAT_RATES_ZERO, float_vect_diff(), float_vect_dot_product(), float_vect_zero(), IndiVariables::g1, g2, IndiVariables::g2, IndiVariables::gains, get_actuator_state(), indi, INDI_G_SCALING, indi_gains, lms_estimation(), MAX_PPRZ, measurement_lowpass_filters, SecondOrderLowPass::o, FloatRates::p, FloatRates::q, FloatRates::r, Indi_gains::rate, IndiVariables::rate, IndiVariables::rate_d, rates_filt_fo, stab_sp_to_rates_f(), stablization_indi_yaw_dist_limit, stateGetAccelBody_i(), stateGetBodyRates_f(), th_sp_to_thrust_i(), THRUST_AXIS_Z, IndiVariables::u, IndiVariables::u_act_dyn, IndiVariables::u_in, update_butterworth_2_low_pass(), update_first_order_low_pass(), and FloatVect3::x.

Referenced by stabilization_indi_attitude_run(), and stabilization_rate_read_rc().

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

◆ stabilization_indi_simple_reset_r_filter_cutoff()

void stabilization_indi_simple_reset_r_filter_cutoff ( float  new_cutoff)

Definition at line 243 of file stabilization_indi_simple.c.

References IndiVariables::cutoff_r, indi, init_first_order_low_pass(), rates_filt_fo, and stateGetBodyRates_f().

+ Here is the call graph for this function:

Variable Documentation

◆ indi