Jump to content
I2Cdevlib Forums


  • Posts

  • Joined

  • Last visited

  • Days Won


titous last won the day on October 28 2014

titous had the most liked content!

Recent Profile Visitors

929 profile views

titous's Achievements

  1. so far my implementation seems to work; it's not so elegant but it does the trick
  2. A little update on the hanging issue: I've tracked it down to the first call of a I2C function, in most cases this occurs during the initialize() function which calls some sort of writeBits() To get around this, I've put a bit of the standard I2C bus scanner into the code, right after the Wire.begin(): // test the connection to the I2C bus, sometimes it doesn't connect // keep trying to connect to I2C bus if we get an error boolean error = true; while (error) { Wire.beginTransmission(mpu.getAddr()); error = Wire.endTransmission(); // if error = 0, we are properly connected if (error) { // if we aren't properly connected, try connecting again and loop Serial.println(" "); Serial.println("Not properly connected to I2C, trying again"); Serial.println(" "); Wire.begin(); TWBR = 24; // 400kHz I2C clock } } Serial.println("Properly connected to I2C"); I also ended up writing my own library function getAddr() - if you want to try this code yourself, just replace that function with 104 (if you've got the AD0 pin low or 105 if it's high). I'm hoping this will fix things; I haven't been able to confirm since I can't reproduce the hang on my own (it seems intermittent).
  3. What do you mean by jump around? Can you post some of the serial output? Also, how are you calculating your ypr values? Perhaps you haven't implemented the conversion from quaternion to ypr correctly. If you mix up the order of the quaterion (w, x, y, z or x, y, z, w for example) that will make your ypr go crazy
  4. Interesting, I'm definitely interested in using the HMC5883L along with the DMP data, so I'll take a look at your sketch once my PCBs come in. Have you seen the following? http://franciscoraulortega.com/pubs/Algo3DFusionsMems.pdf Using their approach you could fuse the DMP data along with the magnetometer data (equations 7 - 9 in the paper), at a relatively cheap cost of a few trig function multiplications, to get an even more accurate response. Could be a good approach before the sensor fusion of all thee sensors is figured out.
  5. Sure, I'll keep ya'll posted. Quick question, you mention you're running DMP at 200Hz but it seems like I read a warning about that bandwidth being noisy, can you comment on that?
  6. hey dvon! I'll look into what you've mentioned in a bit; in the mean time, the link you provided is 404 - is this the correct one? I've done a bit more testing and it does look like the sketch is hanging in the setClockSource() function; I'll investigate it when I've got some free time.
  7. Hey everyone! I've got my MPU6050 hooked-up to my Arduino UNO and have the DMP sketch running just find and dandy, sometimes... At times, the code will hang at "Initializing I2C devices..."; at other times it runs as expected. I'm having a hard time recreating the error; I don't think it's a hardware thing (loose wires perhaps since I'm still breadboarding) because I've got it sitting on my desk and without touching it the error comes up & then goes away with a simple re-compile of the sketch. I've put some print statements in the initialize() function to see which sub-function might be causing the issue and I've narrowed it down to setClockSource() Has anyone else experienced this or is this just on my end? Thanks!
  8. Hey everyone! Thought I'd share my version of an auto-offset calibration sketch; it converges all offsets in about 20s or so. Just upload and watch the serial (at 38400bps)! A note on how it works/converges: - the code takes an initial guess for each offset (supplied at the top of the sketch), takes a certain number of readings from the MPU-6050 (the # of readings it takes is defined by countMax), and averages those number of readings. If that average is less than the value errorCheck, it assumes that axis has converged - if the average isn't less than errorCheck, it will subtract a certain amount from the initial guess - if the errorCheck you set is too small, or the initial guess is smaller than what the solution is, it wont converge - in this case either choose a larger value for errorCheck or a larger initial guess I've given some initial guesses / settings which should help you get to where you need to be; just watch the serial - it'll tell you what the average reading from the MPU-6050 was for each guess, you'll want that average to be as close to 0 as possible for each axis. Enjoy! MPU6050_calibration.zip
  9. Hey everyone reading! I'm trying to get 9DOF working by using an MPU6050 (on a GY-521 breakout) along with an HMC5883L. I've got both the examples (RAW and DMP) working on my MPU6050 with just the MPU6050 hooked-up. Now I'm wondering about how to extend functionality by adding the HMC5883L through the auxiliary I2C bus of the MPU6050. Will the MPU6050 DMP example work with the HMC5883L hooked-up to the MPU6050? What should I do to get them both working together nicely? I can't seem to find any documentation on this, besides using each sensor independently of the other. Thanks for the help!
  • Create New...