RC input: allow disabling the RC filtering via RC_FLT_CUTOFF

The default value of 10 Hz adds noticeable lag.
This commit is contained in:
Beat Küng
2018-02-19 09:29:46 -05:00
committed by Daniel Agar
parent 8fc659dcb2
commit 8d9e9d3a7b
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -368,7 +368,7 @@ int update_parameters(const ParameterHandles &parameter_handles, Parameters &par
parameters.rc_flt_smp_rate = math::max(1.0f, parameters.rc_flt_smp_rate);
param_get(parameter_handles.rc_flt_cutoff, &(parameters.rc_flt_cutoff));
/* make sure the filter is in its stable region -> fc < fs/2 */
parameters.rc_flt_cutoff = math::constrain(parameters.rc_flt_cutoff, 0.1f, (parameters.rc_flt_smp_rate / 2) - 1.f);
parameters.rc_flt_cutoff = math::min(parameters.rc_flt_cutoff, (parameters.rc_flt_smp_rate / 2) - 1.f);
/* Airspeed offset */
param_get(parameter_handles.diff_pres_offset_pa, &(parameters.diff_pres_offset_pa));
+2 -1
View File
@@ -2214,8 +2214,9 @@ PARAM_DEFINE_FLOAT(RC_FLT_SMP_RATE, 50.0f);
* Cutoff frequency for the low pass filter on roll, pitch, yaw and throttle
*
* Does not get set unless below RC_FLT_SMP_RATE/2 because of filter instability characteristics.
* Set to 0 to disable the filter.
*
* @min 0.1
* @min 0
* @unit Hz
* @group Radio Calibration
*/