# How to calibrate Accelerometer sensor physically?

I am having a development kit DK20948 that is a 9 axis IMU sensor on it.

and to use it I am using SmartMotion eMD Page number 47, when using the CLI tool, I am getting data of the sensors and an accuracy flag, where accuracy is rated between 0-3, 0 is lowest.

I have tried to test the accuracy flag with Magnetometer by calibrating is by moving the development kit in an '8' motion. Before calibrating, my data was kinda gibberish but after calibrating, I am getting the reading in 2% compared to my phone's sensor and the accuracy flag goes from 0 to 3. So I believe accuracy flag represents kind of calibration.

I want to calibrate the same for accelerometer. I know software technique of putting it on a levelled surface and averaging it. But is there any phyical method in which I can calibrate it? I couldn't find anything reliable on google except someone's thesis where they put it on a linear actuator and fire it. I highly doubt the approach because not everyone has linear actuator lying around.

• Down is 1-g. It's a very convenient calibration signal – Scott Seidman Oct 5 '18 at 13:46

You could try putting it at the end of an arm connected to a low rpm motor and rotating the arm at a known rate to provide a known acceleration force. You would need to be able to change the orientation of the accelerometer and take into account Earths gravity in addition to the force from the rotation

If you want to calibrate without special equipment, you can do it if you are willing to employ some mathematical gymnastics. For this example, we are going to assume that the accelerometer is linear but you can put linearity correction terms or as many correction coefficients as you like, at the cost of more complexity.

For these equations, We will call the actual acceleration X, Y, and Z, and the uncorrected accelerometer readings are Ax, Ay, and Az. If you assume that the accelerometer is linear and that its error is mostly due to offset and gain (reasonable for a first approach) then you could get the true reading of the accelerometer by applying a slope-intercept approach. Each accelerometer would have a slope constant, which we will call Mx, My and Mz, and an offset constant, which we will call Bx, By and Bz. So the true acceleration in the x direction can be stated X = (Mx)*(Ax) + Bx.

You now only have to determine the values for Mx, My, Mz, Bx, By, and Bz to apply to the raw readings. Take advantage of the fact that the earth's gravity is an acceleration of 1 g, so from Pythagoras we know that X^2 + Y^2 + Z^2 = (1G)^2. But X^2 = [(Mx)*(Ax) + Bx]^2 or Mx^2*Ax^2 + 2*Mx*Ax + Bx^2. So you have [Mx^2*Ax^2 + 2*Mx*Ax + Bx^2] + [My^2*Ay^2 + 2*My*Ay + By^2] + [Mz^2*Az^2 + 2*Mz*Az + Bz^2] = 1G^2.

You have an equation with six unknowns (Mx, My, Mz, Bx, By, and Bz). By rotating the device (and keeping it still) to six different orientations, you will have six different sets of values for Ax, Ay, and Az. Do the math and solve for your correction constants, then check in other orientations by applying the correction to Ax, Ay, and Az. The sum of the squares after correction should always be 1G^2.

If you want to put in more correction variables (for temperature or linearity, etc) you can, and the number of simultaneous equations will increase.

Good luck!