Jump to content
I2Cdevlib Forums

MPU-6050 goes completely insane after a (short) while


Recommended Posts

Hi everyone,

 

I'm working on a project with an Arduino Teensy 3.2 and the MPU-6050.

My method to sample the IMU is based on the "MPU6050_DMP6.ino" example in the library. I modified the program and made it into a function that returns three or four values (angles/accelerations or quaternion), instead of printing them to the serial port. Not much of a change.

 

Anyway - the program works well for a minute or two (sometimes even five). It prints out the angles to the serial monitor and they all seem to make sense.

But, after said minute or two (or five) - it all goes to... crap.

Instead of "roll 29 pitch 0.1 yaw 1.4" (just an example) I'm suddenly seeing "roll -150 pitch nan yaw 300". Then the outputs go crazy and change values frantically for another minute or so - after which they seem to stop at a certain set of angles (roll -180, pitch 0, yaw -180). And by "stop", I mean they don't change even when I move the MPU around.

 

EDIT: I just noticed that it goes back to normal after a long while. Like after ten minutes, the values would be normal again for one to two minutes. Then it goes mental once more.

 

Does anyone have an idea what the problem might be? I thought it might be FIFO overflow but I don't see any messages in my log.

Any help would be greatly appreciated, as always.

Link to comment
Share on other sites

Anyone? Dear Jeff?  :(

 

EDIT:

 

Here is an example - the outputs (x,y,z are just the Euler angles, I named them that for... convenience, I guess?) when the sensor is completely static:

 

x -2.615318 y -0.133159 z 0.058574
x -2.615318 y -0.133159 z 0.058574
x -2.615318 y -0.133159 z 0.058574
x -2.615318 y -0.133159 z 0.058574
x -2.615318 y -0.133159 z 0.058574
x -2.615318 y -0.133159 z 0.058574
x -2.615318 y -0.133159 z 0.058574
x -2.615318 y -0.133159 z 0.058574
x -2.615318 y -0.133159 z 0.058574
x -2.615318 y -0.133159 z 0.058574
x -142.529541 y 0.266016 z -0.325795
x -86.919456 y 40.571777 z -23.873074
x -87.119164 y 5.026152 z 20.263960
x -87.159348 y 4.718861 z 17.872175
x -81.674042 y -30.620316 z -27.208601

As you can see, right towards the end, the angles start to oscillate without no apparent logic. They keep on doing that until they get to this pattern:

 

x -266.105682 y 0.266038 z -180.324097
x -266.105652 y 0.266006 z -180.324081
x -266.105652 y 0.266007 z -180.323959
x -266.105713 y 0.265985 z -180.324173
x -266.105652 y 0.266005 z -180.324036
x -266.105713 y 0.265982 z -180.323883
x 93.894287 y 0.266016 z -180.323959
x -266.105682 y 0.266042 z -180.323853
x 93.894287 y 0.266016 z -180.323975
x -266.105652 y 0.266008 z -180.324158
x -266.105652 y 0.266010 z -180.324005
x -266.105713 y 0.265985 z -180.324020
x -266.105652 y 0.266009 z -180.323959
x 93.894287 y 0.266016 z -180.324020
x -266.105713 y 0.265984 z -180.323944
x -266.105652 y 0.266011 z -180.323807
x -266.105652 y 0.266011 z -180.323776

I don't think the values matter all that much, but I'm posting them so anyone reading this would get the gist of what's going on.

 

Could it be a missing bit or something? I mean, perhaps the FIFO buffer gets "shifted" somehow so all the numbers get screwed up.

Link to comment
Share on other sites

  • 8 months later...

Hi NonConformalMapping,

i'm working with an arduino mega 2560 and a mpu6050 imu, and i'm experiencing issues much similar to yours, i'm actually using rosserial arduino to send the YPR over serial connection.

Did you eventually solve the problem? Please share

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