i have a hard time using MPU6050

Hi everybody :)  I just want to ask a question... I'm working on a project in which i use the MPU6050 IMU from invensense connected to an arduino leonardo. Thanks to Jeff Rowberg's library, i could use the DMP of this chip to get yaw, pitch and roll angles, but my problem is that when i run the example code, every thing is ok, but when i just add one delay, say delay(100), the FIFO register overflows. Is there any solution for this problem??

Another problem i faced also is that when i added some extra pieces of code (related to my project), where i use the PWM to control the speed of rotation of some motors, the yaw angle readings from the MPU go nuts, is there any relation between using PWM and the FIFO in the MPU??

thank you in advance for your help.

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • Hi,

    I had the same problem with MPU6050 on a personal project. When I used the code in this example, the data were good! But, when I added a little bit of my own code or just a delay of 50ms, the data were totally faulty!!

    Many hours later, I looked the content of the fifoBuffer and I realized there were two lags. So, I decided to correct one of those lag. After the modification, the second lag was always here but it could be deleted in detecting the wrong data. 

    This is the solution I found to solve 90% of the problem.

    for(int i=1; i<16; i++)
    fifoBuffer[i+41] = fifoBuffer[i];

    for(int i=0; i<41; i++)
    fifoBuffer[i] = fifoBuffer[i+16];

    // recupération des données
    CI.dmpGetQuaternion(&q, fifoBuffer);
    CI.dmpGetGravity(&gravity, &q);
    CI.dmpGetYawPitchRoll(ypr, &q, &gravity

    Hope it will be helpful!

  • In some thread they say that IMU started calibrating at faster rate than mc, so the stack is getting overflown due to that...  

  • I too having same problem... You got any solutions???

This reply was deleted.

Activity