15 Comments
Apr 3, 2023Liked by Jacob Bayless

Hey Jacob!! I was scouring the internet for this exact article, and lo-and-behold it's written by the legend I used to work with (you derived a lead-lag controller on a whiteboard when I was a co-op student off the top of your head). Thank you for the awesome read. I was thinking of trying to replace a low-pass butterworth filter with a kalman filter in a system with no known inputs but lots of disturbances and measurement noise, just like the example you chose. The discrete math is going over my head for now, I've been relying on diagrams and python state space / simulation libraries to give me my answers so far, but will be implementing it in a more real-time fashion soon and will definitely be referencing your article!

Expand full comment
Jul 30, 2022·edited Jul 30, 2022Liked by Jacob Bayless

Good series of articles.

In recent years, Ive moved from Kalman to Sav Golay filters, which in many circumstances work as well but are computationally much simpler. They also have a few additional 'tricks' such as providing the first & second differential signal.

We use such filters in motion control applications.

Expand full comment
Jul 29, 2022Liked by Jacob Bayless

In practical terms, I find often that when trying to optimise control for a particular piece of equipment that often the best estimate you have of performance over the next x periods is a moving average of that last 5-20x periods.

This gives you a known near to exact correct state. Then you trim this with your choice of predictive controller.

Expand full comment

I wonder what the simplest example would be of a system where a Kalman filter is worthwhile? When do we know that a fixed filter isn't good enough?

Expand full comment

Hi Jacob,

I really like your writing and technical analysis. I found my way here via HN linking your "right half plane zeroes" post. To be honest, none of the mathematics landed with me, never having studied control theory and not having even attempted to work my way through your post, but the 40% or so that I grokked was quite interesting.

I'm a software developer with a wide variety of technical interests that definitely includes control theory. Who doesn't love inverted pendulum and PID controllers? I'm 20 years outside my CS degree and only discovered PID about 5-6 years ago. Basically, I'm at the level of, positive feedback bad, negative feedback good.

Anyway, I recently published a PID implementation, mainly as an exercise and also because I needed one for a different project. https://github.com/rickhull/device_control

I thought you might find it interesting, mainly for pedagogical purposes, and I'd be very receptive to any feedback you have, positive or negative, heh.

I'm still trying to wrap my head around Kalman filter, and that might be the next thing I tackle. I'm hoping it's relatively tractable like PID in terms of software implementation. I pored over the dang PID wikipedia article multiple times, and it always seemed way more complicated to understand or suggest an implementation, compared to the rather simple implementation I landed on.

Expand full comment