Good algorithm for when to trust GPS speed and course?
December 12, 2010
In my testing so far, GPS modules that are locked in do a much better job in motion than sitting still. If I ride a bike down the street with a GPS, it will capture my route almost perfectly until I stop and then it gets "fidgety" and will jump around. Some modules do a better job of staying nearly fixed, but I haven't had any that were perfect. The location data is still reasonably valid, but the implied motion throws off the speed and course reporting drastically. I need to come up with an algorithm to know when to ignore it but I need to start using it as soon as it is valid. I am doing course correction.
I could use 2 GPS modules in my craft and assume I am moving and tracking well if they stay in line with each other, but that seems like overkill and would introduce a delay, having to wait for sentences from 2 GPSes, correlate them and report it (I think I would end up using a dedicated controller for that and have it communicate the result to the main one).
The obvious simple software solution is to only use it when the current reading and the previous 2 are in a line or low angle with the previous one near the midpoint. But that would cause me to ignore it during acceleration and/or tight turns. In all likelihood, the acceleration or turning will have been caused by the controller, so I may be able to work that into the test but it can get som complicated that I could have trouble keeping up.
Thoughts or better yet experiences welcome...