Managing Gyro Noise with the Static Notch and Dynamic Harmonic Notch Filters

As discussed under the Vibration Damping topic, managing vibration in ArduPilot autopilot installations is extremely important in order to yield predictable control of an aircraft. Typically installations utilize mechanical vibration damping for the autopilot, internally or externally, in order to remove the worst of the vibration. However, mechanical damping can only go so far and software filtering must be used to remove further noise.

To the autopilot, vibration noise looks like any other disturbance (e.g. wind, turbulence, control link slop, etc.) that the autopilot must compensate for in order to control the aircraft. This prevents optimum tuning of the attitude control loops and decreased performance.

For multicopters, virtually all vibrations originate from the motor’s rotational frequency. For helicopters and planes, the vibrations are linked to the main rotor/prop speed.

ArduPilot has support for two different types of notch filters - a single static notch filter that can be set at a fixed frequency and a dynamic harmonic notch filter that can be linked to the motor rotational frequency for multicopter motors or the rotor speed for helicopters and provides notches at the primary frequency and its harmonics.

The dynamic notch is enabled overall by setting INS_HNTCH_ENABLE = 1. After rebooting, all the relevant parameters will appear.

Key to the dynamic notch filter operation is control of its center frequency. There are five methods that can be used for doing this:

  1. INS_HNTCH_MODE = 0. Dynamic notch frequency control disabled. The center frequency is fixed and is static. Often used in Traditional Helicopters with external governors for rotor speed, either incorporated in the ESC or separate for ICE motors.
  2. INS_HNTCH_MODE = 1. (Default) Throttle position based, where the frequency at mid-throttle is determined by analysis of logs, and then variation of throttle position above this is used to track the increase in noise frequency.
  3. INS_HNTCH_MODE = 2. RPM sensor based, where an external RPM sensor is used to determine the motor frequency and hence primary vibration source’s frequency for the notch. Often used in Traditional Helicopters using the ArduPilot Head Speed Governor feature.
  4. INS_HNTCH_MODE = 3. ESC Telemetry based, where the ESC provides motor RPM information which is used to set the center frequency.
  5. INS_HNTCH_MODE = 4. In-Flight FFT, where a running FFT is done in flight to determine the primary noise frequency and adjust the notch’s center frequency to match. This probably the best mode if the autopilot is capable of running this feature. Currently, this is restricted to 2MB flash memory autopilots.

Setup Instructions

First you must select the mechanism used for controlling the harmonic notch frequency. By default (INS_HNTCH_MODE = 1) this mechanism is throttle-based since that will work on all Copters/QuadPlanes. However, a flight log analysis will be required to correlate the hover throttle position to the noise source’s frequency.

However, for Copters with an rpm sensor, BLHeli ESC telemetry support, or is capable of using In-Flight FFT control of center frequency, setup can be radically simpler by using direct RPM or center frequency sensing, which will not require log analysis to determine center frequency:

Then follow these additional instructions for the chosen center frequency control method:

Double-Notch

The software notch filters used are very “spikey” being relatively narrow but good at attenuation at their center. On larger copters the noise profile of the motors is quite dirty covering a broader range of frequencies than can be covered by a single notch filter. In order to address this situation it is possible to configure the harmonic notches as double notches that gives a wider spread of significant attenuation. To utilize this feature set INS_HNTCH_OPTS to “1”.

Note

Each notch has some CPU cost so if you configure both dynamic harmonics and double notches (INS_HNTCH_OPTS set to 3) you will end up with 8 notches on your aircraft per IMU. On flight controllers with 3 IMUs, this totals 24 notches which is computationally significant and could impact operation. For example, with F4 cpus with one IMU, using INS_GYRO_RATE =0 (1khz) this is safe, as is 3 IMUs running with fast sampling (INS_GYRO_RATE =1 (2khz) on H7 cpus.

Note also that with a double-notch the maximum attenuation is either side of the center frequency so on smaller aircraft with a very pronounced peak their use is usually counter productive.

Static Single Frequency Notch

In addition to the dynamic harmonic notch filter it is also possible to configure an additional, independent static notch filter. You might want to do this where you have significant frame or propeller resonance at a particular throttle value. Analysis is identical to that for the harmonic notch, but this time do the analysis after configuring the harmonic notch so that you can see any residual vibration.

  • Set INS_NOTCH_ENABLE = 1 to enable the static notch
  • Set INS_NOTCH_FREQ = resonant peak in Hz to set the notch center frequency
  • Set INS_NOTCH_BW = the notch bandwidth, a reasonable default is half of the center frequency
  • Set INS_NOTCH_ATT = the notch attenuation, higher attenuation will make the notch deeper and narrower