PDA

View Full Version : Discussion GPS data feed software


Dan_Jones
May 21, 2007, 04:47 PM
While making my own autopilot, I needed a way to output GPS data and I needed to control the speed at which it ran. This small Windows application loads a text file containing GPS sentences and then outputs each line to the serial port one at a time. This is intended to be used in conjunction with a USB based GPS and a laptop computer. Simply drive around town while logging the GPS data. Then using this software, load that log file and set it running.

The reason this is necessary is that some algorithms expect there to be differences in GPS coordinates for direction and speed to be calculated. If the GPS is sitting on the table, checking those algorithms is imposible.

The software can output the data at 4800 baud with delays in between the lines ranging from 1/4 second to 4 seconds. The data can be paused and resumed to help facilitate debugging. It automatically appends the <CR><LF> characters to the end of each ascii line to make the data true NEMA format.

I am actaully looking for feedback because this software will be available for purchase on my website for about $5.00 once all the bugs get worked out. So please download it and use it. Please let me know if you have any suggestions and I will do my best to work them into the app.

http://www.dionysusdesign.com/files/GPS Simulator.zip

Thanks!

wfwg
May 21, 2007, 08:31 PM
I am building my simple uav. Your software is my needed.
Thanks! :) :)

toxicmouse
May 23, 2007, 09:53 AM
hi Dan,

are you trying to test navigation software? i am trying to test my navigation algorithms, and came a similar solution to yours. the main difference is that i am inputing the coords manually which is very tedious (compute time is much smaller than GPS update rate, so not bothered about real time data input). the main problem i would imagine with feeding coords in like your program is that the program cannot tell if the navigation algorithm has failed. how do you monitor the results? how can you tell if the aircraft has banked in the right direction, for example? say, if the algorithm did not allow for a sharp turn (as you may have driving in a car), then how would the algorithm be affected?

cheers

Dan_Jones
May 24, 2007, 12:14 AM
At my stage of development, I am very interested in the validity of the data since my algorithm uses each sentence to calculate the direction the airplane is traveling in. I watch a LCD with direction, intended direction, position and a validity score to make sure everything is working correctly. Once that is complete, I suppose the next step would be to write a simulator that takes the servo output of the UAV and uses that to update the coordinates. The problem with the simulator is that simple ones are always best case scenarios. For instance, when I drive around and collect data, stopping at stop lights makes the GPS data pile up at one position. This would be bad if it happened in the air! Weird wind gusts could slow down the airplane so that it does contain GPS data that are bunched together. Using this program that I wrote, I watch my 'validity' score to make sure the algorithm knows that something funky just happened. If that is the case, then the autopilot direction calculation code skips that iteration and continues to use the gyro to have a general indication of what is happening.

So you are correct, this software is somewhat limited. But it was what I needed at the time. Now that you got me thinking about it, the next thing that I would like is an application that generates GPS coordinates. When the actual autopilot circuit changes the rudder servo, the new servo position could easily be sent to the serial port and collected by the software. The generated GPS data could then be affected by that servo position. This would work just fine for the GPS code, but if you are using a gyro in conjunction with a GPS then it will be difficult to simulate that as well. (I think).

The best possible solution would be a simulator that hooks up to the autopilot circuit and totally simulates actual flying. It would also need to have random occurances like wind too. If anybody knows of software like that, please let me know before I go waste a week writing it! :)

Mark Harris
May 24, 2007, 01:38 AM
You could just record a flight with all your sensor data to run through the autopilot to see what it's response would be :)

wfwg
May 24, 2007, 07:53 PM
Hi, I got a software from google search that can simulate some machine output the NMEA sentences like gps,rada,etc.
You can use it for your project.
best regard :) :) :)

kd7ost
May 24, 2007, 09:22 PM
I would want one that used the GGA string as well as the RMC. I have projects and know of others with projects that could use altitude.

What would also be cool is if after recording, you could edit data in the strings to change altitudes that didn't really occur and etc.

Dan

toxicmouse
May 26, 2007, 09:59 PM
apologies for taking so long to respond, i've been away.

Dan, i am interested in your "validity score". the way i have got a useful bearing is to separate the actions of the aircraft into either turning or straight flight. as soon as the aircraft starts a straight flight path the GPS location is stored into a register and used to calculate bearing until the next turning routine starts. i suppose the greater the distance between the GPS location in the register and the current location, the more accurate the bearing will be (assuming constant HDOP). how would you then use this "validity" data? is it just a way for you to assess the quality of the info during development?

the next stage of your development is the part i cant really get my head around, yet. i have not been able to do enough testing in flight to get a good turning algorithm, so i could have an output from the controller to say "need to turn x degrees left"
but i would not get sensible results if i linked the servos to a simulator. also, i would be impressed if it would only take you a week to write such software.

cheers

ThaiskyDigital
May 27, 2007, 06:02 AM
I am not so clear about your discuss, for me if I have any GPS data

I feed them with Mapsource then i use google eart gps visuaalizer as link below.

http://www.gpsvisualizer.com/map?form=googleearth

However now I am interesting to let my airplane sent the GPS data real time and show the moving in the map, do they have such a software like this?

Dan_Jones
Jun 01, 2007, 03:10 AM
ThaiskyDigital, I know they have software that allows google earth to be updated real time. Maybe somebody else remembers what the name of it is.

Toxicmouse, I just can't imagine flying without some sort of check on the data. If the GPS data doesn't move or goes in a direction that I wasn't expecting, I simply skip that frame and wait for the next one. The gyro does keep track of where we are pointing.

Moving forward, I am working on the second application. This one requires a little more explaination and I am curious if anyone else needs something like this too.

This app tests the GPS direction finding and the gyro. It generates GPS data just like a GPS would. The data changes based on the speed and the direction. The direction value is read back from the autopilot. The speed is controlled with the software.

The idea here is to modify a rudder servo to spin continuously. Combined with some gearing, it should be able to spin the whole autopilot circuit just like if the airplane was flying and the rudder was moved to one side. This is the crutial part because the gyro plays such a big role in navigation. The autopilot circuit should have a general idea of what virtual direction it is headed in, so that direction is sent back to the software using the serial port (which is already connected because the software is generating the GPS frames).

Using the estimated direction supplied by the autopilot circuit, the software generates new GPS coordinates. In theory, those new coordinates would allow the autopilot to obtain a new heading and position. The autopilot would theoretically control the flight based on waypoints and the software just mimics the GPS data.

Would this be helpful at all???

Dan_Jones
Jun 01, 2007, 03:35 AM
Here is a pic of my geared platform. Please don't mind the mess and the shoddy balsa work. It is a proof of concept that still has yet to be proven!