6 Replies Latest reply on Mar 31, 2017 9:34 AM by Intel Corporation

# How does Genuino Arduino 101 Intel Curie Autocalibration (Ax Ay Az) process works?

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?
• Why when I see the data on the serial monitor or on my file created with processing, the Z acceleration autocalibrated values jump from 1~0,99 to 0,00 g? (

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

}

I have a Intel Arduino Genuino 101, i  tried to implement the autoCalibrateAccelerometerOffset() function, through the code below on Arduino Genuino 101.

In a static test, without any stress or noise, I read the three axis value.

When I see the data on the serial monitor or on my file created with processing, the Z acceleration values jump from 1~0,99 to 0,00 g.

Here my code

#include "SoftwareSerial.h"

#include "CurieIMU.h"

float sensorVals[] = {0,0,0};

void setup() {

Serial.begin(9600);

while (!Serial);

Serial.println("Inizializzazione del device...");

CurieIMU.begin();

CurieIMU.setAccelerometerRange(2);

CurieIMU.autoCalibrateAccelerometerOffset(X_AXIS,0);

CurieIMU.autoCalibrateAccelerometerOffset(Y_AXIS,0);

CurieIMU.autoCalibrateAccelerometerOffset(Z_AXIS,1);

}

void loop() {

Serial.print(sensorVals[0]);

Serial.print(",");

Serial.print(sensorVals[1]);

Serial.print(",");

Serial.println(sensorVals[2]);

delay(100);

}

I also posted this question on StackOverflow, Arduino Forum, GitHub without a useful answer.

Thank you Andrea

• ###### 1. Re: How does Genuino Arduino 101 Intel Curie Autocalibration (Ax Ay Az) process works?
This message was posted on behalf of Intel Corporation

Hi Andrea,

Thanks for contacting us!

We appreciate all the information provided. We would like to investigate a little bit more regarding your question and we’ll contact you back as soon as possible.

Regards,
-Yermi A.

• ###### 2. Re: How does Genuino Arduino 101 Intel Curie Autocalibration (Ax Ay Az) process works?
This message was posted on behalf of Intel Corporation

Hi Andrea,

Thanks for your patience. We would like to know if you have seen the RawImuDataSerial example, in the IDE for the Curie IMU to see how the calibration process is done. Here you can find that example: https://github.com/01org/corelibs-arduino101/tree/master/libraries/CurieIMU/examples/RawImuDataSerial.

Regards,
-Yermi A.

• ###### 3. Re: How does Genuino Arduino 101 Intel Curie Autocalibration (Ax Ay Az) process works?
This message was posted on behalf of Intel Corporation

Hi Andrea,

We just wondering if you have had a chance to look at the RawImuDataSerial example to see how the calibration is done.

Regards,
-Yermi A.

• ###### 4. Re: How does Genuino Arduino 101 Intel Curie Autocalibration (Ax Ay Az) process works?

@Yemi my question is composed by two problems.

The first and more relevant is about the library:

• 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?

So, for the first part of my question  the code on GitHub that you gave me is useless because it use "CurieIMU.autoCalibrateAccelerometerOffset(X_AXIS, 0);" but doesn't explain how it works (my first part of code is took from the library code).

Instead for the second problem "the swinging problem" i have to try it.

Thanks

• ###### 5. Re: How does Genuino Arduino 101 Intel Curie Autocalibration (Ax Ay Az) process works?
This message was posted on behalf of Intel Corporation

Hi Andrea,

The information I have is not relevant, so, I’ll investigate a little bit more and as soon as I find useful information I’ll let you know.

Thanks for your patience.

Regards,
-Yermi A.

• ###### 6. Re: How does Genuino Arduino 101 Intel Curie Autocalibration (Ax Ay Az) process works?
This message was posted on behalf of Intel Corporation

Hi Andrea,

Thanks for your patience. We have been investigating and the BMI160.cpp is part of the driver for the BMI chip in the Curie SoC. The IMU library makes use of this driver to obtain gyro data from the hardware and application, like the sample sketch RawImuDataSerial.ino, makes use of the data. The driver was developed according to the datasheet provided by the chip manufacture. The datasheet does not provide performance/operation specs.

We suggest to contact the chip manufacturer in order to obtain an appropriate response to your questions.

Regards,
-Yermi A.