[ntp:questions] How to debug GPS PPS?

David Lord snews at lordynet.org
Mon Dec 28 12:25:28 UTC 2009


xyz-2041 wrote:
> Plugged in the GPS unit's serial cable into a Windows
> computer running WinOncore12 v1.0 (Build 37):
> 
>   http://www.google.com/#q=WinOncore12Installation.exe
> 
> Seemed to work without any problems.  Generated
> all sort of graphs and charts.  Let it run and it
> told me exact latitude, longitude and height above
> sea level.
> 
> Used an analog volt meter and from pin 5 (supposed
> to be ground), I only noticed voltage on pins 2 and 3.
> Pin 2 was going erratically negative once a second.
> I believe that this must be received data as per
> standards.  Pin 3 was +5 volts, but dropping to
> -5 volts once per second.
> 
> I've changed my configs a bit, /var/log/ntp.log and
> /var/log/ntpd.log don't show any errors.
> 
> However, "ntpq -c pe" still doesn't show any response:
> 
>  GPS_NMEA(0)     .GPS.            0 l    -   16    0    0.000
> 0.000   0.001
>  PPS(0)          .GPS.            0 l    -   16    0    0.000
> 0.000   0.001
>  GPS_ONCORE(0)   .GPS-.           0 l    -   16    0    0.000
> 0.000   0.001
> 
> Also:
> 
> ntpdc -c kerninfo
> pll offset:           -0.00539973 s
> pll frequency:        -46.079 ppm
> maximum error:        0.097522 s
> estimated error:      0.003708 s
> status:               2201  pll ppsjitter nano
> pll time constant:    8
> precision:            1e-09 s
> frequency tolerance:  496 ppm
> pps frequency:        -9.224 ppm
> pps stability:        0.000 ppm
> pps jitter:           0 s
> calibration interval: 4 s
> calibration cycles:   0
> jitter exceeded:      0
> stability exceeded:   0
> calibration errors:   0
> 
> 
> Here is what I have done so far:
> 
> - Edit new kernel config file:
> 
>   cd /usr/src/sys/i386/conf/
>   nano PPS-Generic
> 
> # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> # Generic kernel configuration with PPS_SYNC option
> #
> include         GENERIC
> 
> ident           PPS-GENERIC
> 
> # Enable support for the kernel PLL to use an external PPS signal,
> # under supervision of [x]ntpd(8)
> # More info in ftp://ftp.udel.edu/pub/ntp/kernel.tar.Z
> options         PPS_SYNC
> # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> 
> - Build and compile the new kernel:
> 
>     cd /usr/src
>     ls -lt /usr/src/sys/i386/conf
>     make buildkernel    KERNCONF=PPS-GENERIC
> 
>   This should take 10 mins to 2 hours depending
>   on the speed of your computer.
> 
>   Check to see that it was created:
> 
>     cd /usr/obj/usr/src/sys/PPS-GENERIC
>     ls -lta | more
> 
> - Install the new kernel:
> 
>     cd /usr/src
>     make installkernel KERNCONF=PPS-GENERIC
> 
>   Check that the new kernel is installed:
> 
>     cd /boot
>     ls -lta
> 
>   These directories should be there:
> 
>     kernel
>     kernel.old
> 
>   Go into each directory and notice
>   the time stamps of the "kernel"
>   files:
> 
>     cd /boot/kernel
>     ls -lta | grep kernel
> 
>     -r-xr-xr-x  1 root  wheel  10204732 Dec 19 13:44 kernel
>     -r-xr-xr-x  1 root  wheel  31172114 Dec 19 13:44 kernel.symbols
> 
> 
>     cd /boot/kernel.old
>     ls -lta | grep kernel
> 
>     -r-xr-xr-x  1 root  wheel  10201628 May  1  2009 kernel
>     -r-xr-xr-x  1 root  wheel  31167198 May  1  2009 kernel.symbols
> 
>   Reboot:
> 
>     shutdown -r now
> 
> - Check if new kernel running
> 
>    After rebooting and logging in:
> 
>     uname -a | grep PPS
> 
>   You should get a readout of the kernel
>   name which should include "PPS"
> 
> 
> - Create Oncore config file
> 
>   cd /etc
>   nano ntp.oncore0
> 
>     MODE 1
>     LON -75.7479
>     LAT 39.6632
>     HTGPS 67 FT
>     DELAY 30 NS
> 
> 
> - Create symbolic links:
> 
>     ln -s  /dev/cuad0  /dev/oncore.pps.0
>     ln -s  /dev/cuad0  /dev/oncore.serial.0
>     ln -s  /dev/cuad0  /dev/gps0
>     ln -s  /dev/cuad0  /dev/pps0d
> 
> - Create /etc/devfs.conf links:
> 
>     link cuad0 pps0
>     link cuad0 gps0
>     link cuad0 oncore.pps.0
>     link cuad0 oncore.serial.0
> 
> - Check them:
> 
>     ls -lta /dev | more
> 
> - Edit /etc/ntp.conf:
> 
> # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> # This is the configuration file for NTP
> #  (Network Time Protocol).  More info at
> #  www.NTP.org
> #
> # /etc/ntp.conf
> 
> # This computer will act as a stratum 2 time
> #  server, by referencing the following 4 or
> #  more stratum 1 time servers:
> 
> server ntp2.netwrx1.com       iburst     # WI
> server otc1.psu.edu              iburst     # PA
> server t2.timegps.net            iburst     # CA
> server tick.usask.ca             iburst     # CAN
> 
> 
> # GPS NMEA (numbers seconds only)
> # server 127.127.20.0 prefer minpoll 4 maxpoll 4
> server 127.127.20.0 minpoll 4 maxpoll 4
> 
> #flag3 Controls the kernel PPS discipline: 0 for disable (default), 1
> for enable.
> # fudge  127.127.20.0 flag3 1
> fudge    127.127.20.0 flag3 0
> 
> 
> # GPS PPS
> server 127.127.22.0 prefer minpoll 4 maxpoll 4
> 
> #flag3 Controls the kernel PPS discipline: 0 for disable (default), 1
> for enable.
> fudge  127.127.22.0 flag3 1
> fudge  127.127.22.0 refid GPS
> 
> 
> # GPS Oncore driver
> server 127.127.30.0
> fudge  127.127.30.0   refid GPS-Oncore
> 
> 
> # Since the clock on most PCs drifts around
> #  significantly, let's use a file to
> #  keep track of that drift and compensate
> #  for it:
> driftfile /etc/ntp.drift
> 
> # This server will broadcast NTP timing signals
> #  over the Local Area Network (LAN):
> broadcast 192.168.1.255
> 
> # Let's setup a log file for NTP:
> logfile /var/log/ntp.log
> 
> # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> 
> Does anyone have any idea what I might check next?

The oncore driver mentions binary protocol is required and yet
you are also using NMEA driver. That doesn't seem correct.

Is your oncore setup for binary or NMEA?

It's easy enough to display MNEA using Minicom.

For looking at PPS signal you may not be lucky. It would
normally be on DCD, pin 1 of serial connector, and if only 1us
(I'm not familiar with oncore) then you'll not see it and
probably neither will FreeBSD without using a pulse stretcher.
I use a dual monostable as pulse stretcher for MSF timecode
to remove the intermediate data pulses and generate a single
50ms at start of each second. I set this up using radioclkd2
program in debug mode (not its intended purpose but far easier
than using a scope).

I'd forget about PPS until you have either the oncore driver
or NMEA working. My Garmin gps18x-LVC with NMEA driver gives
around 70us offset on a good day then about 1us with PPS.

Data on pin-2 is RxD and on pin-3 is TxD, which may be from
the NMEA driver.


David






More information about the questions mailing list