Bert Posted May 2, 2017 Report Share Posted May 2, 2017 Hi, I'm new to the MPU6050 but getting some good results using 8051 micro interfaced to GY-521 breakout board to MPU6050. One puzzling thing is that while the Invensense register map for the MPU6050 states: REGISTERS 59 TO 64 – ACCELEROMETER MEASUREMENTS REGISTERS 67 TO 72 – GYROSCOPE MEASUREMENTS After a 200 mSec delay I measure the offsets, save them and subtract the offsets from the X,Y, and Z values of the acceleration and gyro angles. The results show values near zero after subtracting the offsets. So far, so good. But...I get the Gyro and Acceleration reversed. When I rotate the GY-521 90 degrees and then keep the board stable at the 90 degree position, the Acceleration values stay at a high value but the Gyro angle goes back to zero. When I rotate the board back to the resting position both the acceleration and gyro values got back to near zero. The gyro values only change when the board is actually being moved and go back to zero when the board is stationary, irregardless of the position/angle of the board. Here is the code: while(1) { ReadBytesIIC(59,14); //Read 14 register bytes starting at MPU6050 register 59. //Array[0]=register 59, Array[1]=register 60, etc. AccX=256*(int)Array[0]+(int)Array[1]+AccXOffset; AccY=256*(int)Array[2]+(int)Array[3]+AccYOffset; AccZ=256*(int)Array[4]+(int)Array[5]+AccZOffset; GyroX=256*(int)Array[8]+(int)Array[9]+GyroXOffset; GyroY=256*(int)Array[10]+(int)Array[11]+GyroYOffset; GyroZ=256*(int)Array[12]+(int)Array[13]+GyroZOffset; printf("\nAX,Y,Z, GX,Y,Z=%5d %5d %5d %5d %5d %5d",AccX,AccY,AccZ,GyroX,GyroY,GyroZ); DlyMs(50); } Can anyone explain to me why this might be happening? Thank you in advance. Bert Quote Link to comment Share on other sites More sharing options...
Bert Posted May 2, 2017 Author Report Share Posted May 2, 2017 Duh.... Figured it out. The software is right but my interpretation of the results was wrong. The acceleration measurement is displaying large numbers when I rotate the board because of gravity! This had me pulling my hair out for a day. Regards, Bert Quote Link to comment Share on other sites More sharing options...
Jesse Posted November 20, 2017 Report Share Posted November 20, 2017 Hi, When I am putting my MPU-6050 at an angle, the gyro values only change while I am turning it, and return to zero when I stop turning. Can you explain why they don't stay at the angle? Regards, Jesse Quote Link to comment Share on other sites More sharing options...
rocinante Posted February 9, 2018 Report Share Posted February 9, 2018 The gyro values give you angular velocity, not tilt angle. 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.