Jump to content
I2Cdevlib Forums

Collecting speed rate and acceleration

Recommended Posts

I am using the I2C library and the source code on github (https://github.com/jrowberg/i2cdevlib/tree/master/Arduino/MPU6050) to collect the yaw, pitch and roll fused from the gyrometer and accelerometer outputs:

        accelgyro.dmpGetQuaternion(&q, fifoBuffer_1);
        accelgyro.dmpGetGravity(&gravity, &q);
        accelgyro.dmpGetYawPitchRoll(ypr, &q, &gravity);


So I have two questions:


1) I have read that the values above are calculated by fusing the output from the accelerometer and the gyroscope. In this case, I was wondering what is the used algorithm to calculate these way, pitch and roll ?


2) Also, I would like get the acceleration from the accelerometer in m²/s and the angle speed from the gyrometer in °/s. What function should I call or what should I do to get these values? dmpgetGyro() and dmgGetAccel() don't give me correct values: I am adding the measured value to the last measure, but if I move my arduino by 90° it outputs 50° instead, and even if I hold still in the position it slowly decreases/increases back to zero.


I am truely desesperated on this one. I really need my second question to be answered. I am read the documentation and the datasheet many times but can't get it work properly.

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.

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.

  • Create New...