# Is it possible to estimate linear displacement using accelerometer & gyroscope with the kinematic equations of motion?

I am trying to estimate linear displacement using a 9DOF inertial measurement unit.

My question is: After correcting the accelerometer readings using the gyroscope, is it possible to apply the accelerometer values in the following kinematic equation on small time frames where the acceleration can be considered uniform and then adding up the values of displacement to get an estimate of the total distance?

Kinematic equation:

By dividing the time in which the IMU moves from point A to point B into N number of windows of say, 10 milliseconds, then for each window $$D_{i} = vt + \frac{1}{2}at^{2},$$ where: $$D_{i}\rightarrow {\rm the\, distance\, covered\, in\, the\,} i{\rm th\, window}$$

$$v \rightarrow {\rm initial\, velocity\, of\, the\, IMU\, for\, the\,} i{\rm th\, window\, (assuming\,} v = 0\, {\rm for, simplicity)}$$

$$t\rightarrow {\rm duration\, of\, the\, window}$$

$$a\rightarrow\, {\rm average\, acceleration\, in\, the\, window}$$

Total distance travelled $$= D_{0}+D_{1}+D_{2}+\cdots+D_{N}$$

## migrated from stackoverflow.comMay 31 at 23:03

This question came from our site for professional and enthusiast programmers.

• How do you propose to correct the accelerometer readings with the gyroscopes? Those two sets of readings are independent. – TimWescott May 31 at 23:06
• The short answer is yes, this is how an IMU is used to figure out where you are. Basically, you do a double integration on acceleration to get displacement. – zeta-band May 31 at 23:12

It's more complicated than that, but yes, kinda.

You're reading accelerations and rotations in the body frame of reference; you need to turn these into IMU readings in some global frame of reference -- presumably an Earth-referenced frame, which takes into account the acceleration due to gravity.

As part of this translation, you need to know the local acceleration due to gravity pretty well, and you need to account for body rotations. You also need to know your starting orientation, position, and velocity.

So you need to take your starting orientation and integrate it into your point-by-point orientation; this is not trivial. There's three or four different ways to do it, each with their own downsides. I happen to like using quaternions because it makes the arithmetic easy at the expense of making the mathematics difficult, but other people (not excluding Lord Kelvin) detest them.

Then you need to use this orientation to determine the acceleration in an Earth-referenced frame. Then you can double-integrate the accelerations.

It gets tricky to estimate the error in the measurement, but at the very absolute best, and ignoring rotation (because it's hard and I'm lazy), the error after integrating acceleration into position over some time period $$t$$ will have a variance that's composed of

• The variance of the original position estimate.
• The variance of the original velocity estimate, times $$t$$.
• Something like the spectral density of the acceleration noise (as acceleration squared/Hz, again because I'm lazy) times 1/2 $$t^2$$

Note that the gyro noise adds in to this, not only because of orientation errors causing lateral motions to go into the wrong places, but because off-vertical orientation errors will work with the acceleration due to gravity to generate lateral acceleration errors.

This whole problem is covered under the subject "Strapdown inertial navigation", and there are entire books written about the subject. I suggest the one by Titterton.

Thanks TimWescott and zeta-band.

I will look up quaternions and check out how to translate the accelerometer readings into the earth's frame of reference. My plan is to avoid double integration by using the kinematic equations with the accelerometer measurements.