jd58 Posted February 5, 2014 Report Share Posted February 5, 2014 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. Quote Link to comment Share on other sites More sharing options...
luisrodenas Posted February 6, 2014 Report Share Posted February 6, 2014 Have you already changed the frecuency of DMP to your desired 50Hz? Quote Link to comment Share on other sites More sharing options...
jd58 Posted February 6, 2014 Author Report Share Posted February 6, 2014 Hi, Yes, I've changed the fifo rate to 50 Hz and the gps update rate to 5 Hz. Quote Link to comment Share on other sites More sharing options...
luisrodenas Posted February 6, 2014 Report Share Posted February 6, 2014 How long does it take to receive via softwareserial all the gps data? Quote Link to comment Share on other sites More sharing options...
jd58 Posted February 8, 2014 Author Report Share Posted February 8, 2014 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.