Close

Kalman Filters, and so on

A project log for Bike Computer with Flight Software

I want to track my bike rides and get some experience with CoreFlight

jacob-killeleaJacob Killelea 07/03/2019 at 20:240 Comments

I decided to start on testing the sensor algorithms. I chose a kalman filter to experiment with first, mostly because it can handle a wide variety of input, and there's lots of resources online. My state vector is currently just the measurements from the GPS.

I'm not including my actual filter computations because the current LaTeX embedding on this site is pretty janky and it was just too painful to try and write out the matrices and put them in the correct places. There's tons of resources online for kalman filters if people are curious. If they really want to look at what I'm doing, I'll try and post it.


I took my laptop for a walk around the block, with the GPS module attached to a CP2102 USB-Serial converter, recorded the data, and put my filter over it in Octave.

The result:


Oof. The blue line is the GPS track, and the red is the kalman filter. The filtered data is even worse than the raw data, but neither is great. That blue thing is supposed to be a diagonal rectangle in the shape of my block. I've got no idea what's going on with that big loop in the bottom. In real life, that's gotta be at least a hundred meters in  the wrong direction.

I decided to take velocity information out of the filter:


Quite a bit better, but now I'm ignoring information from the sensors just to get a prettier picture.

Discussions