gpsd-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gpsd-dev] [PATCH] HOWTO: calculate the average GPS offset


From: Andy Walls
Subject: Re: [gpsd-dev] [PATCH] HOWTO: calculate the average GPS offset
Date: Mon, 21 Oct 2013 19:43:10 -0400

Hi Gary,

Days seems like too long.

In my open-loop tests, it took about 4000 seconds (67 minutes) for the relationship between the ntp disciplined system clock and PPS to have a somewhat stable offset.  It took about another 1000 seconds for me to have confidence that it was.
(The plot of the peerstats data lets one see the stabilization.  A plot of 4 hours of data gives me confidence, YMMV. :) ) 

In my open-loop tests, it also took about 4000 seconds (67 minutes) for the relationship between the ntp disciplined system clock and GPS serial stream to have a somewhat stable offset.  It then took the balance of 4 hours for me to have confidence that it wasn't going to get any more stable.  The serial stream jitters *alot*.

Looking at the peerstats for the GPSD/Shared Memory clock, and throwing out the initial 6000 seconds, I observed the following about the offset:

Mean: -0.455
Min:    -0.495
Max:   -0.413

So a jitter of about +/- 41 milliseconds in GPSD/Shared Memory time reports after NTP's disciplining of the system clock has a fairly stable offset from the PPS. :(

Regards,
Andy

On Mon, 2013-10-21 at 14:38 -0700, Gary E. Miller wrote:
Yo Beat!

Looks cool.  But I would only do this after an ntpd server has been running
for days and is stable.  Mayb just say to repeat this procedure until
stable?

On Mon, 21 Oct 2013 23:29:21 +0200
Beat Bolli <address@hidden> wrote:

> ---
>  www/gpsd-time-service-howto.txt | 30 ++++++++++++++++++++++++++++++
>  1 file changed, 30 insertions(+)
> 
> diff --git a/www/gpsd-time-service-howto.txt
> b/www/gpsd-time-service-howto.txt index 62aefda..c0592a3 100644
> --- a/www/gpsd-time-service-howto.txt
> +++ b/www/gpsd-time-service-howto.txt
> @@ -459,6 +459,36 @@ If the offset is positive, reduce the time1
> value and vice versa. A more detailed description of the output is
> available at <<NTPQ-OUTPUT>>.
>  
> +In order to determine the correct GPS offset, do the following:
> +
> +1. Add these lines to ntp.conf:
> +
> +-----------------------------------------------------------------------------
> +statsdir /var/log/ntpstats/
> +statistics peerstats
> +filegen peerstats file peerstats type day enable
> +-----------------------------------------------------------------------------
> +
> +This enables logging of the peer server statistics.
> +
> +2. Start ntpd and let it run for at least four hours.
> +
> +3. Calculate the average GPS offset:
> +
> +-----------------------------------------------------------------------------
> +awk '
> +     /127\.127\.28\.0/ { sum += $5 * 1000; cnt++; }
> +     END { print sum / cnt; }
> +' </var/log/ntpstats/peerstats
> +-----------------------------------------------------------------------------
> +
> +This prints the average offset.
> +
> +5. Adjust the "time1" value in ntp.conf by subtracting the average
> +   offset from step 4.
> +
> +6. Restart ntpd.
> +
>  == Providing public NTP service ==
>  
>  <<NTP-FAQ>> has good advice on things to be sure you have done - and




RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97701
	address@hidden  Tel:+1(541)382-8588

reply via email to

[Prev in Thread] Current Thread [Next in Thread]