Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Novice
1,211 Views

Curie IMU readaccelerometer Problem

What the difference in arduino syntax CurieIMU.readAccelerometer() and CurieIMU.readMotionSensor() ?? because when i try both if it, the result is different even though the position of Arduino 101/ Genuino 101 in the same postition, the board didn't moved but the result value totally different...like below

the picture above is a raw value you get from CurieIMU.readAccelerometer() and the second one picture below, you'll get the Raw value if we are use CurieIMU.readMotionSensor()

anyone can suggest.Thank you

6 Replies
Highlighted
Community Manager
7 Views

Hi GebbyPradana,

 

 

Thank you for contacting us.

 

 

Could you send us the sketch you're using to test this? We used the RawImuDataSerial to test the CurieIMU.readMotionSensor function and the data we obtained in the three first columns (ax, ay and az) resembles more the data found in your first picture.

 

 

In theory, if the device is not moving, axis x and y should read 0. In practice, you'll receive values between -100 and 100 if the device is not moving, and values close to 16000 in the z axis. These values read different from the theoretical values because of noise/error of the device.

 

 

If you're using this same sketch, the readMotionSensor parameters is the data from the readAccelerometer function. Try using this sketch and let us know if you're able to see positive results https://github.com/01org/corelibs-arduino101/blob/master/libraries/CurieIMU/examples/RawImuDataSeria... https://github.com/01org/corelibs-arduino101/blob/master/libraries/CurieIMU/examples/RawImuDataSeria... .

 

 

Regards,

 

-Sergio A

 

 

0 Kudos
Highlighted
Novice
7 Views

Hello Sergio...

 

Thank you for your response...

Let we compare the source code i've try it before, the code which you send to me via GIthub...

 

and the result like my first picture... but if you try to get the accelerometer value with CurieIMU.readAccelerometer() you will get different data from xAxis although the device not moving..

 

this is my code...

 

you can try this...

# include

int xAxisRaw, yAxisRaw, zAxisRaw;

void setup() {

CurieIMU.begin();

CurieIMU.setAccelerometerRange(2);

CurieIMU.autoCalibrateAccelerometerOffset(X_AXIS, 0);

CurieIMU.autoCalibrateAccelerometerOffset(Y_AXIS, 0);

CurieIMU.autoCalibrateAccelerometerOffset(Z_AXIS, 1);

Serial.begin(9600);

}

void loop() {

CurieIMU.readAccelerometer(xAxisRaw, yAxisRaw, zAxisRaw);

float xAxis = xAxisRaw / 32768.0 * CurieIMU.getAccelerometerRange();

float yAxis = yAxisRaw / 32768.0 * CurieIMU.getAccelerometerRange();

float zAxis = zAxisRaw / 32768.0 * CurieIMU.getAccelerometerRange();

Serial.print("x axis: " + String(xAxisRaw) + "\t");

Serial.print("y axis: " + String(yAxisRaw) + "\t");

Serial.print("z axis: " + String(zAxisRaw) + "\t");

Serial.println("");

Serial.print("x axis: " + String(xAxisRaw) + "g\r\n");

Serial.print("y axis: " + String(yAxisRaw) + "g\r\n");

Serial.print("z axis: " + String(zAxisRaw) + "g\r\n\r\n");

delay(1000);

}

Tahnk you very much...

 

Regards

 

Gebby
0 Kudos
Highlighted
Community Manager
7 Views

Hi GebbyPradana,

As I understand from your reply, you want me to compare the code you just sent us to the code in the Github site with the RawImuDataSerial.ino, is this correct?

 

If that's the case, we'd gladly run the test so you can compare the results. These tests were made without having the board move in between tests.

 

Your code:

 

Code from Github

The values in both sketches differ from each other. It's possible that the issue is related to the calibration of the sensor. If you take a look at the RawImuDataSerial.ino sketch, you can see in the comments that there are some functions available to manually calibrate offset values. Have you tried using these functions to obtain similar results in both sketches?

Regards,

 

-Sergio A

 

0 Kudos
Highlighted
Community Manager
7 Views

Hi GebbyPradana,

 

 

Do you still need assistance with this case?

 

Please let us know if there's anything we can assist you with.

 

 

-Sergio A

 

0 Kudos
Highlighted
Novice
7 Views

Hello Sergio...

 

I'm really sorry before for my late response...

and thank you very much for your responsibility to guide me very well...

 

today i'm continuing my project with accelerometer...

and i have a questions about it...

 

how to separate the negative value from read accelerometer value

If we have found the ax value between -100 to 100, how can i get the negative value only?

Thank you very much..

 

Regards

 

Gebby
0 Kudos
Highlighted
Community Manager
7 Views

Hi GebbyPradana,

 

 

No need to apologize, we're still here and will try to help however we can. If you just want to receive negative values you can try doing a -100 offset. This way you'd have values from -200 to 0 instead of -100 to 100, and it won't affect the overall measurement results.

 

 

Let us know if this is what you were looking for.

 

 

Regards,

 

-Sergio A

 

0 Kudos