[time] Garmin GPS 18 5Hz usability

Arthur Konovalov kasjas
Mon Nov 20 11:04:55 UTC 2006


Rob Janssen wrote:
> Arthur Konovalov wrote:
>>
>> I hope that problem solved now.
>> Part of ntp's refclock_nmea.c file:
>>
>> #ifdef HAVE_PPSAPI
>>     /*
>>      * If the PPSAPI is working, rather use its timestamps.
>>      * assume that the PPS occurs on the second so blow any msec
>>      */
>>     if (nmea_pps(up, &rd_tmp) == 1) {
>>         pp->lastrec = up->tstamp = rd_tmp;
>>         pp->nsec = 0;
>>     }
>> #endif /* HAVE_PPSAPI */
>>
>> In case of 5Hz PPS we need millisecons part, commented out row:
>>        pp->nsec = 0;
>>   
> When I understand correctly what this code does, making this patch will
> completely kill the synchronization by PPS.   Probably it will look as 
> if you have
> good sync but in reality there is none.
>
I haven't much programming skills, but i have quite stable sync with 
this "hack" like this:

~# ntpq -p
     remote           refid      st t when poll reach   delay   offset  
jitter
==============================================================================
 LOCAL(0)        .LOCL.          10 l    4   64  377    0.000    0.000   
0.004
 tt56.ripe.net   .GPS.            1 u   71  512  377    0.748    0.023   
0.069
*GPS_NMEA(0)     .GPS.            0 l    6   16  377    0.000    0.008   
0.004


> The point of code like the above (and also in gpsd) is: the moment the 
> PPS
> pulse comes in, the code assumes we are on the seconds-mark.  So it 
> creates
> a timestamp of the nearest second: the current time with the usec or nsec
> field zeroed, and lets the clock sync to that.

This is reason why nsec  zeroing commented out. Now we trying sync to 
.0, .2,.....,.8 of each second.

> When you have 5Hz ticks, the situation is a little more complicated: you
> have to determine the nearest 200ms-mark and sync to that.  So the nsec
> value has to be set to any of 5 values.

Yes, we have it from GPRMC:
$GPRMC,105244.0,A,5926.09688,N,02442.84819,E,000.01,267.4,201106,006.6,E*57
$GPRMC,105244.2,A,5926.09701,N,02442.84815,E,000.03,267.4,201106,006.6,E*5B
$GPRMC,105244.4,A,5926.09713,N,02442.84811,E,000.07,267.4,201106,006.6,E*5E
$GPRMC,105244.6,A,5926.09726,N,02442.84808,E,000.05,267.4,201106,006.6,E*50
$GPRMC,105244.8,A,5926.09738,N,02442.84805,E,000.02,267.4,201106,006.6,E*5B



Regadrs,
Arthur



More information about the pool mailing list