Community
cancel
Showing results for 
Search instead for 
Did you mean: 
MDron
Beginner
1,060 Views

IMU lack of precision on Arduino 101

Issue: total acceleration module, for simplicity, let's talk about square of accelerations (acc_x^2+acc_y^2+acc_z^2) deviates by about 0.15 (in unites of g^2) with different board orientation. That's 38% inaccuracy in gravity module (sqrt(0.15) ~ 0.38).

I've tested this on few boards and results are more or less the same - 0.10 to 0.20 deviation of squared acceleration (with board lying on the table in different orientations).

Changing AccelerometerRange or AccelerometerRate do not affect results in any significant way.

Any ideas if there is a way to fix the issue?

Sapmple code:

# include

 

void setup() {

Serial.begin(9600);

 

CurieIMU.begin();

 

CurieIMU.setGyroRate(200);

 

CurieIMU.setAccelerometerRate(25);

 

CurieIMU.setAccelerometerRange(2);

 

CurieIMU.setGyroRange(250);

 

CurieIMU.autoCalibrateAccelerometerOffset(X_AXIS, 0);

 

CurieIMU.autoCalibrateAccelerometerOffset(Y_AXIS, 0);

 

CurieIMU.autoCalibrateAccelerometerOffset(Z_AXIS, 1);

 

CurieIMU.autoCalibrateGyroOffset();

 

}

void loop() {

int aix, aiy, aiz;

 

int gix, giy, giz;

 

float x, y, z;

 

if (CurieIMU.dataReady()) {

CurieIMU.readMotionSensor(aix, aiy, aiz, gix, giy, giz);

 

x = aix * 2.0 / 32768.0;

 

y = aiy * 2.0 / 32768.0;

 

z = aiz * 2.0 / 32768.0;

 

Serial.println(x * x + y * y + z * z - 1);

 

}

}

Tags (1)
0 Kudos
6 Replies
idata
Community Manager
90 Views

Hi MDronov,

 

 

Thanks for contacting us!

 

 

We would like to investigate a little bit more about that and as soon as we have useful information we'll let you know.

 

 

We'll appreciate your patience during the meantime.

 

 

Regards,

 

-Yermi A.

 

idata
Community Manager
90 Views

Hi MDronov,

 

 

We have been testing your code and we are unable to replicate what you are seeing. Using your code, each board orientation will print a value around 0.0 and 0.04. The Curie has a BMI160 and the datasheet can be found here: http://www.mouser.com/ds/2/783/BST-BMI160-DS000-07-786474.pdf http://www.mouser.com/ds/2/783/BST-BMI160-DS000-07-786474.pdf we are using the BMI160 library to obtain the values from the sensor.

 

 

Could you please explain where you obtained the values in your calculations in your loop? Also, we would like to know which Arduino IDE version you are using and the Arduino 101 board package version found in boards' manager.

 

 

Regards,

 

-Yermi A.

 

MDron
Beginner
90 Views

OK, so you ended up with up to 0.04 squared deviation - meaning 20% inaccuracy.

I've checked BMI160, received an answer from Bosch Sensortec that it is capable to give 0.1% accuracy in real life (though, for they own sensor based dev device they use calibration in 3 different orientations), checked with guy who have it as part of Arduino shield - he gets something like 1% deviation...

I adopted conversion code from some example, but it is not important for reported issue.

Intel Curie boards version 2.0.2, Arduino 1.8.2.

Simplified code, using CurieIMU lib conversion

# include

 

 

void setup() {

Serial.begin(9600);

 

CurieIMU.begin();

 

CurieIMU.setGyroRate(200);

 

CurieIMU.setAccelerometerRate(25);

 

CurieIMU.setAccelerometerRange(2);

 

CurieIMU.setGyroRange(250);

 

CurieIMU.autoCalibrateAccelerometerOffset(X_AXIS, 0);

 

CurieIMU.autoCalibrateAccelerometerOffset(Y_AXIS, 0);

 

CurieIMU.autoCalibrateAccelerometerOffset(Z_AXIS, 1);

 

CurieIMU.autoCalibrateGyroOffset();

 

}

void loop() {

float aix, aiy, aiz;

 

float gix, giy, giz;

 

if (CurieIMU.dataReady()) {

CurieIMU.readMotionSensorScaled(aix, aiy, aiz, gix, giy, giz);

 

Serial.println((sqrt(aix * aix + aiy * aiy + aiz * aiz) - 1) * 100);

 

}

}

This version prints deviation from g in %, today it gives me up to 15% (maximum is reached when board Y-axis is facing up or down).

The old code gives me below 0.03 today which is consistent, so may be some external changes affected performance. (for ex. air temperature at my home is about 5 degrees Celsius lower)

idata
Community Manager
90 Views

Hi MDronov,

 

 

Thanks for the information provided. I would like to get more information and I'll let you know as soon as we have it.

 

 

Regards,

 

-Yermi A.

 

idata
Community Manager
90 Views

Hi MDronov,

 

 

I'm getting less than 1, with the board upside down I see ~5. Could you please provide the output of what you are seeing?

 

 

Regards,

 

-Yermi A.

 

idata
Community Manager
90 Views

Hi MDronov,

 

 

I would like to know if you could provide the output of what you are seeing.

 

 

Regards,

 

-Yermi A.

 

Reply