# Why does an accelerometer have an offset error when at its +1G position when calculating tilt angle on single axis?

For my axis calibration, I find the slope with Vin values at 1 and -1 G positioning of the accelerometer relative to the axis I am interested in, using this formula (x is g and y is Vin values)

I then use this formula to find the tilt angle from my subsequent Vin readings

I find that I get a measurement of -90° at -1G, but an angle of 85° at +1G. Where does this error come from?

Edit: it is interesting to note how negative G direction has a much lower error percentage:

The calculations are as follow: calPG and calNG are the voltage read from the x axis at -90° and +90° Vin are the following V readings from the x axis, once slope was found G is gravity offset is optional, you can give it the value of angle measured at theoretical 0° (when the cube is placed so no acceleration is on x)

• @user263983 the tilt angle is calculated without any movement, so only the earth gravity is tken into account during calibration and measurements
– JCSB
Commented Apr 9, 2021 at 17:51
• For accurate tilt anywhere near +-90 you will need to use the Y accelerometer as well as the X, if you have one. Y is on the steepest part of its slope there. Commented Apr 9, 2021 at 18:40

A real accelerometer is going to have some nonlinearity and some offset error.

Because of how flat the sin function is near $$\\pi/2\$$, the difference between sin(85°) and sin(90°) is only 0.4%, so a measurement of 1.00V and -0.996V will represent that amount of error.

It's not unusual for inexpensive accelerometers to have a couple % of uncalibrated linearity error and some m$$\g\$$ of 0$$\g\$$ offset (that will also vary with temperature).

• Thanks! but why is this error only in one direction?? sin(-90) vs sin(-85) are also very close, yet the measurement outputs -90° with a significantly lower error%
– JCSB
Commented Apr 9, 2021 at 17:48
• Presumably because it was calibrated out at +90°. Commented Apr 9, 2021 at 17:52
• But I made sure I calibrated my slope from -1G and +1G Voltage inputs (the accelerometer is in a cube, so it was easy to measure V at 90 degree angles)
– JCSB
Commented Apr 9, 2021 at 17:54
• Is the voltage at -1G equal to - 1.00000 * the voltage at +1G? Is the axis misalignment accounted for? Commented Apr 9, 2021 at 18:21
• sin^-1(272/274) = 83° Commented Apr 9, 2021 at 18:55

If it is calibrated for null error at +-1 g why is there an error?

Possible Answer: calibration method error for gain and offset. Using only -1 g.