Skip to content

Commit

Permalink
MC gyro cutoffs - Reduce IMU_GYRO_CUTOFF to 30Hz and disable MC_DTERM…
Browse files Browse the repository at this point in the history
…_CUTOFF.

A low gyro cutoff is needed for most medium/large size drones as the structural natural and blade-pass frequencies are low.
A higher value is still desirable for small platforms surch as racers
or well isolated autopilots and should be tuned by the user.
Specific values for config files are untouched.
The cutoff filter for the D term is disabled here as the required
cutoff frequency for the default D term of the rate controller is higher
than the gyro cutoff. In that case, enabling the D term cutoff would
just add some undesired phase lag to the derivative.
  • Loading branch information
bresch committed May 3, 2019
1 parent 2971989 commit ea0b0d7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/modules/mc_att_control/mc_att_control_params.c
Expand Up @@ -538,6 +538,8 @@ PARAM_DEFINE_FLOAT(MC_TPA_RATE_D, 0.0f);
* The D-term uses the derivative of the rate and thus is the most susceptible to noise.
* Therefore, using a D-term filter allows to decrease the driver-level filtering, which
* leads to reduced control latency and permits to increase the P gains.
* A good rule of thumb is to fix the time constant of this filter equal to one tenth of the
* derivative time constant: MC_DTERM_CUTOFF = 10 * MC_(ROLL|PITCH)RATE_P / (2 * pi * MC_(ROLL|PITCH)RATE_D)
* A value of 0 disables the filter.
*
* @unit Hz
Expand All @@ -547,7 +549,7 @@ PARAM_DEFINE_FLOAT(MC_TPA_RATE_D, 0.0f);
* @increment 10
* @group Multicopter Attitude Control
*/
PARAM_DEFINE_FLOAT(MC_DTERM_CUTOFF, 30.f);
PARAM_DEFINE_FLOAT(MC_DTERM_CUTOFF, 0.f);

/**
* Multicopter air-mode
Expand Down
2 changes: 1 addition & 1 deletion src/modules/sensors/sensor_params.c
Expand Up @@ -220,7 +220,7 @@ PARAM_DEFINE_INT32(SENS_EN_THERMAL, -1);
* @reboot_required true
* @group Sensors
*/
PARAM_DEFINE_FLOAT(IMU_GYRO_CUTOFF, 80.0f);
PARAM_DEFINE_FLOAT(IMU_GYRO_CUTOFF, 30.0f);

/**
* Driver level cutoff frequency for accel
Expand Down

0 comments on commit ea0b0d7

Please sign in to comment.