Browse Source

RC input: allow disabling the RC filtering via RC_FLT_CUTOFF

The default value of 10 Hz adds noticeable lag.
sbg
Beat Küng 7 years ago committed by Daniel Agar
parent
commit
8d9e9d3a7b
  1. 2
      src/modules/sensors/parameters.cpp
  2. 3
      src/modules/sensors/rc_params.c

2
src/modules/sensors/parameters.cpp

@ -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); 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)); param_get(parameter_handles.rc_flt_cutoff, &(parameters.rc_flt_cutoff));
/* make sure the filter is in its stable region -> fc < fs/2 */ /* 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 */ /* Airspeed offset */
param_get(parameter_handles.diff_pres_offset_pa, &(parameters.diff_pres_offset_pa)); param_get(parameter_handles.diff_pres_offset_pa, &(parameters.diff_pres_offset_pa));

3
src/modules/sensors/rc_params.c

@ -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 * 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. * 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 * @unit Hz
* @group Radio Calibration * @group Radio Calibration
*/ */

Loading…
Cancel
Save