Shop OBEX P1 Docs P2 Docs Learn Events
DIY Differential GPS? No, but maybe something better... — Parallax Forums

DIY Differential GPS? No, but maybe something better...

Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
edited 2013-07-28 15:57 in General Discussion
The results are negative, I'm afraid. But a negative result is still a reportable result, even though it rates as the Miss Congeniality of scientific research. :) Not entirely true. See post #32 for some positive results. So here goes...

I recently came into possession of some Parallax gear that let me easily perform an experiment I've been contemplating for a long time. (Thanks, Ken!) Using two PropBOEs (#32800) powered by Li-ion rechargeables (#28986 and #28988) and two identical PMB-648 GPS receivers (#28500), which I already had, I was able to put together a pair of portable GPS recording stations:

attachment.php?attachmentid=93715&d=1340558679

The idea was to set them side-by-side at a fixed location, exposed to the sky, and to see how well they tracked each other. IOW, if one shifted its position by X cm, and the other did the same, simultaneously, there would be some hope of using one as a base station as the other roamed about. The base station's GPS location could then be used as a correction factor for the roaming GPS's position.

So I put both on my garage roof in waterproof plastic GladWare containers (it was raining) and let them record their GPS times and positions to SD cards for about six hours. (It could have gone longer than that, but the batteries in one unit ran down. I guess they didn't get a full charge.) But six hours was long enough to know I was on the wrong track. Here's the tale of the tape (actual positions being obfuscated, of course):

attachment.php?attachmentid=93716&d=1340559872

As you can see, GPS 0 changed its apparent position, probably due to losing or gaining access to one of the satellites. GPS 1 kept recording the same position. In fact, it recorded the same position for the entire six hours, which says a lot for that little PMB-648!

Attached is the program I used, in case anyone else wants to try it out for themselves.

-Phil
«1

Comments

  • W9GFOW9GFO Posts: 4,010
    edited 2012-06-24 13:55
    Is that reporting position to the ten thousandth of a minute? That would be about a 6" resolution then right?

    I've never seen a GPS to report the exact same position for an extended period of time.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-06-24 14:01
    Yes, 1/10000 min. In terms of latitude, that's about 0.6 ft. In terms of longitude at this latitude it's about 0.4 ft.
    I've never seen a GPS to report the exact same position for an extended period of time.
    It's a first for me, too. The PMB-648 has WAAS, so that might be a factor.

    -Phil
  • W9GFOW9GFO Posts: 4,010
    edited 2012-06-24 14:07
    Sounds too good to be true...
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-06-24 14:26
    Yeah, I know. That's one reason I posted my code -- in case anyone wants to double-check it. No data got recorded unless the GPRMC status was "A" (actve). And the unit 0 GPS did eventually change position. Other than the unchanging position, I did not notice any odd behavior in the equipment or the readings I got from it.

    -Phil
  • max72max72 Posts: 1,155
    edited 2012-06-24 14:32
    some GPS have the option to "lock" a position unless there is a change above a certain threshold. I would expect fluctuation at every reading.
    There was a thread in the past discussing this unnatural stillness, have to look for it.
    I'm not sure to have two units at hand, but this is getting intriguing..
    Massimo
  • W9GFOW9GFO Posts: 4,010
    edited 2012-06-24 14:41
    I think a good test would be to run them for a few hours side by side but cycle the power to the GPS every few minutes. Or, move them both between two points a few meters apart at regular intervals.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-06-24 14:41
    I probably ought to investigate the PMB-648's options a little further. It has an input pin, so I suspect some reconfiguration is possible. Maybe, if there's position locking, it can be turned off.

    -Phil
  • xanaduxanadu Posts: 3,347
    edited 2012-06-24 15:00
    I've been wanting to try this but wouldn't know where to begin thank you!

    On a good day if a GPS has a fix on multiple satellites it could easily report the same position for a long time. To get 6" you just need enough satellites and a clear view of the sky. I have witnessed this many times planting a geocach with someone who insisted we left both GPS side by side for 15 minutes and recorded the average position before posting its location. Once the position fix settles it shouldn't change unless the above happens. I think the issue with the one that lost its position was due losing a fix, like you said, and if you could log the signal and tracking along with the position it could provide more info.
  • tobdectobdec Posts: 267
    edited 2012-06-24 15:07
    If they're that freakin accurate I'll order one soon. Someone else try this that has the hardware to do it please!
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-06-24 15:09
    Thanks, max72! This is the info I need. I guess the experiment is back on as soon as the batteries are recharged.

    -Phil
  • W9GFOW9GFO Posts: 4,010
    edited 2012-06-24 20:21
    xanadu wrote: »
    Once the position fix settles it shouldn't change unless the above happens.

    That makes sense for the position that is being displayed on the unit but the calculated "raw" position is always going to be continuously changing by small amounts. I did not expect that the bare GPS module would be filtering, but as Max72 pointed out there is a default configuration that "locks" onto a fix and doesn't change it until a threshold is reached. For robotics uses we would want to control what that threshold was.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-06-24 20:28
    Ideally, such a threshold would be zero, so we could set (or not) the threshold ourselves in our own position-determining code.

    -Phil
  • max72max72 Posts: 1,155
    edited 2012-06-25 00:15
    This position locking is used in a logging context.
    Suppose you stay still in the same place all the day. Logging the raw data and calculating the distance travelled will bring results that a user would consider not acceptable. So probably many units ships with this option enabled.
    I agree in robotics context, and with slowly moving units the data should come raw and offer us the possibility to decide if filtering is required and up to what amount.

    Massimo
  • xanaduxanadu Posts: 3,347
    edited 2012-06-25 10:56
    W9GFO wrote: »
    That makes sense for the position that is being displayed on the unit but the calculated "raw" position is always going to be continuously changing by small amounts. I did not expect that the bare GPS module would be filtering, but as Max72 pointed out there is a default configuration that "locks" onto a fix and doesn't change it until a threshold is reached. For robotics uses we would want to control what that threshold was.

    Okay yeah that makes sense, they were both Garmins and used positioning averaging, so I retract that whole statement.

    I see now they have 'position pinning' too, very vague about it on Google. That sounds like what the GPS Phil has is doing.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-06-25 20:50
    I finally got things working with the "position fix" feature turned off, and it made a big difference. But the results I obtained still point in the negative direction. The following graphs illustrate the joint latitude and longitude measurements of two GPS units placed right next to each other, taken at five-second intervals over 34 minutes:

    attachment.php?attachmentid=93746&d=1340682561attachment.php?attachmentid=93745&d=1340682561

    If the two units had accurately tracked each other, the dots in these two graphs would have lain along a straight line with slope equal to one. That they're quite spread out instead indicates that they do not track each other very well.

    Tomorrow I will run the experiment for several hours to see if there are any larger-scale trends that might prove helpful over the long run.

    -Phil
    375 x 369 - 9K
    375 x 369 - 11K
  • xanaduxanadu Posts: 3,347
    edited 2012-06-25 21:18
    Both GPS spewing data was what we were after. The base station in a differential setup is supposed to be a timing reference for a mobile GPS. I think that it only detects timing errors and tells the mobile GPS to ignore those errors. I don't think its own position matters except for the reference time comparison to the mobile GPS, and has to be within some range. It uses measured position to calculate timing, instead of using timing signals to work out its position. So time from both one, relative position data from the other. I think. From what I have read that distance has to be 'very accurately marked and surveyed'.
  • Ken GraceyKen Gracey Posts: 7,387
    edited 2012-06-25 21:22
    Hey Phil,

    The PMB-648/688 are from Polstar in Hsinchu City, Taipei, Taiwan. Sometimes the datasheets can be a bit empty of real engineering details, so feel free to ask me if there's something you need to know that's not shown in our documentation. We're in the midst of ordering another 2K units of these modules which last over a year, so it's good to know that you're going to be eating them like Elevated Ice Cream sundaes from Port Townsend this year.

    It's always been my understanding from customers that the Polstar modules are high quality hardware. Let me know if you want to do a test with the VPN1513s because I can send them off tomorrow (use e-mail to make the request in case I don't check back).

    Ken Gracey
  • max72max72 Posts: 1,155
    edited 2012-06-26 07:34
    Phil, it looks there is an effect, I think it is promising.
    Could you calculate the relative distance between the two units for each point?
    I'm trying to replicate your set-up with other GPS receivers, but have to fix a couple of hardware issues.
    Massimo
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-06-26 08:15
    max72,

    Visually, there does seem to be a positive correlation, which would lead one to believe that some benefit could be had from operating in differential mode. However, the standard deviations of the lat and lon readings compared with those of the differences in those readings between the two units is about the same. What I need to compute is the "circle of confusion" for the individual units and compare that with the same number for the difference.

    Bear in mind that this was only a brief experiment that may not have encompassed any satellite changes. A longer experiment my reveal a stronger correlation. That's what I plan to do today. Now that the two units are "unlocked", there may also be some advantage in applying statistical methods to the readings, such as a running median or running average.

    -Phil
  • FranklinFranklin Posts: 4,747
    edited 2012-06-26 11:54
    Phil, is there a way to select satellites that the GPS listens to? It might improve if you were listening to the same set of inputs.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-06-26 12:04
    Franklin,

    Good question, and I just don't know the answer. The GPS can report which satellites are available and does that by default, but I've got that feature turned off. But you're right: if there were a way to guarantee that both receivers used the same satellites, the correlation between them could be much better.

    -Phil
  • max72max72 Posts: 1,155
    edited 2012-06-26 14:12
    In the units I tested I never found a description of satellite selection. Another aspect never discussed is multipath.
    Anyway I have a couple of units logging on the roof tonight.
    Hope to have some data tomorrow.
    The units are these:
    http://it.mouser.com/ProductDetail/Maestro-Wireless-Solutions/A1035-H/?qs=%252bWnEOWq1JvHJhMHQaiggIH6D%252bnFHEn8X
    They are much slower before fixing wrt units sold by Parallax, but they solder directly on the PCB, and sometimes it is a nice option.
  • max72max72 Posts: 1,155
    edited 2012-06-27 03:37
    Ok, no luck here...
    The units weren't in the best place, but the results are not nice at all.
    I calculated the distance of the single units from the average lat and long of each unit, and the relative distance of the difference.
    I took the measurements every second overnight.
    Had 2 hours of blackout of one of the two units while the other kept logging.
    I also had some holes around from both, so probably GPS position wasn't so good.
    A attached a distribution of the distances form the average coordinates and realtive distance. Attached is also a cumulative distribution.
    Error distribution.png
    Cumulative.png

    Massimo
    481 x 289 - 8K
    481 x 289 - 10K
  • xanaduxanadu Posts: 3,347
    edited 2012-06-27 09:56
    Sorry, but I do not understand why two correlating positions would mean it is working? You can have other errors in position.

    The atmosphere over both GPS is identical, we need to correct for that identical atmospheric timing error.


    Base Station: GPS pseudorange time - (speed of light/distance to fixed point) = timing delay

    Rover: GPS Pseudorange time - timing delay + other errors = greater accuracy.
  • tingotingo Posts: 87
    edited 2012-06-27 10:25
    Question: does the units affect each other if they are close? Would there be any benefit in keeping them longer away from each other?
  • BitsBits Posts: 414
    edited 2012-06-27 10:42
    Tingo, I would say no that they should not, its a receiver.

    All I can say is that I now have Phil's Garage address. :thumb:

    Also why would a particular locked in satellites matter? Math is Math right? I suspect this may just be a GPS transmitted signal precision issue. Is it not true that GPS is altered intentionally so that handmade rockets and the likes would be less accurate? Its a security issue?

    Edit.. For what its worth I have 5 GPS modules (all the same but different than Phil's). Perhaps I can recreate what you have done and compare what the data suggest.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-06-27 10:47
    Bits wrote:
    All I can say is that I now have Phil's Garage address.
    So you think. Apparently you missed this caveat in my first post: "... actual positions being obfuscated, of course" :)

    -Phil
  • BitsBits Posts: 414
    edited 2012-06-27 10:54
    Oh heck the flowers are on the way!! Lol I sort of was teasing the hacker mind if you will.
  • xanaduxanadu Posts: 3,347
    edited 2012-06-27 11:05
    Bits wrote: »
    Also why would a particular locked in satellites matter? Math is Math right? I suspect this may just be a GPS transmitted signal precision issue. Is it not true that GPS is altered intentionally so that handmade rockets and the likes would be less accurate? Its a security issue?

    The locked in satellites matter because the base station is only sending correction data for the satellites it can track, and the correction only helps if it is applied to those same signals on the mobile side of things.

    DGPS came out after SA (selective availability) which was purposely induced errors to prevent GPS from being used against us, missile tracking, etc. Then DGPS eventually led way to WAAS. WAAS was brought on by the FAA as far as I know. But, all of this took place on the civilian GPS channels. There is another encrypted GPS signal that is much more accurate that only the government has access to.
Sign In or Register to comment.