Monday, 31 October 2011

Error in accelerometer

A Repost of something I did while working on a project a while ago.... Throughout it might be of use to someone.
Today i wrote a fairly simple program to plot position from accelerometer values. It wasn’t too complicated, just a simple python program that reads accelerometer values from the 9DOF accelerometer package (relayed from the ardwino). The hardest part was stripping out the data i wanted from everything else the accelerometer outputs. I had to restart my computer manny manny times initially because i hadn’t figured out how to close the serial stream and for some reason if you close idle with the stream open the keyboard stops working…. I used two of the equations of motion, v2 = v1 + at and s2 = s1 + vt to convert from acceleration to velocity, then to time. There were other methods but this was the easiest to implement.
And what were the results? Not good…….
Here is a plot of acceleration, velocity and position (green, blue and red consecutively) in the x axis Vs. samples (25Hz)  for the acceleration sitting still. As can be seen the error in velocity isnt too bad, but error in position is an order of magnitude more (about 0.25m per second).
I had been hopping for something in the order of a few centimetres per second. This pretty much kills dead reckoning.

1 comment:

  1. Indeed, this is why everyone uses a combination of GPS and IMU. The IMU gives you high rate data, which you correct with low rate data from the GPS. In its simplest form you'd end up with a sawtooth for position as the GPS pushes it back 'home'; a more complex setup with Kalman filters can give clean continuous curves.

    A cheap IMU and a cheap GPS together are more accurate than even a very expensive IMU.