Journey

 

Introduction to the Kalman Filter

Introduction to the Kalman Filter
Submitted by Brian Douglas on 11/06/2020
Explanation 13 resources
Last Edited: 11/01/2024

If you've heard of the Kalman filter before but haven't had a chance to understand what it is, how it helps us solve state estimation problems, or how to implement one yourself, then this is the journey for you.  It is broken up into several sections: 

  1. Prerequisites - the information you might need before starting this journey
  2. Introduce the basic concepts - an overview of the filter with minimal mathematics
  3. Watch others use it - Check out the Kalman filter in action on other people's projects
  4. Try it yourself - A few different ways to implement and test the filter on your own
  5. Fundamentals - A more mathematically rigorous approach to the filter
  6. Other variations - Looking at the EKF, UKF, and expanding into the particle filter
  7. Other material - Things to check out if you're interested in exploring some more

 

Prerequisites: It might be helpful to start with a really big picture look at sensor fusion so that you have a better understanding of why it's important to learn the Kalman filter.  If you're already motivated to learn and have a basic understanding of sensor fusion then you can absolutely skip this video without getting confused later on.

Prerequisites: If you haven't had much experience with state space representation, you may want to brush up on the basics with this resource.  Again, you can skip this if you just want to get to the Kalman filter without having to watch a bunch of videos first!

Introduce the basic concept: Let's begin with a gentle introduction to the Kalman filter.  This article doesn't provide a rigorous explanation, but I think it'll help you form a basic understanding of what the Kalman filter is and how it can estimate state given a set of noisy sensors and a flawed model of the system.

Introduce the basic concept: I find that sometimes you need to read the same information from two different people in order for it to really stick in your mind. So, if you're still struggling with understanding how multiplying all of these different matrices can produce an optimal state estimate, check out this article by Tim Babb.  If you feel that you have a pretty good handle on it from the last resource then you can skip this, however, I recommend you check it out at least for the amazing visuals!

Watch others use it - Joe Barnard builds some incredible thrust vector controlled model rockets and he uses a Kalman filter to estimate the kinematic state of the rockets (position, velocity, orientation).  In this video, he's describing the components of the flight computer. The whole thing is worth a watch but check out 13:50-14:35 to understand how the Kalman filter contributes to the overall design.

The AVA Flight Computer

Joe Barnard - BPS Space
18 min
Beginner
Video
Application

This video describes the board design, hardware architecture, and software components of the All Vehicle Avionics (AVA) flight computer that was designed by Joe Barnard of BPS Space.  This...

See More

Watch others use it - If you watched the above video, check out this one where Joe shows the results of flying Sprint (with the Kalman filter).  At about 5:50 he describes some of the telemetry he receives from the rocket and starting at about 7:50 he describes the output of the Kalman filter.  

Try it yourself: Probably the best way to have all of this sink in is to play around with the algorithm yourself.  If you have access to MATLAB and Simulink, this model allows you to tweak the parameters of a Kalman filter and watch how it impacts the estimation.

Try it yourself: This is another example that is good if you have access to MATLAB and the Control System Toolbox.  This example walks through designing your own filter.

Try it yourself: If you're looking to implement an extended Kalman filter (EKF) on an Arduino or other microcontroller, check out TinyEKF.

Fundamentals: Now that we have the basic idea of the Kalman filter, I think we're more prepared to dive deeper into the mathematics. 

Other variations of estimation filters: With an understanding of how the basic Kalman filter can be used to estimate state, we can start to look at other forms of estimation filters.  This article does a great job building up intuition around the extended Kalman filter, the sigma-point filter, and the particle filter.  Don't pass on this resource - at least read the introduction where he talks about how we use more information than just direct measurements to estimate state.  Worth a read!

Other variations of estimation filters: Check out this video if you want to see how some state estimation problems are inherantly non-Gaussian and, therefore, not suitable for a Kalman filter. 

Other material: If you want to go back to where this all started you can read R.E. Kalman's original paper.