Another lurch forward thanks to Michael Gilligan. One of the graphs I draw is of Allan Deviation, said to be the best way of expressing clock performance, except I didn't understand it,
Given a stream of data representing period it's easy to number crunch minimum, maximum, average, median, standard deviation and to graph rate.
Standard deviation and rate are the most interesting.
Rate describes how much a clock drifts over time, a few seconds per day, or scientifically in parts per million, or parts per billion. If the rate is known it can be corrected.
Standard deviation is a simple measure of stability – the range over which period varies. Although a clock can keep good time over days (low rate), might be because wild variations average out. OK over several hours but unreliable at seconds – not a good timekeeper.
Thanks to Michael finding this description, I think I've got a handle on Allan Deviation. It graphs how much a clock's variance varies, i.e. a measure of stability covering short & long-term effects. Allan insn't easy to interpret. Rawlings (Science of Clocks and Watches) says: 'There are so many influences on a clock that the study of performance records and stability charts seems more akin to the science of meteorology than physics or engineering.' Curve shape is as important as the values, but the shape is influenced by many factors.
Occurred to me Allan would be more obvious used to compare clocks. I have 6,
- My pendulum clock
- Same temperature compensated
- A UNIX program outputting times triggered by a per second timer. This depends on a not very stable clock corrected by the Network Time Protocol every 10 seconds or so. NTP is never wrong by more than 0.1s
- An SDG1062X Function Generator. This has a temperature compensated crystal oscillator; good rather than excellent.
- A GPS Module producing second pulses, ±10nS, the best I can do without spending big money.
- A 'Perfect' clock, i.e. a stream of computer generated numbers representing pure sensor readings. No noise, sensor errors, or drift. Mine is 64-bit precision floating point numbers.
This graph compares all six clocks:

Best at the bottom, worst at the top. Curves start top left with standard deviation and then how that varies. So standard deviation is a decent basic indicator of clock goodness, but not the whole story.
As expected the perfect clock (Brown) massively outperforms real clocks. But Allan Deviation shows imperfections. A gentle down slope is good, indicating white noise, but there are kinks. These I suspect are rounding error due to the limitations of floating point arithmetic.
My uncompensated pendulum (blue) is the worst clock. The middle dip is the lowest variation achieved and suggests this the best a compensated version can do. The rise out of the dip means rate drift. The orange line is from the same run, but temperature compensated. A considerable improvement, but the compensated clock now shows a distinct rate drift error. (Consistent with other data, and has me puzzled. Per-swing accuracy better, but long-term timing is worse, probably because other faults have emerged!)
Green UNIX time is a mix of good and bad. The down slope suggests this a good clock influenced mainly by white noise – no drift, but variation is high – worse than my temperature compensated clock. Fits in with how NTP works. The computer's internal oscillator isn't special, so drift is likely between NTP time updates. The exact timing of a second is influenced by whatever else Linux is doing and so is the way my program measures it. Although NTP is Atomic Time, it resets iffy computer clocks with a bang, with variance due to network & processing delay. Atomic time, but up to 0.1s off. Although my computer is usually within 25mS, Allan Deviation detects the imperfection. Truly excellent in the long term, not so hot close in.
Both electronic clocks do well. The purple and red curves track each other closely. GPS is better than the Function Generator. Short term both are better than UNIX but they drift off because they're never corrected. At this accuracy sensor error intrudes. GPS is significantly better than the Function Generator, but Allan doesn't highlight thst. Both curves are limited by the Arduino Pro-Micro's crystal oscillator. So the purple GPS line represents the best I can measure to, not the actual performance of the GPS module & I can't trust measurements below that line. On the plus side, the Arduino is good enough to detect how well or badly my pendulum does!
Assuming the scale's right, my compensated clock is slightly inferior to a marine chronometer circa 1795. Not bad, but disappointing for a super-timepiece! On this graph Shortt No 48, Rieffler 'E' & Fedchenko would all be a tad inferior to the GPS. No surprise, – the best mechanical time-keepers can't compete with electronics and atoms!
Very much feeling my way. Please say if it's wrong – I'm here to be educated.
Dave