-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MPU6050_DMP6 example crashing #154
Comments
The line |
Here is the code, using 2 servos and without serial. [code] #include "I2Cdev.h" #if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE MPU6050 mpu; #include <Servo.h> Servo myservo; #define LED_PIN 13 // (Arduino is 13, Teensy is 11, Teensy++ is 6) // MPU control/status vars // orientation/motion vars // packet structure for InvenSense teapot demo // ================================================================ volatile bool mpuInterrupt = false; // indicates whether MPU interrupt pin has gone high // ================================================================ void setup() {
} // ================================================================ void loop() {
} |
Same problem here ... I guess the problem is with the buffer since sometimes it ain't able to read the register ! Did you get a solution to it ?? |
I have the same problem. After a while reading the registers, either FIFO Count or Raw acc/gyro values, makes it crash. Any new findings to that problem? |
@aborjesson Okay ... There was a problem reading the on-board registers in I2Cdev.cpp,which was annoying and frustrating,huh!! Anyways Fixed it , here's the link https://drive.google.com/file/d/0BwUusXozWAMjVWhMYkZ4NlZwYlk/view?usp=sharing to the modified library. Override the original files and you are good to go. Ping me if it works. |
@wolframalpha: I diffed your I2CDev.cpp with the latest verison from @jrowberg and there was no code changes. So it did'nt sort out my mystery. I think my problem is related to that I use the FIFO for DMP values for Yaw, Pitch, Roll and at the same time (while FIFO is getting filled from DMP 100Hz) read raw values from the registers for gyro and accel. Do anyone know if this is doable, to use the DMP/FIFO and at the same time read raw values from the registers ? Cannot find anything related to that in the data sheet. |
COOL!!! Now it is working fine!!!! Congrats. |
If I use a Servo, the program is crashing yet... I dont know if it is interference... In some part of the library (I2C or MPU6050) the code stay on a infinity loop, becouse the arduino is freezing. I believe this is occurring in some part of the code that handles incoming data. When it happens an interference by the servo or motor, the arduino freezing... |
@opvini Maybe the power supply is not enough! |
@ranqingfa I think can be a bug on wire arduino library. I am using a PC power supply (250W) and just 2 servos. |
@opvini : Those MPU-9150s are mysterious. Seem to be very sensitive to noise of all sort. I bought a new one, resoldered my whole sketch onto a pcb hole bread board. Now it seems to work rock solid even if I use the DMP. I do not use interrupts though, havent had the time to check that. It is powered by a separate power supply, soldered onto the board. |
Hi guys! I solved the problem:
Now it works very well and not freezing :D |
Other important consideration: when I use some delay's on my firmware, it crashes. Then I am using micros() to count time and execute the correct actions at a correct time. |
I am just learning arduino and C/C++ programming so I don't know if this will help, but I also found that the MPU6050 DMP demo program would crash. I was able to get it to work reliably by eliminating the interrupt detection for the FIFO buffer and instead just poll the MPU6050 for the buffer state. Doing this eliminated the problems.I was having. Here is my modified Arduino code. I changed the extension from .ino to .txt in order to upload. Just change it back and it will work fine. I noted where I commented out portions of the code. |
I forgot to mention that I alsi had to unhook the interrupt wire to get it to work properly. |
I didn't have issues with the 6050 but had trouble with fifo overruns on 9150. Switching from wire to fastwire fixed it for me. |
@jrowberg @wolframalpha After I updated the library, the DMP mode is working fine, but now, the raw values example firmware is crashing o.O |
What is the use of INT pin on MPU6050. Is it give interrupt only when the MPU in the motion or something else. |
I am also using MPU6050 with Arduino Mega and motors with motor driver-Cytron MDDS-10A. I tried with internal and external pullups of 2k2 both but still the same problem . |
Hi everyone.
I am using an Arduino Mega, and the MPU6050. I tested the MPU6050_DMP6 example and the Arduino crashing after a while. after extensive testing, I am reading raw data directly with getMotion6().
I posted on http://forum.arduino.cc/index.php?topic=166938.msg2163176#msg2163176
Some one had the same problem?
Thanks a lot!
The text was updated successfully, but these errors were encountered: