# Getting Accurate Velocity Readings From IMU

Hi I am currently using a BNO055 for a design project. This sensor outputs a linear acceleration vector corresponding to three (xyz) directions. I am trying to "integrate" the acceleration to get a speed the object it is mounted to is traveling. I noticed early on that in my speed graph there is large amounts of drift. I was looking for any guidance someone might have for tuning out the drift some way or filtering options I could use for acceleration data to reduce the drift

The process of integrating acceleration to derive velocity and integrating velocity to derive position are commonly known as dead reckoning. In this link it is stated:

Dead reckoning is subject to cumulative errors. Advances in navigational aids that give accurate information on position, in particular satellite navigation using the Global Positioning System, have made simple dead reckoning by humans obsolete for most purposes.

It may help to calibrate each of the 3 accelerometers using Earth's gravity as a constant. Test if each accelerometer is symmetrical providing the same absolute values when pointed toward the Earth as when pointed away from the Earth. If any are not symmetric calculate an appropriate offset. Next compare the range of each of the 3 accelerometers. If they are not the same calculate an appropriate magnitude correction factor for maximum and minimum accelerometer ranges.

To find the offset and range correction values look at page 26 of the BNO055 specification sheet. There you will find a picture of the BNO055 chip which relates to the direction of the X, Y and Z accelerometers. Position the chip such that the X accelerometer is pointed downwards toward the earth. Record the raw value. Now repeat the measurement with the X accelerometer pointing away from the earth. The absolute value of these two measurements should be the same. If not, determine the offset needed to correct X accelerometer measurements and incorporate that value into your program. Repeat this for the Y and Z vectors.

Now compare the maximum - minimum values for the X, Y and Z accelerometers. These 3 values should be the same. If not, find a value to multiply the smallest of the three such that it matches the middle value and incorporate that value into your program. Repeat this for the largest of the three values.

It is desired all 3 accelerometers work the same. If they do not, using the values derived above should adjust the raw values such as the result appears as 3 nearly identical accelerometers.

That said, most accelerometers are very usable with no correction factors. And it is expected any correction factors to be small. However, as experienced, when integrating, small errors can accumulate quickly.

Next consider the application in which dead reckoning is to be used. There may be clues as to the velocity at a given moment which, if used, can reset the assumed velocity to a known value. For example, if the accelerometer were attached to a runner's foot, it can be assumed the velocity is zero for each foot to ground impact detected.

• How would I find the ranges for the accelerometers? – Jonathan Seffinga Nov 17 '20 at 16:34
• I added a procedure to the answer. – st2000 Nov 18 '20 at 4:03