I am reading the source code file CurieIMU.cpp#L409, made by Intel for Arduino/Genuino 101. I have some questions:
- How does auto-calibration work in this specific case? This is not very clear to me.
- Why the offset can be assumed to be linear?
- Is there any reference stating that it is safe to assume a linear offset for 1 axis calibration?
The CurieIMUgetAccelerometerOffset reference says that the sensitivity is 3,9 mg.
Given a sensitivity of +-2g
, I have to use this formula
3,9*19,6/32767
in order to convert the value in m/s^2
.
Here is the library code, made by Intel, that computes the correct offset:
{
int bmiOffset = offset / 3.9;
if (bmiOffset < -128) {
bmiOffset = -128;
} else if (bmiOffset > 127) {
bmiOffset = 127;
}
if (axis == X_AXIS) {
setXAccelOffset(bmiOffset);
} else if (axis == Y_AXIS) {
setYAccelOffset(bmiOffset);
} else if (axis == Z_AXIS) {
setZAccelOffset(bmiOffset);
}
setAccelOffsetEnabled(true);
}