Filtering - rotorflight/rotorflight GitHub Wiki

:exclamation: This page is outdated

Rotorflight Wiki is replaced by www.rotorflight.org.


Gyro filtering is even more important with helicopters than it is with multi-rotors, as the helicopter main rotor speed is much lower than the multi-rotor motor speed. Also, the vibrations are much stronger and on lower frequencies.

In addition, different size helicopters, e.g. a small 100-size vs. 700-size, have very different rotor speeds - up to 10x difference. This makes filtering difficult, as every setup has different kinds of vibrations.

Typical filter setup

Always use RPM based filters. They really help removing the rotor harmonics, without affecting other frequencies, or causing too much additional delay. There's a separate wiki page for details.

In addition, two lowpass filters (LPF) are needed for removing any residual high frequency noise.

A typical setup is to have one LPF somewhere around 60-150Hz and another one around 150-300Hz. A good starting point is BIQUADs at 100Hz and 250Hz.

Use PT1 filters only if the heli has really low vibrations - requires checking with blackbox.

Also, it's recommended to have an extra PT1 filter on thte D-term, typically at 100Hz.

Differences

The dynamic lowpass filters are also working differently. In Betaflight, the LPF cutoff frequency is adjusted with throttle. In Rotorflight, it is adjusted with headspeed, so that the filter's default cutoff frequency matches the governor maximum headspeed, and the lpf_min_hz and lpf_max_hz are simply setting limits how much the cutoff point can move around.

As a consequency, all three frequencies MUST BE defined, and the default cutoff must be between the min and max.

For example:

set gyro_lowpass_hz = 125
set gyro_dyn_lpf_min_hz = 25
set gyro_dyn_lpf_max_hz = 150

In Rotorflight, all filter parameters are global - rather than part of a PID profile.

Filter tuning

It's always better to have less filtering and thus less additional delay. But it is not possible to compromise - any unwannted vibrations entering the PID loop will cause much more damage than any extra delay ever would.

Please search YouTube for some excellent Betaflight videos about filter tuning.