Paparazzi UAS
v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
#include "firmwares/rotorcraft/stabilization.h"
#include "firmwares/rotorcraft/stabilization/stabilization_attitude.h"
#include "firmwares/rotorcraft/stabilization/stabilization_attitude_ref_quat_int.h"
#include "filters/low_pass_filter.h"
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 |
struct Indi_gains |
Definition at line 49 of file stabilization_indi.h.
Data Fields | ||
---|---|---|
struct FloatRates | att | |
struct FloatRates | rate |
struct IndiEstimation |
Definition at line 47 of file stabilization_indi_simple.h.
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] |
struct IndiVariables |
Definition at line 59 of file stabilization_indi_simple.h.
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 |
void stabilization_indi_attitude_run | ( | bool | in_flight, |
struct StabilizationSetpoint * | att_sp, | ||
struct ThrustSetpoint * | thrust, | ||
int32_t * | cmd | ||
) |
runs stabilization indi
in_flight | enable integrator only in flight | |
att_sp | attitude stabilization setpoint | |
thrust | thrust setpoint | |
[out] | output | command vector |
Function that should be called to run the INDI controller
in_flight | not used |
rate_control | rate 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().
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().
void stabilization_indi_init | ( | void | ) |
Function that initializes important values upon engaging INDI.
Definition at line 369 of file stabilization_indi.c.
References IndiVariables::act_dyn, act_dyn_discrete, act_feedback_cb(), act_feedback_ev, act_first_order_cutoff, act_is_servo, act_is_thruster_x, act_is_thruster_z, actuator_state_filt_vect, actuator_state_filt_vectd, actuator_state_filt_vectdd, Bwls, DefaultPeriodic, estimation_rate_d, estimation_rate_dd, float_vect_copy(), float_vect_zero(), g1, g1_est, g1_init, g1g2, g2, g2_est, g2_init, indi, indi_init_filters(), init_filters(), num_thrusters, num_thrusters_x, FloatRates::p, FloatRates::q, FloatRates::r, register_periodic_telemetry(), send_ahrs_ref_quat(), send_att_full_indi(), send_att_indi(), send_eff_mat_g_indi(), send_eff_mat_g_indi_simple(), send_wls_u_stab(), send_wls_v_stab(), and sum_g1_g2().
void stabilization_indi_rate_run | ( | bool | in_flight, |
struct StabilizationSetpoint * | sp, | ||
struct ThrustSetpoint * | thrust, | ||
int32_t * | cmd | ||
) |
Does the INDI calculations.
in_flight | boolean that states if the UAV is in flight or not |
sp | rate setpoint |
thrust | thrust setpoint |
cmd | output command array |
Function that calculates the INDI commands
in_flight | true aircraft is flying |
sp | rate setpoint |
thrust | thrust setpoint |
cmd | output 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().
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().
|
extern |
Definition at line 104 of file stabilization_indi_simple.c.
Referenced by ctrl_eff_scheduling_periodic(), indi_init_filters(), lms_estimation(), send_att_indi(), send_eff_mat_g_indi_simple(), stabilization_indi_attitude_run(), stabilization_indi_enter(), stabilization_indi_init(), stabilization_indi_rate_run(), and stabilization_indi_simple_reset_r_filter_cutoff().