Before going into field testing, I will write how to evaluate GPS receiver.
The following methodology is based on an academic paper "A Methodology for the Evaluation of a GPS Receiver Performance in Telematics Applications". Although the paper's main interest is how to simulate GPS signal for evaluation, it also works as a good summary of how to field-test GPS modules.
Basic Idea
Evaluation of GPS receiver is difficult for the two reasons.
- Knowing precisely correct position, which is the "right answer" for GPS receiver, is not easy especially when receiver is moving.
- GPS signals and satellite locations can never be repeated.
For these reasons, one cost effective method is carrying two differently configured GPS receivers at once and comparing the received signal strengths.
Converting NMEA 0183 to GPSD JSON
Almost all consumer grade GPS receivers report their status in NMEA 0183 format. Although NMEA 0183 seems easy to handle as it is just a CSV text, it's actually a tough thing to know signal status of each satellite.
See the following example. We need 4 lines just to know S/N ratio and used / not used flag for a satellite. Colored numbers mean satellite #15 is used with S/N ratio 47 dB.
$GPGSA,A,3,15,05,13,21,28,,,,,,,,2.51,2.34,0.91*03
$GPGSV,3,1,09,13,63,020,46,15,61,303,47,05,51,107,46,42,48,179,*75
$GPGSV,3,2,09,21,31,303,40,28,13,070,42,193,,,,20,,,45*45
$GPGSV,3,3,09,24,,,37*72
In addition, there are many manufacturers' dialects and nuances in NMEA 0183.
Luckily, I discovered GPSD, which is open source NMEA 0183 parser and dispatcher to various GPS applications. Its official site is here. I use this software as a converter from NMEA 0183 to easy-to-handle intermediary representation.
See the example below for GPSD output of the above NMEA. PRN roughly means satellite number and ss stands for signal strength. It's much easier to handle, isn't it?
{
"class" : "SKY",
"device" : "/dev/pts/9",
"xdop" : 0.99, "ydop" : 2.48, "vdop" : 0.91, "tdop" : 1.95, "hdop" : 2.34,
"gdop" : 3.95, "pdop" : 2.51,
"satellites" : [
{"PRN" : 13, "el" : 63, "az" : 20, "ss" : 46, "used" : true },
{"PRN" : 15, "el" : 61, "az" : 303, "ss" : 47, "used" : true },
{"PRN" : 5, "el" : 51, "az" : 107, "ss" : 46, "used" : true },
{"PRN" : 129,"el" : 48, "az" : 179, "ss" : 0, "used" : false},
{"PRN" : 21, "el" : 31, "az" : 303, "ss" : 40, "used" : true },
{"PRN" : 28, "el" : 13, "az" : 70, "ss" : 42, "used" : true },
{"PRN" : 193,"el" : 0, "az" : 0, "ss" : 0, "used" : false},
{"PRN" : 20, "el" : 0, "az" : 0, "ss" : 45, "used" : false},
{"PRN" : 24, "el" : 0, "az" : 0, "ss" : 37, "used" : false}
]
}
Note that GPSD has a bug in satellite information part of JSON up until version 3.15 and falsely reports all satellites as unused. Version 3.15 is still the default version for Ubuntu 16.04, the latest LTS version. You may have to build it from the source code as I had to.
Once you have GPSD installed, the following command converts NMEA input to GPSD JSON. (grep is for excluding echoed NMEA input)
gpsfake -1 -p INPUT.nmea | grep -e '^\{' > OUTPUT.json
Converting GPSD JSON to Spreadsheet
The next step is to extract satellite signal information from GPSD JSON. I developed small Python script to easily browse GPSD JSON in spread sheet. The code and screenshot is available at GitHub.
https://github.com/takyanagida/gpsdjson2xlsx
The code is very small and simple, and so I make it public domain (CC0).
As described in README.md, you can have Excel file with the following piped command and see it with MS Excel or LibreOffice Calc.
gpsfake -1 -p INPUT.nmea | grep -e '^\{' | gpsdjson2xlsx.py OUTPUT.xlsx
Comparing signal receptions
The final step is to compare signal receptions of 2 GPS receivers.
Given GPSD JSON logs for GPS receiver A and B, the detailed step is:
- Manually extract an exact same time period from GPSD JSON of both A and B. This step is required because starting and stopping two receivers at exactly same time in field is impossible.
- Calculate mean for each satellite's signal strengths in spread sheet.
- Compare mean of each satellite for A and B.
Mean calculation is illustrated as below.
Comparison table looks like the table below. (numbers are fictious).
Sat# | A | B | Diff. |
---|---|---|---|
Total | 23 | ||
10 | 34 | 32 | 2 |
12 | 42 | 44 | -2 |
14 | 38 | 38 | 0 |
18 | 28 | 26 | 2 |
22 | 3 | 0 | 3 |
24 | 28 | 25 | 3 |
25 | 42 | 38 | 4 |
26 | 18 | 18 | 0 |
29 | 37 | 35 | 2 |
31 | 33 | 30 | 3 |
32 | 44 | 40 | 4 |
193 | 32 | 30 | 2 |
Total of differences can be either positive or negative, but it will be close to zero if two receiver's sensitivities are equal.