[fa.tcp-ip] Tweaking clocks

tcp-ip@ucbvax.ARPA (07/09/85)

From: mills@dcn6.arpa

Folks,

My apologies to some of you how might be getting three copies of the Clockwatchers
Gazette. I intended to send the following reply to a recent message to the whole
list, but it seems to have been swallowed. Herewith the reply:

Steve,

The method I proposed involves adding a fractional quantity approximately
equivalent to 2/3 of a millisecond 60 times a second. The fractional quantity,
expressed as a 16-bit integer, has a low-order bit that toggles at about a
001*2-^16 = 15-nanosecond period. Thus, the accumulated error after 60 ticks
is about 0.9 microseconds, in other words a residual systematic error of 0.9
ppm, and that compares favorably with just about any crystal oscillator you
are likely to afford. If allowed to accumulate uncorrected, however, the error
after one hour would be about 3.2 milliseconds, after one day 80 milliseconds
and after one year 30 seconds.

According to an interview with our local power bullies, we should expect the
(Eastern) 60-Hz power-grid frequency to wander over a .025-Hz band (over +-400
ppm) with daily extremes of +-3 to +-6 seconds in absolute time offsets. The
fuzzball timekeeping algorithms have to yank the phase of the local clock
accordingly in response to corrections broadcast on the local net, which makes
the 0.9 ppm systematic error pale in the dust.

While your method does have the elegance of precision, it does not lend itself
to synchonization techniques which involve incremental phase adjustments, such
as we use in the futzoballs. It also does not lend itself to convenient
reconfiguration for oddball clocks and national frequencies. As you point out,
either the method you suggest or mine costs about the same in time and code.

The bottom line is, if you want short-term precision and are willing to
correct your clock reasonably often, like once per day, than use a crystal
clock. If you can tolerate daily variations of +-3 to +-6 seconds but don't
want to correct your clock at all, then use your techniqe and a
mains-frequency clock. If you are stuck with a mains-frequency clock and want
to synchronize with other clocks, then use my technique. If you are stuck on a
UPS with a mains-frequency clock, as some of my friends are, don't bother.

Dave
-------