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.
- 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
- 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
- Betafligh (and INAV and Cleanflight) applies series of filters to attenuate "noise frequencies"
- Low Pass Filters (LPF) attenuates frequencies above cutoff frequency
- Notch Filters attenuate frequencies in a given band
- All those filters are applied in following order:
- Gyroscope internal LPF, usually set to OFF/256Hz
- Gyro notch filter #1
- Gyro notch filter #2
- Gyro LPF
In theory this should be enough. And usually is. But not always, since:
- "Noise" frequencies differs with builds, propellers, weights
- Notch filters are narrow banded and to be effective they have to be tuned
- 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:
- 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
- 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:
- Flash and install Betaflight 3.2 and latest Configurator
- Open Betaflight Configurator
- Goto CLI tab and type
feature DYNAMIC_FILTER
and thensave
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...
I'm Paweł Spychalski and I do things. Mainly software development, FPV drones and amateur cinematography. Here are my YouTube channels: