Pages: 1 [2]   Go Down
Author Topic: dmp on MPU6050  (Read 11112 times)
0 Members and 1 Guest are viewing this topic.
Memphis, TN
Offline Offline
Newbie
*
Karma: 0
Posts: 38
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I also have been having issues with the FIFO overflow on my GY521. Below is a screen capture of what I am getting now. I am happy with the gyroscope readings, but I also need the accelerometer's aswell for my project. Anyone please tell me what I should do to correct this problem?

The readings were taken when everything was sitting still on a table at close to 10 degrees angle.


* Modified MPU6050 DMP6 Results.jpg (317.39 KB, 1264x856 - viewed 145 times.)
« Last Edit: March 15, 2013, 06:17:48 pm by Swoop132 » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sorry, for using your thread. I happened to have your same problem. Like Krodal said, i connected INT of my MPU-6050 to digital pin 2 of the arduino, still the serial monitor displays junk values. Any idea what i should do?

Are u using MPU6050_DMP6 of Jeff? and the baudrate of your serial is 115200? The junk values are the results of the conversion to ASC. If u uncomment #define OUTPUT_READABLE_EULER u will see the Euler angles(in degree).
Logged

Offline Offline
Faraday Member
**
Karma: 62
Posts: 3080
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It looks like you are not reading the device often enough.  The MPU6050 is doing calculations faster than you are reading the results,  and it's buffer overflows. 

This doesn't necessarily matter, if you don't need such a rapid update rate anyway.   You can just delete that warning message in your arduino sketch,  and you won't see the message any more.
Logged

Memphis, TN
Offline Offline
Newbie
*
Karma: 0
Posts: 38
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I slowed the transmission frequency in the MPU6050_6Axis_MotionApps20 library from 100 Hz to 20 and the device is able to be picked up by a terminal on the phone, but my app still is unable to read all the information. Like you said the information is transmitting so fast that the phone can't read it.

An idea that I had was to transmit the information in one string in both subroutines. This would prevent the device from sending out parts of the information in separate lines. Problem that I am running into is that the format of program won't allow me to do this. What would you suggest for me to limit the transmissions to allow my app to catch up?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello, I'm new here, looking for some answers to our beloved MPU 6050. I had the same problem before but a friend gave me a hand and explain something about that it wasn't aligned. At the processing code, not at the arduino code. What he did was to realign if is not aligned. I don't know how it really works but it works.

Code:
while (port.available() > 0) {
        int ch = port.read();
        print((char)ch);
        if (aligned < 4) {
            // make sure we are properly aligned on a 14-byte packet
            if (serialCount == 0) {
                if (ch == '$') aligned++; else
                {
                  aligned = 0;
                  serialCount=0;
                }
            } else if (serialCount == 1) {
                if (ch == 2) aligned++; else
                {
                  aligned = 0;
                  serialCount=0;
                }
            } else if (serialCount == 12) {
                if (ch == '\r') aligned++; else
                 {
                  aligned = 0;
                  serialCount=0;
                }
            } else if (serialCount == 13) {
                if (ch == '\n') aligned++;else
               {
                  aligned = 0;
                  serialCount=0;
                }
            }
            //println(ch + " " + aligned + " " + serialCount);
            serialCount++;
            if (serialCount == 14) serialCount = 0;
        } else {
            if (serialCount > 0 || ch == '$') {
                teapotPacket[serialCount++] = (char)ch;
                if (serialCount == 14) {
                    serialCount = 0; // restart packet byte position
                   
                    // get quaternion from data packet
                    q[0] = ((teapotPacket[2] << 8) | teapotPacket[3]) / 16384.0f;
                    q[1] = ((teapotPacket[4] << 8) | teapotPacket[5]) / 16384.0f;
                    q[2] = ((teapotPacket[6] << 8) | teapotPacket[7]) / 16384.0f;
                    q[3] = ((teapotPacket[8] << 8) | teapotPacket[9]) / 16384.0f;
                    for (int i = 0; i < 4; i++) if (q[i] >= 2) q[i] = -4 + q[i];
                   
                    // set our toxilibs quaternion to new data
                    quat.set(q[0], q[1], q[2], q[3]);


Maybe this can be helpful, or maybe not. But just in case, it didn't work and now it works (with some other issues)
Logged

Pages: 1 [2]   Go Up
Jump to: