I have been working on creating my first drone. I began this project by testing my own arduino based PID controller. Then I moved on to actually installing the PID and accelerometer/gyroscope into an RC glider to test for level flight (http://www.instructables.com/id/Intro-to-Model-Airplane-Autopilot/). I am moving on to a powered plane(I am starting with an E-flite UltraStick, and moving on to a water plane I have built once I have successful beta testing). I want to use cascading PIDs and a GPS to set the attitude my plane needs to reach desired waypoints.
The problem is: my accelerometer and gyroscope refresh at about 20Hz while my GPS only refreshes at about 1Hz- I am using a parallax PMB 648, a cheapy, I know. In my loop function I tell the controller to get the accelerometer/gyroscope data (which comes in almost instantly), and then I have to wait a full second for the GPS data. So the plane would be unable to monitor and control its attitude while the GPS is refreshing. Is there a way to solve this problem without buying a faster GPS??
I tried setting up an interrupt function last night, but I couldjnot get it to work. In addition, the GPS communicates with the arduino serially, and from what I have heard this is not ideal for setting up interrupts.
Any help would be much appreciated!!!