MPU9150 bias values returned from self test Mismatch

By manishrao , 25 July 2014

Hello, everyone, what I am trying to do is to get human readable bias values from when the sensor is stationary. It was mentioned in the forum that the biases obtained from mpu_run_self_test returns biases in G's and dps, but in q16 format. So here is what I did.


result = mpu_run_self_test( gyro, accel );

if( result == 0x7 )
{
/* Test passed. We can trust the gyro data here, so let's push it down
* to the DMP. */

mpu_get_gyro_sens( &sens );

float gyro_bias[3], accel_bias[3];
accel_bias[0] = (float)accel[0] / 65536.0;
accel_bias[1] = (float)accel[1] / 65536.0;
accel_bias[2] = (float)accel[2] / 65536.0;
DEBUG_PRINT("Accel bias: %f, %f, %f n", accel_bias[0], accel_bias[1], accel_bias[2]);
gyro_bias[0] = (float)gyro[0] / 65536.0;
gyro_bias[1] = (float)gyro[1] / 65536.0;
gyro_bias[2] = (float)gyro[2] / 65536.0;
DEBUG_PRINT("Gyro bias @ sensitivity: %f, %f, %f, @%f n", gyro_bias[0], gyro_bias[1], gyro_bias[2], sens);



The orientation of sensor during initialization is with z-axis pointing up(up right position), so I am expecting to see close to [0 0 -1]. Instead I get

Accel bias: -0.027420, 0.095703, 0.013687
Gyro bias @ sensitivity: -0.853821, 0.681503, 0.955597, @16.400000


I looked into the mpu_run_self_test, which calls "get_st_biases( gyro, accel, 0 )" for the self_test disabled value and the values stored in gyro and accel don't seem to be modified anymore (they are just used to obtain self test response). Unless I am half-asleep or blind, I also don't see any removal of gravity in the code.

Can anyone help me identify where my mistake is?
Did I misunderstand of the return values from mpu_run_self_test?

or

Did I perform incorrect conversion?

or
????

Prompt reply is greatly appreciated.
phpbb Topic ID
16428