With upcoming Betaflight 3.2, we will be given a new, outstanding, new feature: dynamic filtering. An belive me, it was worth waiting for Betaflight 3.2 only to get it. I do not care much about other changes that happened with version 3.2 but dynamic filtering it the thing! In this post I will explain, in simple words, what is dynamic filtering and how to enable it.

The problem of noise

Gyro has a nasty tendency to pick up a lot of noise. Vibrations. After all, there are a lot of things that can vibrate (motors, propellers) and resonate (frame). Without a good way to filter all that noise out, our racers would not fly as good as they fly now. And you would be replacing motors and ESCs even more often. I you want to know more about gyro noise sources and filtering, please watch my Gyroscope and filtering series on YouTube.

If not, here is a short summary.

  1. Gyroscope noise appears at different frequencies. Some of them are caused by motors, some by propellers and some by a thing called "harmonic frequencies". Simplified spectrum (freqency domain) graph of gyro trace in one axis might look like this Betaflight gyro noise spectrum
  2. If "noise" frequencies would be allowed to enter PID controller, they would result in bad performance, oscillations or even smoked/overheated motors and burned ESCs
  3. Betafligh (and INAV and Cleanflight) applies series of filters to attenuate "noise frequencies"
  4. Low Pass Filters (LPF) attenuates frequencies above cutoff frequency
  5. Notch Filters attenuate frequencies in a given band
  6. All those filters are applied in following order:
    1. Gyroscope internal LPF, usually set to OFF/256Hz
    2. Gyro notch filter #1
    3. Gyro notch filter #2
    4. Gyro LPF

Betaflight gyro noise spectrum and filters

In theory this should be enough. And usually is. But not always, since:

  1. "Noise" frequencies differs with builds, propellers, weights
  2. Notch filters are narrow banded and to be effective they have to be tuned
  3. Noise frequencies differs with flying style, speed or in general terms: throttle position. Notch filter tuned at 60% throttle will not be effective when flying at 85% throttle

And because of point 3, static filtering stack is almost never as effective as it could be. This is why Betaflight 3.2 introduced Dynamic Filtering

Betaflight dynamic filter

Dynamic filter does two things:

  1. Analyzes gyroscope data and tries to find peak noise frequency in real time. As you fly. You throttle up, throttle down, noise peak moves, no problem. Analysis locates the strongest noise peak. For the ones who wants to know more, read about Fast Fourier Transform and frequency domain
  2. Additional notch filter is applied just after gyroscope internal LPF. This notch filter, its notch and cutoff frequencies are updated based on data obtained from signal analysis. This way, the filter is always tuned in to your flying style

How to enable dynamic filtering

To enable dynamic filter:

  1. Flash and install Betaflight 3.2 and latest Configurator
  2. Open Betaflight Configurator
  3. Goto CLI tab and type feature DYNAMIC_FILTER and then save

This is all. No other steps are required. The only thing you should do is to disable gyro notch 1 and gyro notch 2. They should be obsolete now with dynamic filter in place. But do it in a smart way. Disable first notch, fly for a minute, land and check motors. If they are not overheating, disable next notch, fly again and check motors one more time.

If motors are not overheating, notch 1 and notch 2 can stay disabled. If they are overheating, you probably have big vibration problems...