Kalman Filters bring RaceFlight handling to Betaflight?

Kalyn Doerr, the original creator of RaceFlight, has been contributing code to the Betaflight project. Since Betaflight is open source, there's nothing unusual about it taking contributions from wherever. But given Raceflight's history of going closed-source specifically to avoid others "stealing" their ideas, the situation is at least a little bit noteworthy.

In a vibration-prone environment like a multirotor, filters are perhaps the single biggest contributor to good handling. Filters are mathematical algorithms that get rid of the frequencies we don't care about, so that the PID controller can focus only on the frequencies we do care about. Because the PID controller has to act in real-time, and has limited processing power, tradeoffs have to be made in what the filters do.

Kalman filtering is uniquely suited for multirotor use because it is designed specifically to deal with very noisy sensor data, such as occurs in a mini quad with motors screaming. They are capable of estimating the entire state of a system based on a few measurements. They also provide uncertainty metrics, so that more certain information can be weighted more heavily than less certain information. Kalman filters are also specifically designed to work in a real-time environment.

There is a lot more to this topic that I not only don't have the space to cover... I'm not even academically qualified to cover it. There are all kinds of arguments why 32 kHz sampling shouldn't actually be better than the 8 kHz sampling most of us are using now. There's an argument that multirotors are actually not well suited to Kalman filters because the motor noise is not Gaussian distribution. There is even an argument that what Kalyn's filter is doing actually isn't a full implementation of a Kalman filter, and misses out on Kalman magic.

The bottom line is this: lots of people feel that Raceflight flies awesome; and some people who have tried the pre-release version of Betaflight, say that Kalman filtering makes Betaflight fly awesome too.

So then, is the promise that Kalman filters will bring Raceflight's magic to Betaflight, allowing pilots to have the best of both worlds? It sure seems that way.

If you want to try out the pre-release version of Betaflight with Kalman filters built in, here's a link to show how to get it. But please be aware that this is not even alpha code. Anything could happen. When you install it, imagine that your quad went full throttle as soon as you plugged in the battery, and refused to failsafe or disarm. That probably won't happen, but if you imagine that it might, you'll be at the appropriate level of safety for using pre-alpha code.