1
\$\begingroup\$

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)

enter image description here

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

enter image description here

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

enter image description here

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

enter image description here

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)

enter image description here

\$\endgroup\$
2
  • \$\begingroup\$ @user263983 the tilt angle is calculated without any movement, so only the earth gravity is tken into account during calibration and measurements \$\endgroup\$
    – JCSB
    Commented Apr 9, 2021 at 17:51
  • \$\begingroup\$ 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. \$\endgroup\$
    – tomnexus
    Commented Apr 9, 2021 at 18:40

2 Answers 2

2
\$\begingroup\$

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).

\$\endgroup\$
7
  • \$\begingroup\$ 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% \$\endgroup\$
    – JCSB
    Commented Apr 9, 2021 at 17:48
  • \$\begingroup\$ Presumably because it was calibrated out at +90°. \$\endgroup\$ Commented Apr 9, 2021 at 17:52
  • \$\begingroup\$ 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) \$\endgroup\$
    – JCSB
    Commented Apr 9, 2021 at 17:54
  • \$\begingroup\$ Is the voltage at -1G equal to - 1.00000 * the voltage at +1G? Is the axis misalignment accounted for? \$\endgroup\$ Commented Apr 9, 2021 at 18:21
  • 1
    \$\begingroup\$ sin^-1(272/274) = 83° \$\endgroup\$ Commented Apr 9, 2021 at 18:55
0
\$\begingroup\$

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.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.