Betaflight 3.2 Dynamic Filtering Explained

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…

3 thoughts to “Betaflight 3.2 Dynamic Filtering Explained”

  1. I like what this post is trying to do, and the writing style is superb. I don’t want to be harsh, but what I don’t like is that the post seems to miss the true point of the dynamic filtering.

    Which is: Dynamic filtering allows for more effective filtering, with less signal distortion and delay.

    Although you later on do explain (in the how to) that you can (and should) disable the ‘old’ filters you never mention why.

    Let me elaborate:
    What used to be three wide band notch filters (notch1, notch2 and d-term notch) can now be reduced to one narrow band filter.

    The wider the notch band, the more the signal gets distorted (even far, far beyond the notch bandwidth). And the more notch filters the more delay you have on the signal.

    Signal distortion and delay isn’t mentioned in this article at all and is a huge factor in flight characteristics (especially turbulance/propwash handling)

    Hope to read more of your articles. Although I have some criticism on this article I really like the blog.

  2. This really is such a wonderful resource that youre offering and you give it away for free. I adore seeing internet sites that understand the worth of offering a top quality useful resource for free. It?s the outdated what goes around comes around routine.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.