Jump to content
I2Cdevlib Forums

MPU6050 + GPS


Recommended Posts

Hi,

I've been working with the MPU6050 (using an Uno) and have successfully read data from the DMP using the interrupt (thanks to  Jeff Rowberg).  I'm now trying to add a gps unit (adafruit ultimate gps) to the project.  Ideally, I would like to read the DMP at 50 Hz and the gps at 5Hz, adding gps lat and lon data to the output when it is available.  The issue I'm having (I think) is that the frequency of the interrupt prevents the gps from updating its position through SoftwareSerial, if add a delay to allow the gps data to update, I get frequent FIFO overflow.  An example of the data output I'm looking for is below:

 

Example data format

q.w, q.x, q.y, q.z

q.w, q.x, q.y, q.z

q.w, q.x, q.y, q.z

q.w, q.x, q.y, q.z

q.w, q.x, q.y, q.z, lat, lon

q.w, q.x, q.y, q.z

q.w, q.x, q.y, q.z

q.w, q.x, q.y, q.z

q.w, q.x, q.y, q.z

q.w, q.x, q.y, q.z, lat, lon

...

 

Is this possible using DMP with the interrupt?  Or would it be better to read raw accel and gyro values and apply a Kalman filter?  Any thoughts or suggestions to point me in the right direction would be appreciated.  Thanks.

 

 

Link to comment
Share on other sites

Looks like its in the ballpark of 10 ms.  I was using the TinyGPS library, but have switched to the Adafruit_GPS library and think I've gotten close.  I used the timer interrupt from the Adafruit example which would check for new gps data every 1 ms.  I then used a 20 ms (50 Hz) timer to extract DMP data from the FIFO buffer.  There's still a slight backup when new data is read from the GPS, causing missed DMP output, trying to tweak that now.  

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...
×
×
  • Create New...