[time-nuts] GSP+PPP and GPSDO NTP servers - notes and questions

Adam Kumiszcza akumiszcza at gmail.com
Thu Nov 7 11:15:57 UTC 2019


Hi!

So now I have two NTP servers, in different locations:
1. zegar, a Raspberry Pi 3B+ with uputronics hat featuring u-blox MAX-M8Q
chip.
2. gpsdo, a PC connected via serial cable to BG7TBL GPSDO with Trimble
73090 OCXO and u-blox 7-series chip.

Zegar is configured using Phil Randal's fork of gpsctl (
https://github.com/philrandal/gpsctl) that sets it to UBX (binary), selects
GPS, Galileo and GLONASS, turns off SBAS, puts it to stationary mode and
sets some additional filters. Because of that I don't use gpsd, just direct
PPS and GPS ntp clock drivers:

GPSDO is connected to FreeBSD 12.0 amd64 system with modified kernel (PPS
enabled). Only GPS satellites used (u-blox 7 is one system only),

Some of the things I've noticed while configuring both, might be useful for
somebody:
1. To calculate fudgetime2 of GPS NMEA driver you can set GPS as noselect
and calculate the vallue from peerstats, but I think it's easier to add 128
to GPS NMEA driver mode for some time (as per
https://www.eecis.udel.edu/~mills/ntp/html/drivers/driver20.html) and then
calculate the offset of a given NMEA command by something like:
#!/bin/sh
#
awk '
/GGA$/ { sum += $5 ; cnt++; }
END { printf("%.6f\n", sum / cnt); }
' </var/log/ntpstats/clockstats

The offset depends on the number of NMEA commands turned on. When I had all
NMEA commands enabled, $GGA offset was ~0.067, when I left only $GGA, it
decreased to ~0.055.

2. If you choose to use GGA command for the driver (mode 2), then you get
additional informations about satellite fix and number of satellites used.
You can get it directly by issuing
ntpq -c clockvar
or in clockstats file. Listening to serial port otherwise will probably
disturb ntp daemon. This way is safe.

3. On FreeBSD you can get PPS signal on either CTS or DCD line of RS232.
See
https://www.freebsd.org/cgi/man.cgi?query=uart&sektion=4&manpath=freebsd-release-ports.
For BG7TBL (CTS line) I use sysctl dev.uart.0.pps_mode=0x01. Thanks you,
Fiorenzo Cattaneo, for pointing me to this.

4. You can use PPS and GPS drivers separately (flag1 0 in GPS, set it on
prefer), or just GPS driver (flag1 1 enables PPS processing, flag3 can be
used for kernel mode). I've noticed that when I had Internet connection
problems (no other valid servers), single GPS configuration was better. I
got both PPS and GPS source excluded (marked 'x'). I'm not sure why it
happened.

Questions:

1. As you can see from the graphs (made by great NTPplotter by David
Taylor, thanks!) and screenshots from my simple perl script, the jitter of
GPSDO is smaller than Raspberry, but the offset changes a lot, often goes
beyond 4 µs. What could be the cause? As I understand, having low jitter is
a more reliable benchmark than low offset?

2. Is there a noticable profit of using ntpsec instead of original ntp
here? https://www.ntpsec.org/accomplishments.html claims they have
increased accuracy particularly for GPSDOs. Or maybe chrony?

3. I would like to share PPS signal (alone, onto DCD line of RS232). What
do you suggest I use for this?

Cheers,
Adam Kumiszcza
-------------- next part --------------
A non-text attachment was scrubbed...
Name: zegar_stats_pl.png
Type: image/png
Size: 39236 bytes
Desc: not available
URL: <http://febo.com/pipermail/time-nuts_lists.febo.com/attachments/20191107/f719a16c/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: zegar_2019-11-03_jitter.png
Type: image/png
Size: 24085 bytes
Desc: not available
URL: <http://febo.com/pipermail/time-nuts_lists.febo.com/attachments/20191107/f719a16c/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: zegar_2019-11-03_offset.png
Type: image/png
Size: 30757 bytes
Desc: not available
URL: <http://febo.com/pipermail/time-nuts_lists.febo.com/attachments/20191107/f719a16c/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: zegar_histogram.png
Type: image/png
Size: 13991 bytes
Desc: not available
URL: <http://febo.com/pipermail/time-nuts_lists.febo.com/attachments/20191107/f719a16c/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: GPSDO_histogram.png
Type: image/png
Size: 13065 bytes
Desc: not available
URL: <http://febo.com/pipermail/time-nuts_lists.febo.com/attachments/20191107/f719a16c/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: GPSDO_2019-11-05_jitter.png
Type: image/png
Size: 21111 bytes
Desc: not available
URL: <http://febo.com/pipermail/time-nuts_lists.febo.com/attachments/20191107/f719a16c/attachment-0005.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: GPSDO_2019-11-05_offset.png
Type: image/png
Size: 28915 bytes
Desc: not available
URL: <http://febo.com/pipermail/time-nuts_lists.febo.com/attachments/20191107/f719a16c/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gpsdo_stats_pl.png
Type: image/png
Size: 58082 bytes
Desc: not available
URL: <http://febo.com/pipermail/time-nuts_lists.febo.com/attachments/20191107/f719a16c/attachment-0007.png>


More information about the Time-nuts_lists.febo.com mailing list