|
Paparazzi UAS v7.1_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_common_int.h"#include "firmwares/rotorcraft/stabilization/stabilization_attitude_ref_quat_int.h"#include "math/wls/wls_alloc.h"Go to the source code of this file.
Data Structures | |
| struct | Indi_gains |
Macros | |
| #define | INDI_G_SCALING 1000.0 |
Functions | |
| void | stabilization_indi_get_actuator_state (void) |
| Function that tries to get actuator feedback. | |
| void | stabilization_indi_commit_actuator_cmd (int32_t *cmd) |
| void | stabilization_indi_init (void) |
| Function that initializes important values upon engaging INDI. | |
| void | stabilization_indi_enter (void) |
| Function that resets important values upon engaging INDI. | |
| void | stabilization_indi_rate_run (bool in_flight, struct StabilizationSetpoint *rate_sp, struct ThrustSetpoint *thrust, int32_t *cmd) |
| Does the INDI calculations. | |
| void | stabilization_indi_attitude_run (bool in_flight, struct StabilizationSetpoint *att_sp, struct ThrustSetpoint *thrust, int32_t *cmd) |
| runs stabilization indi | |
| void | stabilization_indi_set_wls_settings (void) |
| Function that sets the u_min, u_max and u_pref if function not elsewhere defined. | |
| void | stabilization_indi_update_filt_freq (float freq) |
| struct FloatRates | stabilization_indi_attitude_controller (struct FloatQuat att, struct FloatQuat att_sp, struct FloatRates rates_ff) |
| Default PD angular rate controller. | |
| struct FloatRates | stabilization_indi_rate_controller (struct FloatRates rates, struct FloatRates sp) |
| Default PD angular acceleration controller. | |
| float * | stabilization_indi_get_act_state (void) |
| float * | stabilization_indi_get_act_dyn (void) |
| float * | stabilization_indi_get_indi_u (void) |
| bool * | stabilization_indi_get_act_is_thruster_z (void) |
| int32_t | stabilization_indi_get_num_thrusters (void) |
| uint8_t * | stabilization_indi_get_act_to_commands (void) |
Variables | |
| float | g1g2 [INDI_OUTPUTS][INDI_NUM_ACT] |
| float | actuator_state_filt_vect [INDI_NUM_ACT] |
| struct FloatVect3 | stab_thrust_filt |
| int16_t | actuators_pprz [INDI_NUM_ACT+1] |
| PPRZ command to each actuator Can be used to directly control actuators from the control algorithm if the command_laws are set up appropriately in the airframe file. | |
| bool | act_is_servo [INDI_NUM_ACT] |
| bool | indi_use_adaptive |
| float * | Bwls [INDI_OUTPUTS] |
| float | thrust_bx_eff |
| float | thrust_bx_act_dyn |
| float | actuator_thrust_bx_pprz |
| float | thrust_bx_state_filt |
| float | act_pref [INDI_NUM_ACT] |
| float | stablization_indi_yaw_dist_limit |
| struct Indi_gains | indi_gains |
| float | stabilization_indi_filter_freq |
| struct WLS_t | wls_stab_p |
| struct Indi_gains |
Definition at line 58 of file stabilization_indi.h.
| Data Fields | ||
|---|---|---|
| struct FloatRates | att | |
| struct FloatRates | rate | |
| #define INDI_G_SCALING 1000.0 |
Definition at line 31 of file stabilization_indi.h.
Referenced by ctrl_eff_scheduling_init(), eff_scheduling_cyfoam_init(), eff_scheduling_cyfoam_periodic(), eff_scheduling_falcon_init(), eff_scheduling_generic_init(), stabilization_indi_rate_run(), and sum_g1_g2().
|
extern |
Default PD angular rate controller.
Takes the current attitude filtered state and setpoint and compute the desired rates. Can be redefined elsewhere to use an other control scheme.
Default PD angular rate controller.
Takes the current attitude filtered state and setpoint and compute the desired rates. Can be redefined elsewhere to use an other control scheme.
Definition at line 846 of file stabilization_indi.c.
References Ap, att_state, autopilot_in_flight(), Bp, Cp, Dp, float_quat_inv_comp_norm_shortest(), float_quat_tilt_twist(), FLOAT_RATES_ZERO, indi_gains, FloatRates::p, FloatRates::q, FloatQuat::qx, FloatQuat::qy, FloatQuat::qz, FloatRates::r, RATES_ADD, stabilization_indi_attitude_controller(), FloatVect3::x, FloatVect3::y, and FloatVect3::z.
Referenced by stabilization_indi_attitude_controller(), and stabilization_indi_attitude_run().
|
extern |
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 824 of file stabilization_indi.c.
|
extern |
Definition at line 1205 of file stabilization_indi.c.
References act_thrust_mat, actuator_state, actuators_pprz, indi_u, num_thrusters, stabilization_indi_get_act_is_thruster_z(), stabilization_indi_get_act_state(), stabilization_indi_get_act_to_commands(), stabilization_indi_get_indi_u(), stabilization_indi_get_num_thrusters(), and u_squared_to_pprz_cmd().
Referenced by stabilization_indi_rate_run().
|
extern |
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 498 of file stabilization_indi.c.
| float * stabilization_indi_get_act_dyn | ( | void | ) |
Definition at line 1228 of file stabilization_indi.c.
References act_dyn_discrete.
Referenced by stabilization_indi_get_actuator_state().
| bool * stabilization_indi_get_act_is_thruster_z | ( | void | ) |
Definition at line 1236 of file stabilization_indi.c.
References act_thrust_mat.
Referenced by stabilization_indi_commit_actuator_cmd().
| float * stabilization_indi_get_act_state | ( | void | ) |
Definition at line 1224 of file stabilization_indi.c.
References actuator_state.
Referenced by stabilization_indi_commit_actuator_cmd(), and stabilization_indi_get_actuator_state().
| uint8_t * stabilization_indi_get_act_to_commands | ( | void | ) |
Definition at line 1245 of file stabilization_indi.c.
Referenced by stabilization_indi_commit_actuator_cmd().
|
extern |
Function that tries to get actuator feedback.
If this is not available it will use a first order filter to approximate the actuator state. It is also possible to model rate limits (unit: PPRZ/loop cycle)
Definition at line 925 of file stabilization_indi.c.
References act_dyn_discrete, act_obs, actuator_state, float_vect_copy(), indi_u, pprz_cmd_to_u_squared(), stabilization_indi_get_act_dyn(), stabilization_indi_get_act_state(), stabilization_indi_get_indi_u(), u_squared_to_pprz_cmd(), and UNUSED.
Referenced by stabilization_indi_rate_run().
| float * stabilization_indi_get_indi_u | ( | void | ) |
Definition at line 1232 of file stabilization_indi.c.
References indi_u.
Referenced by stabilization_indi_commit_actuator_cmd(), and stabilization_indi_get_actuator_state().
| int32_t stabilization_indi_get_num_thrusters | ( | void | ) |
Definition at line 1240 of file stabilization_indi.c.
References num_thrusters.
Referenced by stabilization_indi_commit_actuator_cmd().
|
extern |
Function that initializes important values upon engaging INDI.
Definition at line 423 of file stabilization_indi.c.
|
extern |
Default PD angular acceleration controller.
Takes the current rates filtered state and setpoint and compute the desired acceleration. Can be redefined elsewhere to use an other control scheme.
Default PD angular acceleration controller.
Takes the current rates filtered state and setpoint and compute the desired acceleration.
Definition at line 880 of file stabilization_indi.c.
References Ad, autopilot_in_flight(), Bd, Cd, Dd, FLOAT_RATES_ZERO, indi_gains, FloatRates::p, FloatRates::q, FloatRates::r, rate_state, RATES_DIFF, and stabilization_indi_rate_controller().
Referenced by stabilization_indi_rate_controller(), and stabilization_indi_rate_run().
|
extern |
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 603 of file stabilization_indi.c.
|
extern |
Function that sets the u_min, u_max and u_pref if function not elsewhere defined.
Definition at line 894 of file stabilization_indi.c.
References act_is_servo, act_pref, actuator_state_filt_vect, actuators_pprz, CMH_ACT_MOTOR_LEFT, CMH_ACT_MOTOR_RIGHT, CMH_ACT_MOTOR_TAIL, CMH_ACT_YAW, CMH_MOTOR_IDLE, CMH_TILT_DIFF_MAX, eff_sched_p, eff_sched_pusher_time, electrical, guidance_h, GUIDANCE_H_MODE_HOVER, GUIDANCE_H_MODE_NAV, MAX_PPRZ, Min, rw_flap_offset, STABILIZATION_INDI_THROTTLE_LIMIT_AIRSPEED_FWD, stateGetAirspeed_f(), and wls_stab_p.
Referenced by stabilization_indi_rate_run().
|
extern |
Definition at line 504 of file stabilization_indi.c.
References init_butterworth_2_low_pass(), init_first_order_low_pass(), p, rates_filt_fo, stabilization_indi_filter_freq, and stateGetBodyRates_f().
|
extern |
Definition at line 204 of file stabilization_indi.c.
Referenced by ground_detect_periodic(), stabilization_indi_init(), stabilization_indi_rate_run(), and stabilization_indi_set_wls_settings().
|
extern |
Definition at line 167 of file stabilization_indi.c.
Referenced by ctrl_eff_scheduling_periodic(), and stabilization_indi_set_wls_settings().
|
extern |
Definition at line 239 of file stabilization_indi.c.
Referenced by eff_scheduling_cyfoam_periodic(), eff_scheduling_periodic_b(), eff_scheduling_rotwing_update_cmd(), eff_scheduling_rotwing_update_hover_motor_effectiveness(), ground_detect_periodic(), guidance_indi_hybrid_set_wls_settings(), stabilization_indi_init(), stabilization_indi_rate_run(), and stabilization_indi_set_wls_settings().
|
extern |
|
extern |
PPRZ command to each actuator Can be used to directly control actuators from the control algorithm if the command_laws are set up appropriately in the airframe file.
FIXME add an extra slot for specific case (e.g. rotwing in simulation)
Definition at line 313 of file stabilization_indi.c.
Referenced by actuators_hitl_periodic(), control_mixing_heewing_attitude_direct(), control_mixing_heewing_attitude_plane(), control_mixing_heewing_nav_run(), ekf_aw_wrapper_fetch(), nps_autopilot_run_step(), rotwing_state_periodic(), schdule_control_effectiveness(), stabilization_indi_commit_actuator_cmd(), and stabilization_indi_set_wls_settings().
|
extern |
Definition at line 172 of file stabilization_indi.c.
Referenced by eff_scheduling_cyfoam_periodic(), stabilization_indi_init(), and stabilization_indi_rate_run().
|
extern |
Definition at line 306 of file stabilization_indi.c.
Referenced by eff_scheduling_falcon_init(), eff_scheduling_falcon_periodic(), eff_scheduling_falcon_report(), eff_scheduling_generic_periodic(), eff_scheduling_periodic_a(), eff_scheduling_periodic_b(), eff_scheduling_rotwing_update_aileron_effectiveness(), eff_scheduling_rotwing_update_elevator_effectiveness(), eff_scheduling_rotwing_update_flaperon_effectiveness(), eff_scheduling_rotwing_update_hover_motor_effectiveness(), eff_scheduling_rotwing_update_pusher_effectiveness(), eff_scheduling_rotwing_update_rudder_effectiveness(), ground_detect_periodic(), guidance_indi_hybrid_set_wls_settings(), guidance_indi_run(), schdule_control_effectiveness(), send_eff_mat_g_indi(), stabilization_indi_init(), and sum_g1_g2().
|
extern |
Definition at line 184 of file stabilization_indi.c.
Referenced by eff_scheduling_periodic_b(), stabilization_indi_attitude_controller(), and stabilization_indi_rate_controller().
|
extern |
Definition at line 197 of file stabilization_indi.c.
Referenced by stabilization_indi_rate_run().
|
extern |
Definition at line 245 of file stabilization_indi.c.
Referenced by guidance_indi_calcG(), guidance_indi_set_wls_settings(), and stabilization_indi_rate_run().
|
extern |
Definition at line 250 of file stabilization_indi.c.
Referenced by stabilization_indi_update_filt_freq().
|
extern |
Definition at line 236 of file stabilization_indi.c.
Referenced by stabilization_indi_rate_run().
|
extern |
|
extern |
|
extern |
|
extern |
Definition at line 326 of file stabilization_andi.c.
Referenced by schdule_control_effectiveness(), send_wls_u_stab(), send_wls_v_stab(), send_wls_v_stabilization_andi(), stabilization_andi_run(), stabilization_indi_rate_run(), and stabilization_indi_set_wls_settings().