When I'm using the arduino GPS module it usually takes a couple of minutes for it to start sending data. And it seems that it's usually the case with all GPS modules since they need to "listen" to the satellites for some time. However whenever I use my phones internal GPS it find its position in a matter of seconds. Why is that?
-
16\$\begingroup\$ One word answer: "A-GPS" \$\endgroup\$– Agent_LCommented Aug 7, 2017 at 9:56
-
12\$\begingroup\$ That's not one word - it's a four word acronym! \$\endgroup\$– TransistorCommented Aug 7, 2017 at 13:58
-
11\$\begingroup\$ @Transistor Well if you want to get pedantic, A-GPS isn't an acronym, but an initialism. ;) \$\endgroup\$– DavidCAdamsCommented Aug 7, 2017 at 17:14
-
9\$\begingroup\$ @DavidCAdams: You're right! I looked them both up. I had never realised that an acronym is pronounced (or should at least, I presume, be pronounceable) as a word. The things I've learned on EE.SE! \$\endgroup\$– TransistorCommented Aug 7, 2017 at 17:19
-
1\$\begingroup\$ @DavidCAdams And all these years I've been going the NASA route of pronouncing A-GPS as "aggps", and now you're saying I can't do that any longer? The things you learn on EE.SE! \$\endgroup\$– userCommented Aug 8, 2017 at 10:56
6 Answers
There are several things which affect the time to first fix (TTFX).
Getting the almanac and ephemeris. These two things are technically a little different from each other, but for our purposes we'll treat them as the same. They are the locations of the satellites, and you need a to know where they are in order to work out your own position. Each satellite transmits the whole lot roughly once every 12 minutes. So from a completely cold start with a one-channel receiver and a decent signal, TTFX will be at least 12 minutes. You can speed things up by:
- Downloading from the internet instead - generally a good choice for phones. Downloading the almanac and ephemreris this way is known as MSB Assisted GPS.
- Remembering the almanac from last time (it's good for many weeks) and only downloading the ephemeris.
- Having more than one receiving channel in the device so you can listen to more than one satellite at once. The transmissions are staggered to make this work, and with some care you can use the ephemeris without an almanac which saves a lot of time. The vast majority of modules on the market these days have multiple channels, so it would be rare to find one which still needs 12 minutes.
Identifying satellites. You need to listen to at least three satellites, preferably more, to get a good fix, but each receiver (known as correlators) can only be tuned to one at a time. If you know roughly where you are, what time it is, and have an almanac already, then you can guess which satellites you can see. Phones tend to know roughly where they are from recognising wifi or bluetooth signals, knowing which cell tower they are using, and other sources. They regularly get very accurate time updates too, so they can usually go straight for the correct satellite. Both phones and larger modules can also remember when and where they were last used, and use that to start from.
Number of correlators. Due to the very low signal-to-noise of GPS signals, you need a special bit of hardware to receive them. Some receivers only have one, and need to rotate 'round the satellites. Others have more, and can listen to more at once. So even if you already have the almanac/ephemeris and know roughly where you are, then more correlators will still help you fix quicker. You might think more is always better, but more does increase cost and power consumption. Some phones and modules have more than others.
Signal and antennas. The correlators will do their job faster if you have a good signal-to-noise going into them. Very poor signals might not work at all. A good antenna design, amplifier, sky view, and good PCB layout can make all the difference. Some modules may work OK out of the box, and much better with an antenna plugged in.
Number of usable satellites. There are actually two large constellations of satellites up there, GPS (run by the USA) and GLONASS (run by Russia). There are also more under construction: Galileo (EU) and BeiDou-2 (China) and some with local coverage like India's NAVIC or BeiDou-1. A receiver which can work with satellites from more than one constellation has more satellites to chose from, and will get a quicker and more accurate fix.
Quality of correlators. New hardware designs are better than old ones, and will be able to pick out fragments of the GPS message in a noisy signal better. Another trick phones can do is to capture fragments of signal and pass them over the internet to a server with a very good software correlator, and complete almanac/ephemeris to examine. This is known as MSA Assisted GPS.
Some phones (and even a few modules) might also use some slightly sneaky tricks to avoid or hide a long TTFX. Since they are on all the time, they might briefly switch on the GPS without telling the user in order to keep the location and ephemeris roughly up to date. Others might display a recent position while still waiting for a real fix - which looks like a good TTFX most of the time, but looks bad if it turns out the position is very wrong.
Point 1 above is the thing that makes the most difference, and is usually the key thing that is different between basic modules, more advanced modules, and phones. The others usually make a smaller difference, but it can actually become a very complicated thing. If you want to read more, then "GPS time to first fix" is the term to search for.
-
33\$\begingroup\$ On point 2: In addition to WiFi, the phone may also get an approximate location based on the cellular base station(s) it is in contact with. \$\endgroup\$ Commented Aug 6, 2017 at 16:22
-
4\$\begingroup\$ A device might also "cache" the last known position data, use that immediately, and adjust it as real data comes in. My cellphone does this with it's GPS. \$\endgroup\$– rdtscCommented Aug 6, 2017 at 17:19
-
18\$\begingroup\$ In addition to the cell network, a number of providers (including Google) have built up databases of the physical locations of WiFi access points, which allows them to pinpoint a device's location surprisingly accurately. My cheap Android tablet has neither GPS nor cell access, yet Google Maps always seems to know exactly where I am, as long as I'm connected to a WAP. I suspect that they get the locations of the WAPs through an inverse process -- inferring it from the locations of connected phones and other devices that do have GPS. \$\endgroup\$ Commented Aug 6, 2017 at 17:21
-
5\$\begingroup\$ @ゼーロ Each frame is 35 seconds, but the complete almanac is split over 25 frames, and will take 12-13 minutes to transmit. It is true that you can obtain a fix from ephemeris data without the almanac, but you will need the almanac for 1) very old hardware, 2) accurate correction from GPS time to UTC and 3) ionospheric delay correction on some hardware. \$\endgroup\$– Jack BCommented Aug 7, 2017 at 9:53
-
4\$\begingroup\$ @ゼーロ Ummm. I was very clear that 12 minutes was for a single channel receiver. I also said that multi-channel receivers are faster. Most modern receivers are multi-channel, but I certainly have some older single channel ones - and they do take the full 12 minutes. And if you have a single channel and you want ionospheric delay correction, then there's no way to get it faster than the full almanac can be obtained. The fact that you use multi-channel modules and require a 3 minute TTFX doesn't mean that the other type doesn't exist. But I will update the answer to say the old type is rare. \$\endgroup\$– Jack BCommented Aug 7, 2017 at 14:00
The cell phone operating system downloads the GPS almanac data (satellite ephemeris and status information) over the internet via the cell network and loads it into the GPS module much faster than the it would take to download that from the GPS satellites directly at 50 bps (yes, that's 50 bits per second, GPS is rather old tech optimized for operation at very low SNR), significantly expediting the time to first fix. This is called Assisted GPS. It also likely has a very accurate initial time reference from the cell modem (the cell towers are usually time synced via GPS) as well as possibly a coarse location estimate from the cell modem. All of this combined drastically reduces the amount of searching that the receiver has to do - it knows what satellites it should be able to see, so it only looks for those, and it doesn't need to wait around to for the satellites to transmit the entire message.
-
\$\begingroup\$ So it basically takes out the "synchronization" out of the process. The GPS module searches for the satellite using data sent by satellite itself right? \$\endgroup\$ Commented Aug 6, 2017 at 14:58
-
3\$\begingroup\$ It doesn't take it out of the process, it accelerates it by giving the GPS receiver a good estimate to start from. \$\endgroup\$ Commented Aug 6, 2017 at 15:00
-
29\$\begingroup\$ The 50 bps isn't just because GPS is old. It is an integral part of how GPS receivers can detect the extremely weak signal, and how all the GPS satellites can transmit on a single frequency but still be received independently. Lots of complicated stuff goes on in a GPS receiver. \$\endgroup\$– JRECommented Aug 6, 2017 at 15:58
-
6\$\begingroup\$ @TomTom: No, the secrecy of GPS was never achieved by obscurity. You might be thinking of Selective Availability (SA), but that was an intentional positioning error. \$\endgroup\$– MSaltersCommented Aug 7, 2017 at 7:47
-
1\$\begingroup\$ @TomTom: The spread spectrum of GPS wasn't intended to hide the signals. It does have that effect for simple RF receivers, but that wasn't the point. The spread spectrum technique gives you two things: operation with extremely low signal to noise ratios, and a degree of immunity to jamming. Pretty much everybody and his brother knows (and knew way back when) which frequency GPS uses. No point in hiding what is already known. Not being (easily) jammed was a big plus, though. There are GPS jammers (now) but back then it was much more difficult to do. \$\endgroup\$– JRECommented Aug 8, 2017 at 16:39
The other answers have already explained the "how" and "why", so all that's left for me is the "what": it's called A-GPS (assisted GPS, sometimes also called accelerated or augmented GPS).
In other words: the reason why a phone's GPS works faster than a "GPS's GPS" is that the phone isn't using "GPS", it's using aGPS.
Part of the answer here is that cell phone GPS isn't just GPS. Cell also use other information for geolocation, such as triangulation of cell phone towers and the visibility of wifi networks. For example, the non-cellular version of the iPad Air doesn't have actual GPS but still knows where you are in built-up areas using these techniques.
-
4\$\begingroup\$ The question was specifically about how GPS operates. Cell phones can not triangulate from cell phone towers as there is no location information available from them. \$\endgroup\$ Commented Aug 6, 2017 at 17:17
-
6\$\begingroup\$ @Transistor The question compares stand-alone GPS to cellphone GPS and the question title specifically asks how cellphones do GPS faster than stand-alone GPS units. And Wikipedia says that cellphones do use tower triangulation to determine location. I'm not sure why you say there's no location information available: sure, the tower doesn't announce its location but roads don't announce their location either: your phone has a map stored in a database. \$\endgroup\$ Commented Aug 6, 2017 at 17:42
-
3\$\begingroup\$ @Transistor: the cellphone doesn't perform the triangulation. The network provider does. \$\endgroup\$ Commented Aug 7, 2017 at 5:09
-
2\$\begingroup\$ @JörgWMittag: Depends on the network AFAICT. Modern networks provide localization services as part of Enhanced 911 / E112. \$\endgroup\$– MSaltersCommented Aug 7, 2017 at 7:48
-
\$\begingroup\$ @DavidRicherby: Thanks for the link. I read through it twice but all I can see is that the location of the phone is known to the network - not to the phone. What have I missed? \$\endgroup\$ Commented Aug 7, 2017 at 7:50
Just wanted to put a little more detail in what is happening when the older receivers are waiting for data. In other words, why is that almanac (and remembered position) so useful?
The GPS signals are very weak. Given the distance, the signal is well below the noise floor when it reaches the earth. You'd never directly detect the satellite if you were simply watching a scope scan by the correct frequency.
The way the receiver gets information is by comparing the incoming signal with a specific pattern (via an FFT correlation). If the correct pattern is used, then the correlation lines up and the data can be seen.
For a simple, old-style receiver getting to this point requires two things from the device's correlator: the frequency of the message from the satellite, and the phase of the message (lining up the patterns). If either of these is incorrect, then the correlation is unsuccessful and nothing is detected. The motions of the satellites mean that the received signal is subject to relatively large Doppler shifts.
With an almanac in place and a good idea of the current location and time, the receiver can estimate the relative motions of satellite and receiver to remove most of the Doppler shift and come somewhat close to the frequency. That means the correlator can usually come up with a hit just by trying different phases for the signal pattern. This phase-space search can be done in a few seconds.
If the almanac is missing, or if there is no estimate of current location and time, the system has to try different phases and different frequencies to get data from each satellite. Now having to search in two different dimensions, it can take a few minutes for even a multi-channel system to "find" 3 satellites by brute force.
Modern chipsets can make use of additional signals and lots of parallel comparators to speed the search up, even without A-GPS being present. I suspect the chipset you get on an Arduino shield is probably older/cheaper and won't use these newer features.
In the US the FCC required cellular phone operators to be able to identify a caller's location when dialing emergency services to within 300 meters within 6 minutes of the initial phone call by September 11, 2012.
This was phased in gradually over the preceding years, and the requirement has been tightened in both distance and time to location report in the later years.
The cellular phone companies couldn't guarantee this in remote areas where only one or two cellular towers were within contact of the mobile phone, nor in urban environments where reflections and building density prevented location even when the phone had several towers it could receive. GPS chips couldn't provide this within the time frame required at a low enough power that the cell phone would still be commercially viable (at the time the requirement was introduced. chipsets are now much more power efficient and faster, partially due to the requirement that every phone include some or all of a GPS chipset). Further, GPS chipsets were very expensive relative to the other phone components.
So they created a few different competing systems which all fall under the moniker "AGPS" for Assisted GPS.
The technology that runs behind these various AGPS systems differs, sometimes greatly.
The cheapest cellular AGPS systems record several milliseconds of the GPS RF signal, send it to the AGPS server which then, knowing the phone's approximate location, can use that GPS RF snippet to determine a much more accurate position. These phones cannot obtain GPS coordinates without a good cellular connection.
Some have full GPS chipsets, but allow the phone to provide them with the almanac and ephemeris - two pieces of information which allow the chipset to then get a fix within seconds - after which it uses its normal methods to produce position results. Given time, these phones can obtain position independent of their network.
Most GPS chipsets allow you to load ephemeris and almanac information into them, so if your arduino device has an internet connection and you have access to an AGPS server you can speed up your GPS fix in a similar manner. However, for most projects simply adding a lithium coin cell battery to the right pin on the GPS receiver allows it to keep the last almanac and ephemeris update, and since the changes are small over short periods of time this greatly speeds up the first fix as long as the device hasn't moved thousands of miles, and is powered on every few days.