# Combining “real world” coordinates, and “personal” acceleration to get “real world” velocity

I'm working on a mobile phone app idea the moment.

This app is currently being prototype on a Windows Phone 7 device.

The Motion API on that device gives me frequent updates on :

• the current 3 dimensional acceleration vector (with gravity removed) of the phone (with axes fixed as the axes of the phone)
• the current direction that gravity is (using those same phone axes)

I'm thinking about how to estimate the actual velocity and position of the phone, assuming that the phone started from a "stationary" position.

I'm currently trying to do this by rotatomg the acceleration vector (using the gravity vector somehow) so that it's in real world coordinates, and then I'm thinking of using simple integration over time in order to estimate current 3D velocity, and then another integration to get to current 3D position.

Should this approach work? Does anyone have any suggestions about where I should look for primers on the vector/matrix maths required?

Thanks

Stuart

-

The approach should work, but the challenge is drift due to errors. If the acceleration is off by a small constant amount, the error in position will grow quadratically with time. Also how the the phone know which direction is vertical so it can subtract gravity? Say you have $0.1 g$ acceleration in the $x$ direction. The sensor will see about $1.005 g$ in the $xz$ plane, but there are other directions for $x, z$ that produce the same reading. Presumably it is from angular accelerometers in the phone, which will also have drift. The usual approach is to have actual measurements of position and angle periodically to update and get rid of the drift terms. Do you have position available as well? You can make some improvement by measuring the output when the device is motionless (sitting on a table) and subtracting the drift, but maybe it does that already for you.