Jump to content
I2Cdevlib Forums

Get angular velocity from MPU-6050


Recommended Posts

When you run the DMP example, add this line as shown here:

mpu.dmpGetQuaternion(&q, fifoBuffer);
mpu.dmpGetGyro(gyro, fifoBuffer);
mpu.dmpGetGravity(&gravity, &q);
mpu.dmpGetYawPitchRoll(ypr, &q, &gravity);

    dmpGetGyro will give you angular velocity. Anyway, I believe it is not processed, but the sensor raw reading multiplied by its gain.

Link to comment
Share on other sites

  • 1 year later...

Hello,

 

I think the raw gyro data taken from the fifo (when DMP enabled) is scaled down. Because when i made a sensor fusion (verified), it doesnt match the DMP data. When i multiply the gyro data by 25 (experimantal), it works fine and matches the DMP data. Thus it is 2000*/s divided by 25.

 

And the accelerometer is also outputs ~8000 when idle. That means a 4g resolution.

 

Could anyone confirm the results?

Link to comment
Share on other sites

  • 1 year later...

Hi Pico,

 

I have found the same results! And I have a theory about why.

 

For others: I found that dmpGetGyro gives rates of Roll Pitch Yaw (note the order) in counts that correspond to +-2000/25 = +-80deg/s (divide count by 32768/80)

 

My configuration: DMP FIFO set to 25Hz (see note below). getFullScaleGyroRange says 3 (2000deg/s), and I noticed it is set to this by dmpInitialize(). getFullScaleAccelRange says 0 (+-2g), but as others have pointed out, this does not seem to reflect the DMP output (dmpGetAccell), which is requires divide count by 32768/4=8192 implying +-4g. (getAcceleration() has a note suggesting 8192 is 2g sensitivity but I don't understand this.)

 

My first impression of the angular rates scaling is that it includes the fifo frequency I am using of 25Hz. Luisrodenas mentioned "multiplied by its gain" but I don't think this is what he meant. I have yet to explore this by changing the frequency, but I am now skeptical because you (Pico) are likely not using 25Hz. 

 

For anyone finding this wishing to change your FIFO rate, do a search in the MPU6050 header for inv_set_fifo_rate and read the note below it.

 

Hello,

 

I think the raw gyro data taken from the fifo (when DMP enabled) is scaled down. Because when i made a sensor fusion (verified), it doesnt match the DMP data. When i multiply the gyro data by 25 (experimantal), it works fine and matches the DMP data. Thus it is 2000*/s divided by 25.

 

And the accelerometer is also outputs ~8000 when idle. That means a 4g resolution.

 

Could anyone confirm the results?

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...