Jump to content
I2Cdevlib Forums

Convert DMP Values to G-Force


Recommended Posts

I was under the impression that the default range for the MPU-6050 accelerometer was +/-2g, but after doing some datalogging I'm beginning to think that is only the case for the raw values (i.e. using MPU6050_raw.ino)  and not true when using the DMP (i.e. using DMP6050_DMP6.ino). The values I obtained are half of what I believe they should be, leading me to believe that with DMP the default range is +/-4g.

 

I found a line in MPU6050_6Axis_MotionApps20.h that only confuses me more:

// get rid of the gravity component (+1g = +8192 in standard DMP FIFO packet, sensitivity is 2g) 

If the sensitivity is 2g, doesn't 1g = 16,384? Or am I reading the datasheet incorrectly? At this point I'm pretty confused and hopefully somebody can clear it all up for me... 

Link to comment
Share on other sites

Just to add some additional information: I'm outputting the REALACCEL acceleration values and dividing them by 16,384, as indicated in the datasheet for +/-2g sensitivity. If the sensitivity when using the DMP is actually +/-4g, I should only be dividing by 8,192. This will double the 'g-force' numbers that I am currently logging, putting them more in line with what I expect.

Link to comment
Share on other sites

  • 5 months later...

Im having the exact same problem. Shouldnt 1g =( 2^16)/2 = 16384 ?

Is it showing correct looking linear acceleration values through some offset register hocus pocus or is 1g really equal to 8192?

 

Its confusing because inworld accelerations appear to be free of any gravity component even though 8192 is used.

Link to comment
Share on other sites

  • 5 weeks later...

Is the DMP limited to a 4g sensitivity? I tried changing the sensitivity, but it still outputs 8192...

 

I changed this line:

setFullScaleAccelRange(MPU6050_ACCEL_FS_2);
into

setFullScaleAccelRange(MPU6050_ACCEL_FS_8);
And it didn't change anything on the DMP...
Link to comment
Share on other sites

  • 8 months later...
  • 2 years later...

Same issue here.

After: (MPU6050.ccp)

void MPU6050::initialize() {
    setClockSource(MPU6050_CLOCK_PLL_XGYRO);
    setFullScaleGyroRange(MPU6050_GYRO_FS_250);
    setFullScaleAccelRange(MPU6050_ACCEL_FS_2);
    setSleepEnabled(false); // thanks to Jack Elston for pointing this one out!
}

...

 * <pre>
 * AFS_SEL | Full Scale Range | LSB Sensitivity
 * --------+------------------+----------------
 * 0       | +/- 2g           | 8192 LSB/mg
 * 1       | +/- 4g           | 4096 LSB/mg
 * 2       | +/- 8g           | 2048 LSB/mg
 * 3       | +/- 16g          | 1024 LSB/mg
 * </pre>

So the MPU6050_6Axis_MotionApps20.h expands...
 

uint8_t MPU6050::dmpGetLinearAccel(VectorInt16 *v, VectorInt16 *vRaw, VectorFloat *gravity) {
    // get rid of the gravity component (+1g = +8192 in standard DMP FIFO packet, sensitivity is 2g)
    v -> x = vRaw -> x - gravity -> x*8192;
    v -> y = vRaw -> y - gravity -> y*8192;
    v -> z = vRaw -> z - gravity -> z*8192;
    return 0;
}

But the MPU 6050 Product Specification says:

MPU6050.JPG.b982cefe40cc000900a7af4da7d500c5.JPG

 

If the values are queried with the Rowberg-Skript, they are to low. But if I divide the "output_readable_realaccel" aaReal by 8192 instead 16384 it seems to be correct.

How to fix it correctly?

Sorry for take up the old topic, but its pretty confusing.

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...