Jump to content
I2Cdevlib Forums

Recommended Posts

Hi guys,

I'm using Jeff Rowberg's code with my MPU-6050, and I managed to get everything working fine except for some YAW drift. I'm aware of the temperature factors as well as the "big shake" causing this drift.

That being said, i'm trying to manually reset the sensors (set them to zero) in order to eliminate this drift (let's say, when pressing a button, for simplicity sake).
I'm not sure if I should disable the FIFO before resetting the sensor or if that doesn't matter. Not sure if I should reset the FIFO either (I'm using resetSensors)

I've tried many combinations but it didn't seem to make a change (if I disable the FIFO, the value jumps to 3.14!?)
Resetting the sensors ALWAYS seem to increase the YAW in small increments. So if YAW < 0 then it's "fine" because I can stop resetting when reaching zero. BUT if YAW > 0 it will sum up as well (until it reaches the maximum, jumps to negative and finally reach 0 again).

My questions are:
- Cannot I reset to zero immediately in one shot (instead of calling resetSensors on the loop until it reaches zero?) Because depending on how far it is from zero, it may take some considerable time to reach it.

- If the first question's answer is "no": what can I do to make "resetSensors" sum up when the value is negative and substract when the value is positive?

 

Thank you very much for your help, I really am spending a lot of time on this so I appreciate any feedback!
Cheers,

Synth

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