Further investigation of the reason the errors were halved when the averaging period doubled. A bit of stupidity (typical). The previous algorithm was designed to steer the 1pps so it arrived in the interval 0 to 25ns. As described earlier, this allowed the system to settle anywhere in that 25ns window so tended to wander in that window. My simplistic solution was to add 1 to all +ve deviations so 0-25ns became 1, 25-50ns became 2 etc, with -ve deviations -25to0ns is -1, -50to-25ns is -2 etc. This did force the system to try to settle on the transition from -ve to +ve. What I didn't realise was this gave too much weight to the 0to25ns and the -25to0ns intervals, resulting in corrections which were too large. This can be seen on the graphs, the voltage becomes a sawtooth overshooting every time.
When the measurement period was doubled, the overshoot was the same. But the algorithm now had twice as long to fix it, so the correction was halved.
The perfect solution to this is to measure the arrival time exactly rather than to the nearest 25ns. But this adds more hardware, against the principal of this build. Also it may test the power of an 8 bit processor to deal with the larger numbers involved.
So the algorithm is changed yet again. The solution was to add weight to deviations greater than ±25ns. The actual solution was double the number and add 1. So 0-25ns is still 1, 25-50ns becomes 3, 50-75ns becomes 5 etc, with -ve deviations -25to0ns is still -1, -50to-25ns is -3 etc. Calculations of corrections uses close to 32 bit precision, and shifts (divide by multiples of 2) the final result. It was a simple matter to add 1 to this to remove the effect of doubling the raw deviations.
So does it work. Yes it does. The GPSDO was off for a different reason before changing the software, so it has been running less than a day. Even so, sawtooth is gone and many corrections are less than 0.01 ppb. That's very satisfying. It seems temperature is now the biggest disturbing factor. Always something to think about.
I'll post another graph when I've got more data.