I have a GPS unit connected to an arduino, but the specific hardware isn't important. This could just as easily be a computer that was receiving regular updates from a standard time reference - across the internet - and needed to smooth that signal.
The GPS updates come roughly every 100ms, but the clocks on Arduinos are notoriously irregular. My processor might think 100ms is 120ms or 80 ms, depending upon the actual frequency of the crystal. I'd like the processor to have a computed time that is driven by the GPS unit but is smoothed so that any part of the process may, at any time, request the current time and get something that closely approximates the actual time.
I'm vaguely familiar with PID, but haven't used it in practice enough to see how to apply it to my current problem. I suspect that there's probably an even better way to solve this particular problem, though the several that I've tried have all suffered from destructive harmonics.
For example. At ACTUAL time 0h 1m 10s 0ms, an update might come in from the GPS saying that the time is 0:01:10.000. If, 105ms later, the GPS hasn't updated the cpu yet, the smoothing function should still read 0:01:10.100(ish) even though the GPS driver still thinks the time is 0:01:10.000.