CLI RPM Filter - rotorflight/rotorflight GitHub Wiki

:exclamation: This page is outdated

Rotorflight Wiki is replaced by www.rotorflight.org.


The RPM-filter is a feature in the gyro filtering framework that uses the motor RPM information to identify and filter out vibrations that are coming from the rotating parts in a helicopter, i.e. motor, main rotor, tail rotor. Notch filters are automatically configured for each estimated vibration frequency and the it's harmonics. This allows less overall low-pass filtering on the gyro signal, as the notch filters are surgically removing the peaks only on the actual vibration frequencies.

The Rotorflight RPM-filter is based on the BetaFlight RPM-filter, but is more versatile and configurable.

The RPM-filter requires motor speed information to be available in the flight controller. There are three ways for obtaining it. One of these must be first configured and available.

  • Dshot bidirectional RPM telemetry
  • Frequency sensor
  • ESC telemetry

Configuration

The RPM-filter can be turned ON with the feature flag: feature RPM_FILTER

There are 16 notch filter banks, each of which can be separately configured to filter out one frequency peak. Each filter bank has it's own

  • RPM source (motor index)
  • RPM / frequency ratio
  • Q-value
  • Min frequency
  • Max frequency

The CLI settings are the following. Each settings contains 16 values, one for each filter bank, respectively.

set gyro_rpm_filter_bank_motor_index = 1,1,...
set gyro_rpm_filter_bank_gear_ratio = 1000,500,...
set gyro_rpm_filter_bank_filter_q = 250,250,...
set gyro_rpm_filter_bank_min_hz = 20,20,...
set gyro_rpm_filter_bank_max_hz = 1000,1000,...

motor_index selects which motor the RPM information is obtained from. Value 0 disables the bank. Usually 1 is main motor (M1), and 2 is tail motor (M2).

gear_ratio defines the speed/frequency ratio between the RPM source and the peak frequency (x1000). For example, Trex-450 with 14T pinion and 150T main gear would be 150/14*1000 = 10714. Likewise, the main rotor second harmonic would be 150/14*1000/2 = 5357, etc. This allows arbitrary combinations of harmonics or sub-harmonics.

filter_q selects the Q-value for the notch filter (x100). Typically 150..300.

min_hz sets the minimum allowed frequency for the bank.

max_hz sets the maximum allowed frequency for the bank.

Filter Configurator Spreadsheet

There is a Google Spreadsheet for auto-generating the filter configuration. You need to take a private copy of it before you can use it.

Typical configurations

Minor vibrations

A well build heli would usually have very minor vibrations. It should be enough to filter out the main rotor fundamental and its three harmonics, the tail motor fundamental and the second harmonic, and the brushless motor fundamental frequency(ies).

Using the Trex-450 example above, the config would look like this:

set gyro_rpm_filter_bank_motor_index = 1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0
set gyro_rpm_filter_bank_gear_ratio = 10083,5042,3361,2521,4240,2120,1000,0,0,0,0,0,0,0,0,0
set gyro_rpm_filter_bank_notch_q = 200,200,200,200,200,200,200,0,0,0,0,0,0,0,0,0
set gyro_rpm_filter_bank_min_hz = 33,67,100,133,141,283,336,0,0,0,0,0,0,0,0,0

There are 7 filter banks in use. Four for main rotor, two for tail rotor, and one for motor.

Medium vibrations

An older heli with worn out bearings (or bad build!) may have more vibrations. The frequency band could also be wider. It would help to have a dual notch on the main rotor fundamental and second harmonic (at least). It also helps to set the dual notches somewhat apart, e.g. +-1%. If this is still not enough, lowering the Q-value is an options, but it will increase the filter delay!

A config could look like this:

set gyro_rpm_filter_bank_motor_index = 1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0
set gyro_rpm_filter_bank_gear_ratio  = 11424,11655,5712,5828,3846,2885,2721,1361,1000,0,0,0,0,0,0
set gyro_rpm_filter_bank_notch_q     = 200,200,200,200,150,150,150,150,150,0,0,0,0,0,0,0

Strong vibrations

The best thing to do is to fix your heli first.