MPU 9150 with arduino UNO issue with range of raw data

I have MPU 9150. tried multiple different projects but having same issue.

All of them are setting the accelerometer to give the range in ±2g.
I’m using arduino UNO.

it is showing the raw accel readings as follows:
-87 13 7782
From Digital Motion Processor I get the values of acceleration from it’s FIFO buffer as follows:

uint8_t MPU6050::dmpGetAccel(int32_t *data, const uint8_t* packet) {
    // TODO: accommodate different arrangements of sent data (ONLY default supported now)
    if (packet == 0) packet = dmpPacketBuffer;
    data[0] = ((packet[28] << 24) + (packet[29] << 16) + (packet[30] << 8) + packet[31]);
    data[1] = ((packet[32] << 24) + (packet[33] << 16) + (packet[34] << 8) + packet[35]);
    data[2] = ((packet[36] << 24) + (packet[37] << 16) + (packet[38] << 8) + packet[39]);
    return 0;

So I suppose that the max value is 32768 which is equal in my settings to 2g.
But actual raw data I see is:
-87 13 7782

It’s length is equal to ~ 7782.49
So in ±2g range it is = 0.475g
and its not 1g at all.

I ran the program with all other settings to the accelerometer to give me data in range of
± 2g, 4g, 8g and 16g.

I got the data for each case approximately as follows:
2g: 0,0,8000
4g: 0,0, 4000
8g: 0,0, 2000,
16g: 0,0, 1000

I am little bit confused of what is happening and how to get correct results. Because I can’t compensate the gravity correctly because of that.

BTW is there a datasheet and register map data for the digital motion processor used in MPU 9150?
They provide some data but its not what needed at all. They rpovide code as well but all settings are stored as a big configuration array into DMP, with comments but its not enough to understand anything.


Useful link to understand a bit more about the DMP.

MPU 9150 Register map.


Useful link to understand a bit more about the DMP.

MPU 9150 Register map.

Thank you for the links. I've already tried those things. Simple program is giving me the data. The teapot example is just using the rotation angles. But my task is to track the position. So if sensor is moving I want to know how much meters and in what direction its standing from the initial point.

Do you know if I;m using the sample code they provide, does the calibration of accelerometer is done by DMP automatically or i have to do something from my side?

I calibrated the acceleration and gyro data using my own code. then it showed right values. But if I initialize DMP and try to use it, the DMP returns everything back as it was before. Even if I set the calibrated data again (i mean offset values) it give some shifted results:
for example if data is calibrated it shows accel data as

-40, 40, 16400

which is ok as 16384 = 1g

but together with dmp initialized it shows me
-600, 40, 16700

all readings are when sensor is not moving.

So, the question is : is it possible to setup the DMP to correctly calibrate and give correct data? as the gravity vector from quaternion is also not equal to one in length. And acceleration data is weird not showing right things. Or maybe Im missing something?

Sounds to me like the 9150 is not worth the trouble.

I've been using the BNO055 for a while now, and although the built in calibration procedure is a bit mysterious and flaky, overall the device works according to the specs, and is quite satisfactory.