[ntp:questions] GPS/PPS and "enable calibrate"

unruh unruh at invalid.ca
Sat Sep 7 16:20:23 UTC 2013


On 2013-09-07, Charles Elliott <elliott.ch at verizon.net> wrote:
>
>
>> -----Original Message-----
>> From: questions-bounces+elliott.ch=verizon.net at lists.ntp.org
>> [mailto:questions-bounces+elliott.ch=verizon.net at lists.ntp.org] On
>> Behalf Of unruh
>> Sent: Friday, September 6, 2013 12:23 PM
>> To: questions at lists.ntp.org
>> Subject: Re: [ntp:questions] GPS/PPS and "enable calibrate"
>> 
>> On 2013-09-06, Charles Elliott <elliott.ch at verizon.net> wrote:
>> > Calibrate has not worked for several years, although it is possible
>> it is
>> > fixed now.  Someone on this list investigated and reported that there
>> was
>> > just pro forma or "suggestive" code in ntpd as to how it could work.
>> >
>> > I plotted the data on Windows with the Meinberg "NTP Tome Server
>> Monitor,"
>> > but it can be done with NTP Plotter (which Google) or a spreadsheet.
>> I
>> > plotted Offset v. time and computed the average.  Then I adjusted
>> time2 and
>> > after a day ot two, plotted again and again computed the average.
>> Each time
>> > I adjusted time2 I did it 1/2 the average offset or 1/2 the average
>> time
>> 
>> Why? Why not just do it the average offset?
>
> Many inexpensive GPS devices exhibit a saw tooth pattern of their offsets
> relative to
> a known good time source, where the period is less than constant, and the
> amplitude 

Where the amplitude of the sawtooth on PPS is 10s of nanoseconds. We are not
talking about ns here. We are talking about usec or ms.
On nmea output it could well be much larger. 



> often is plus or minus 60 ms relative to 0 offset.  According to Dave Hart,
> this
> saw tooth pattern is inherent in the GPS device itself (the time between fix
> and 
> time output "wanders") and not caused by NTPD processing.  Regardless of its
>
> cause, until one understands this saw tooth pattern it appears like no time2
> adjustment works for any length of time, hence the attempt to sneak up on
> it.

As long as one uses a long enough averaging time (greater than the time
period of the sawtooth) the average should be the best one can do. I
have no idea how taking half the average helps in any way at all.


>
> One could avoid the ineffective sneaking by recording and plotting the GPS
> time offset for at least a week.  Then set time2 to be the average of the
> top
> and bottom of the saw-toothed wave.  Then GPS time, w/o PPS assist, will be
> accurate about twice a day.
>
> I suppose faced with a saw toothed offset with non-constant period and
> uncertain 
> amplitude relative to known good time, programmers and pundits have paused
> in
> their efforts to devise a calibrate algorithm that would do much good.

The average is probably as good as anything. Or use PPS and be accurate
to  a microsecond or so.

>
>
> Charles Elliott
>> 
>> > distance between the consensus time of several (9) external time
>> servers and
>> > the GPS device time, set to noselect mode.  I was very careful of the
>> > algebraic signs of the adjustment; it is not obvious.  Fortunately,
>> time2
>> > has always been positive for me, probably because the GPS device
>> takes time
>> > to compute and emit the time after a fix, it is needs a several
>> hundred
>> > millisecond boost to bring its time up to the present.  I am not sure
>> if PPS
>> > needs a time2 adjustment.
>> 
>> It should be within a usec of UTC. If the receiver emits a pulse more
>> than 1 us off it is seriously broken. And the interrupt processing
>> should not take more than a us or two unless the machine is really
>> overloaded.
>> 
>> 
>> >
>> > Charles Elliott
>> >
>> >> -----Original Message-----
>> >> From: questions-bounces+elliott.ch=verizon.net at lists.ntp.org
>> >> [mailto:questions-bounces+elliott.ch=verizon.net at lists.ntp.org] On
>> >> Behalf Of Horvath Bob-BHORVAT1
>> >> Sent: Friday, September 6, 2013 9:20 AM
>> >> To: david-taylor at blueyonder.co.uk; questions at lists.ntp.org
>> >> Subject: Re: [ntp:questions] GPS/PPS and "enable calibrate"
>> >>
>> >> Sorry for top posting, but Outlook is quoting things correctly.
>> >>
>> >> I did check out your site and based my original setup on it.  Lots
>> of
>> >> impressive stuff there!
>> >>
>> >> The part I couldn't figure out the fudge time2 values.  Using the
>> one
>> >> that was pointed out to me by Wolfgang is working very nicely with
>> the
>> >> other image.
>> >>
>> >> I am curious how that value is determined.  I am assuming someone
>> that
>> >> understood it used the calibrate capability to come up with the
>> 0.496
>> >> number that works for rpi-gpio cases.
>> >>
>> >> -----Original Message-----
>> >> From: questions-
>> bounces+bob.horvath=motorolasolutions.com at lists.ntp.org
>> >> [mailto:questions-
>> >> bounces+bob.horvath=motorolasolutions.com at lists.ntp.org] On Behalf
>> Of
>> >> David Taylor
>> >> Sent: Friday, September 06, 2013 6:10 AM
>> >> To: questions at lists.ntp.org
>> >> Subject: Re: [ntp:questions] GPS/PPS and "enable calibrate"
>> >>
>> >> On 05/09/2013 21:00, Horvath Bob-BHORVAT1 wrote:
>> >> []
>> >> > Hi,
>> >> > this runs perfectly for me:
>> >> > <http://open.konspyre.org/blog/2012/10/18/raspberry-pi-time-
>> server/>.
>> >> >
>> >> > OK, maybe I'll have to try that image.
>> >> >
>> >> > In general though, when it comes to this line...
>> >> >
>> >> >    fudge 127.127.20.0 flag1 1 time2 0.496
>> >> >
>> >> > ... how do you know what value to set for time2?
>> >> >
>> >> > Did you got through the instructions here?
>> >> >
>> >> > http://www.eecis.udel.edu/~mills/ntp/html/drivers/driver20.html
>> >> >
>> >> > ... or are you using 0.496 - what is shown on the
>> >> http://open.konspyre.org/blog/2012/10/18/raspberry-pi-time-server/ ?
>> >> >
>> >> >
>> >> >
>> >> > Bob
>> >>
>> >> No need to change the Kernel,Bob.  There's a program which does
>> /not/
>> >> require you to change the OS - it runs the PPS collection in user-
>> mode
>> >> rather than kernel-mode, and the performance is only a shade worse
>> than
>> >> the kernel-mode version:
>> >>
>> >> Program:
>> >>    http://vanheusden.com/time/rpi_gpio_ntp/
>> >>
>> >> Using:
>> >>    http://www.satsignal.eu/ntp/Raspberry-Pi-NTP.html#user-mode
>> >>
>> >> Performance:
>> >>    http://www.satsignal.eu/mrtg/performance_raspi-4.php
>> >>
>> >> All my Raspberry Pi experiments with different NTP versions and
>> >> different GPS receivers are here:
>> >>
>> >>    http://www.satsignal.eu/ntp/Raspberry-Pi-NTP.html
>> >>
>> >> so I hope you find something of interest there.
>> >>
>> >>
>> >>
>> >>
>> >> _______________________________________________
>> >> questions mailing list
>> >> questions at lists.ntp.org
>> >> http://lists.ntp.org/listinfo/questions
>> 
>> _______________________________________________
>> questions mailing list
>> questions at lists.ntp.org
>> http://lists.ntp.org/listinfo/questions



More information about the questions mailing list