STM32F4 time experiments

other runs and more info

Goal

1ms or better accuracy on a USB-connected GPS.

Changes from Run 8

Filter samples outside of +/- 10 µs before selecting the median

Graphs

PC clock

Loopstats graph - local clock error (PPM, green) and USB/GPS offset (µs, red) - filter applied at the very end of the run at ~02:00

ntpd's measurement of jitter

You can see a significant dropoff in jitter when the filter was applied at the end.

Filter

This is a close-up view of 3 minutes worth of data. The red is the raw samples (in µs), the green is the offset sent to NTP (in µs), and the blue is the percentage of samples accepted by the filter (in %)

You can see at 3:45 the number of samples accepted dropped to around 63%. If they were not rejected, the samples would have skewed the data in the positive direction (creating jitter). A similiar event happened at 3:47, but in the negative direction.

Overall conclusion

This filter significantly lowered jitter, but a static offset filter does not work for all cases (for example: large changes in offset while ntp finds the proper frequency error)