- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
I am reading the source code file https://github.com/01org/corelibs-arduino101/blob/master/libraries/CurieIMU/src/CurieIMU.cpp# L409 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 https://www.arduino.cc/en/Reference/CurieIMUgetAccelerometerOffset 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 https://www.arduino.cc/en/Reference/CurieIMUautoCalibrateAccelerometerOffset 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() {
sensorVals[0] = CurieIMU.readAccelerometerScaled(0);
sensorVals[1] = CurieIMU.readAccelerometerScaled(1);
sensorVals[2] = CurieIMU.readAccelerometerScaled(2);
Serial.print(sensorVals[0]);
Serial.print(",");
Serial.print(sensorVals[1]);
Serial.print(",");
Serial.println(sensorVals[2]);
delay(100);
}
I also posted this question on http://stackoverflow.com/questions/42118941/how-does-genuino-arduino-101-intel-curie-autocalibration... StackOverflow, http://forum.arduino.cc/index.php?topic=456595.0 Arduino Forum, GitHub without a useful answer.
Thank you Andrea
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
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/RawImuDataSeria... https://github.com/01org/corelibs-arduino101/tree/master/libraries/CurieIMU/examples/RawImuDataSeria....
Regards,
-Yermi A.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
@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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
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.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page