## Accelerometer math

Hello, I have an Ocean server 4000 compass/accelerometer, and I am trying to use it to gauge the position of a robot on which it is placed. I get Ax, Ay, Az, pitch, roll, and heading as the output currently. I also have the accelerometer set to do a moving average of 16 readings. I did a simple experiment where I moved the robot forward in roughly the direction and stopped it. When I calculate the velocity straight from the Ax readings, the velocity doesn't end at 0 like it should (I brought the robot to stop for several seconds at the end). Furthermore the resting Ax at the start is different then at the end. The pitch has also changed though. In fact, the Ax values followed the pitch very well. I think there must be a relation to get the true x value given the two. I have tried Ax-pitch, Ax+pitch, Ax-sin(pitch), Ax+sin(pitch), √(Ax^2-sin(pitch)^2), however non of these gives me a velocity of close to 0 at the end. Can you help me out?

Thanks,
Eric
 PhysOrg.com physics news on PhysOrg.com >> Study provides better understanding of water's freezing behavior at nanoscale>> Soft matter offers new ways to study how ordered materials arrange themselves>> Making quantum encryption practical
 Recognitions: Science Advisor Yes, if angle readings change throughout, you have to take it into account. There is no simple formula, though. You need to convert Ax, Ay, Az in local coordinates to Ax, Ay, Az in "world" coordinates. The later can be arbitrary, but they need to be fixed. These two articles might help you get started. Euler Angles Rotation Matrix