Jump to content
I2Cdevlib Forums

MPU-6050 Gyro cross coupling problem


Recommended Posts

I am using the MPU-6050 for a Segway clone using an Arduino Uno.  The MPU-6050 is laid flat on the top of the segway platform with the Y axis used to measure front/back tilt.   Left/right rotation would be on the Z axis.

 

The front and back tilt seems to be working but when I turn left or right, the ZGyro seems to be coupling into the YGyro which is used for front/back tilting.  This causes the segway to dip when I turn left and raise up when I turn right.

 

When I look at the Arduino serial monitor with no motors enabled, I can see this behavior showing in my scrolling gyros printout.  In fact, the front back Y Axis motion seems to couple in to the Z axis Gyro as well.

 

Has anyone seen this before?  Any idea what might be causing this?

 

 

Some relevant code snips:

 

#include <Wire.h>
#include "I2Cdev.h"
#include "MPU6050_6Axis_MotionApps20.h"
 

 

  // supply your own gyro offsets here, scaled for min sensitivity
  mpu.setXGyroOffset(10);
  mpu.setYGyroOffset(7);
  mpu.setZGyroOffset(14);
  mpu.setZAccelOffset(900); // 1688 factory default for  test chip
 

 

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

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...
×
×
  • Create New...