![]() |
Forum Index : Microcontroller and PC projects : GPS Parsing in MMBasic
Author | Message | ||||
Sasquatch![]() Guru ![]() Joined: 08/05/2020 Location: United StatesPosts: 377 |
Greetings and felicitations @MatherP and @GeoffG, The GPS parsing routines in MMBasic appear to be using floats throughout the parsing and conversion of the Lat and Lon from Degrees and minutes to decimal degrees. This gives a maximum resolution of a bit over a meter! It should be more like 18cm. Using doubles throughout the calculations would give a resolution much better than the GPS receivers. I found this by plotting GPS positions on a PicoMite VGA. I noticed the unusual granularity right away. Then I checked the latest code on GitHub. I suspect that this code has been used through the entire MMBasic line. Regards, -Carl |
||||
phil99![]() Guru ![]() Joined: 11/02/2018 Location: AustraliaPosts: 2640 |
Perhaps your GPS receiver is better than average making that improvement worth while. For many, a stationary receiver appears to wander about by several meters and float up and down by a few tens of meters. For my unit it would make it exactly wrong instead of approximately wrong! |
||||
Sasquatch![]() Guru ![]() Joined: 08/05/2020 Location: United StatesPosts: 377 |
@phil99 This depends on your location. There are "Satellite Based Augmentation Systems" (SBAS) for North America, most of Europe and Asia. There is a system for AU and NZ coming online in the next few years. Basically, ground stations at precisely known locations, calculate correction data and send it to a Geo-stationary satellite where the data is re-transmitted to your GPS receiver. All the modern receivers have this capability built in and the service is free to the public. Here in North America it is known as "Wide Area Augmentation System" or WAAS. "The main benefit of the WAAS is a greatly improved accuracy. Traditional GPS is accurate to 15 meters (about 50 feet). WAAS-enabled GPS is accurate to less than 3 meters 95 percent of the time." There are also ground based paid services that can increase the accuracy to about 1cm with the proper equipment. This is known as "Real-Time Kinematic" or RTK. The receivers for this cost a few hundred USD but the cost is coming down and free correction data is becoming more common in many locations. Regards, -Carl |
||||
Sasquatch![]() Guru ![]() Joined: 08/05/2020 Location: United StatesPosts: 377 |
Here is an example Plot on PicoMiteVGA This was taken with the GPS receiver in my basement work-room where reception is very poor and the WAAS data is not received. The scale is 1pixel/foot and the small circle is 10ft radius with the larger circle at 100ft radius. You can clearly see the "granularity" in the position data. ![]() -Carl |
||||
panky![]() Guru ![]() Joined: 02/10/2012 Location: AustraliaPosts: 1114 |
Interesting plot Sasquatch, are you able to upload the code that generated this plot please? Regards, Doug. ... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it! |
||||
Sasquatch![]() Guru ![]() Joined: 08/05/2020 Location: United StatesPosts: 377 |
I can upload it soon. It's a work in progress, I need to clean up the code a bit and I want to add the option to scale everything in meters. So give me a day or two and then I will upload what is working thus far. There are lots of possibilities here including storing some basic maps on SD card and overlaying the GPS track in real-time. I also want to be able to use an LCD display for portable use. Regards, -Carl |
||||
Sasquatch![]() Guru ![]() Joined: 08/05/2020 Location: United StatesPosts: 377 |
Interesting plot Sasquatch, are you able to upload the code that generated this plot please? Regards, Doug. Here is a working version, Keep in mind it's a work in progress. GPSPlot.zip ' GPS Plotter V0.5 ' By The Sasquatch www.TheBackShed.com ' For PicoMiteVGA or PicoMite with LCD minimum 320X240 ' and probably other 'Mites with little or no modificaton ' Expects GPS NMEA messages on COM1: GP1,GP0 ' PPS signal on Pin GP2 (Pin 4) ' Press "Q" to quit ' Press "U" key to sync time ' Press "R" to Refresh (Clear) Plot and recenter ' Press "S" to Save as .BMP ' Set PPSPin to 0 if not available but timing will be less precise Parameters: PPSPin = 4 'Pin Number for PPS strobe. Set 0 for No PPS UTCOffset = -6 'Local Offset from GMT UseFeet = 0 'Set to 1 for feet and MPH, 0 for meters and KPH Edited 2022-07-26 06:14 by Sasquatch -Carl |
||||
Sasquatch![]() Guru ![]() Joined: 08/05/2020 Location: United StatesPosts: 377 |
Ok, I finally had some time to look at this (see the OP) @matherp modified the GPS code to allow for double precision variables. I then realized there were other limitations with the way the Latitude and Longitude were being parsed and converted from degrees and minutes to decimal degrees (DDMM.mmmm format to DD.ddddddd) After a bit of research, the actual code changes weren't that major, then I spent about a week testing the new code. The attached GPS.c file has been modified to allow increased resolution for Latitude and Longitude. There are no changes to GPS.h These code changes have been tested against several generations of GPS modules with a PicoMiteVGA. I also plan to test on CMM2,MMX,and ArmMiteH7. For those who may be a bit confused right now, GPS.c is a source file used to build the firmware. GPS.zip -Carl |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |