ihart Posted January 26, 2014 Report Share Posted January 26, 2014 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); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.