# How do I model a system to use with a Kalman Filter?

So I have an accelerometer, gyroscope, magnetometer and GPS. I would like to use a Kalman filter to optimally measure speed, position, acceleration and orientation. I have done research and I need to model the system mathematically, however this is the part I have got stuck on.

Can anyone give me some pointers on how to proceed here, do I need to try and model the system using differential equations and then derive the parameters for my $\mathbf A, \mathbf B$, and $\mathbf H$ matrices from there?

Any guidance would be great, thanks.

• Hi! The most reader friendly book, on the subject of Kalman filtering, I found is this: "Fundamentals of Kalman Filtering_Practical Approach_ZARCHAN". I do recommend this for any serious beginners. It's a real pseudo-practical book without theoretical hassles and with nice examples and all clear simulation results that help you verify your own code. Repeats itself over and over with detailed graphics that enables you to write and check your own Kalman filters... Then you may proceed by reading other materials as well, such as Modeling of Dynamical systems... Feb 16, 2017 at 12:41
• I suggest that you look at this video from Google tech talks that discusses using the sensors that you mentioned: (youtube.com/watch?v=C7JQ7Rpwn2k) In my opinion Interpreting the sensors data is not very straightforward. Feb 16, 2017 at 13:59
• This online book should help: github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python I think it is very practical and relatively easy to understand. If you are familiar with basics, you can skip initial parts. Part 7 and 8 are probably what you are looking for.
– cya
Mar 31, 2017 at 14:22
• The key is finding the right coordinate system, world or device, and defining all relations between the parameters. The easiest one being acceleration and position, any textbook on Kalman will show you that. For experimentation, and validation of the equations, it would be helpfull to have real sensor data. At least for Android phones, there are plenty of tools that log data to a file. Offline analysis in matlab or python gives you lots of plotting posibilities to test your equations. Jul 30, 2017 at 10:07