mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-09 22:49:53 +08:00
Solve wing vibration of the 25kg rotating wing drone (#3311)
* configurable filter frequency rates * adjust filter freq tested in CZ 70 deg skew --------- Co-authored-by: Ewoud Smeur <e.j.j.smeur@tudelft.nl>
This commit is contained in:
@@ -446,9 +446,9 @@
|
||||
|
||||
<!-- Filters -->
|
||||
<define name="FILTER_RATES_SECOND_ORDER" value="FALSE" />
|
||||
<define name="FILT_CUTOFF_P" value="5.0"/>
|
||||
<define name="FILT_CUTOFF_Q" value="5.0"/>
|
||||
<define name="FILT_CUTOFF_R" value="5.0"/>
|
||||
<define name="FILT_CUTOFF_P" value="3.0"/>
|
||||
<define name="FILT_CUTOFF_Q" value="3.0"/>
|
||||
<define name="FILT_CUTOFF_R" value="3.0"/>
|
||||
<define name="FILT_CUTOFF" value="2.0"/>
|
||||
<define name="ESTIMATION_FILT_CUTOFF" value="2.0"/>
|
||||
<define name="FILTER_YAW_RATE" value="TRUE"/>
|
||||
|
||||
@@ -62,6 +62,7 @@
|
||||
<dl_setting var="indi_gains.rate.r" min="0.1" step="0.1" max="100" shortname="kd_r" param="STABILIZATION_INDI_REF_RATE_P"/>
|
||||
<dl_setting var="indi_use_adaptive" min="0" step="1" max="1" shortname="use_adaptive" values="FALSE|TRUE" param="STABILIZATION_INDI_USE_ADAPTIVE" type="uint8"/>
|
||||
<dl_setting var="stablization_indi_yaw_dist_limit" min="0" step=".01" max="10.0" shortname="lim_yaw_spec_moment" param="STABILIZATION_INDI_YAW_DISTURBANCE_LIMIT"/>
|
||||
<dl_setting MAX="50." MIN="1." STEP="0.1" VAR="stabilization_indi_filter_freq" shortname="filt_freq" module="stabilization/stabilization_indi" handler="update_filt_freq"/>
|
||||
</dl_settings>
|
||||
</dl_settings>
|
||||
</settings>
|
||||
|
||||
@@ -217,6 +217,8 @@ float rate_vect_prev[3] = {0., 0., 0.};
|
||||
float q_filt = 0.0;
|
||||
float r_filt = 0.0;
|
||||
|
||||
float stabilization_indi_filter_freq = 20.0; //Hz, for setting handler
|
||||
|
||||
// variables needed for estimation
|
||||
float g1g2_trans_mult[INDI_OUTPUTS][INDI_OUTPUTS];
|
||||
float g1g2inv[INDI_OUTPUTS][INDI_OUTPUTS];
|
||||
@@ -441,6 +443,16 @@ void stabilization_indi_enter(void)
|
||||
float_vect_zero(ddu_estimation, INDI_NUM_ACT);
|
||||
}
|
||||
|
||||
void stabilization_indi_update_filt_freq(float freq)
|
||||
{
|
||||
stabilization_indi_filter_freq = freq;
|
||||
float tau = 1.0 / (2.0 * M_PI * freq);
|
||||
float sample_time = 1.0 / PERIODIC_FREQUENCY;
|
||||
init_first_order_low_pass(&rates_filt_fo[0], tau, sample_time, stateGetBodyRates_f()->p);
|
||||
init_first_order_low_pass(&rates_filt_fo[1], tau, sample_time, stateGetBodyRates_f()->q);
|
||||
init_first_order_low_pass(&rates_filt_fo[2], tau, sample_time, stateGetBodyRates_f()->r);
|
||||
}
|
||||
|
||||
/**
|
||||
* Function that resets the filters to zeros
|
||||
*/
|
||||
|
||||
@@ -59,12 +59,14 @@ struct Indi_gains {
|
||||
extern float stablization_indi_yaw_dist_limit;
|
||||
|
||||
extern struct Indi_gains indi_gains;
|
||||
extern float stabilization_indi_filter_freq; //for setting handler
|
||||
|
||||
extern void stabilization_indi_init(void);
|
||||
extern void stabilization_indi_enter(void);
|
||||
extern void stabilization_indi_rate_run(bool in_flight, struct StabilizationSetpoint *rate_sp, struct ThrustSetpoint *thrust, int32_t *cmd);
|
||||
extern void stabilization_indi_attitude_run(bool in_flight, struct StabilizationSetpoint *att_sp, struct ThrustSetpoint *thrust, int32_t *cmd);
|
||||
extern void stabilization_indi_set_wls_settings(void);
|
||||
extern void stabilization_indi_update_filt_freq(float freq); // setting handler
|
||||
|
||||
#endif /* STABILIZATION_INDI */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user