[ntp:questions] Tracking the drift of a GPS clock relative to a HW clock

ryad.bek at gmail.com ryad.bek at gmail.com
Mon Jan 19 23:51:25 UTC 2009


On Jan 19, 10:26 pm, Terje Mathisen <terje.mathi... at hda.hydro.com>
wrote:
> ryad.... at gmail.com wrote:
> > Hello everybody,
>
> > I'm trying to track (offline) the drift of my gps clock relative to my
> > hw clock (the clock that I would have obtained without GPS).
> > My final goal is to convert a series of gps timestamps to the
> > equivalent hw timestamps (with microsec precision).
>
> This is actually quite easy:
>
> Just enable logging of the loop frequency (i.e. the freq offset), and
> integrate that value over time.
>
> This gives you the offset at any given time.

Smart,
your method uses the SW clock not the HW clock
(which eliminates the problem of the 11 mn mode)

But what I do not understand is why are integrating frequency (f)?.
It would be easier to add the clock offset (o) (i agrre that the
result should be the same)?

I mean,
if the loopstats file is (simplified version):

t1_GPS o1 f1
t2_GPS o2 f2
t3_GPS o3 f3

I should have

t0_HW=t0_GPS
t1_HW=t1_GPS+o1
t2_HW=t2_GPS+o1+o2
t3_HW=t3_GPS+o1+o2+o3

then if I graph t_GPS on the x-axis and t_HW on the y-axis
i can interploate all the points, and i can convert any t_GPS into
t_HW

Please correct me if I'm wrong

>
> Alternatively it is in fact possible to run NTP with the corrections
> disabled (or using the local clock as the reference) and then fundge the
> GPS to something like stratum 14 or 15.
>
> In this case the clockstats file will probably log every single GPS
> sample with the current offset between GPS and system clock.
>

The first method you mentioned seems easier, doesn't it?

Are both methods equally accurate?

> Terje
> --
> - <Terje.Mathi... at hda.hydro.com>
> "almost all programming can be viewed as an exercise in caching"




More information about the questions mailing list