In the first attached DSO capture below, shown are the two rising edges for respectively:
- In
Yellow, bottom trace,
1PPS from the GPS module. This has a typical peak +/- 10ns jitter when receiving 11~12 sats.
- In
Green, top trace,
100µS pulse at 1Hz from the picDIV (10MHz from the OCXO divided by 10 million by the picDIV), aligned within 20ns manually by controlling Vctl from my smartphone via Bluetooth!
Explaining: the DSO capture shows the time interval or phase difference in ns between the two positive edges from the 1PPS from the GPS module and the 1PPS from the picDIV (which is really the 10MHz from the OCXO divided by 10 million). By controlling the OCXO frequency one can bring down this time interval to approximately its "floor" value which is the jitter in the GPS 1PPS.
This is how any GPSDO based on a PLL works, essentially. In this case, for this shot I was acting as a "human PLL", by manually adjusting the Vctl of the OCXO.
So, how to automate this? This is where Lars' ingenious 1ns resolution TIC comes into play. I will be using Erik's version of Lars' 1ns resolution TIC to obtain a voltage proportional to the time interval between the two PPS edges. The voltage is then read by the STM32F411CEU6 ADC, and converted back into an approximate time interval value in nanoseconds.
So the next two steps are:
- Wire the TIC and feed the MCU ADC with a voltage.
- Program the PLL.
In the second DSO capture below: using the "Arm" pin on the picDIV, one can "synchronize" the 1PPS from the picDIV with the 1PPS from the GPS module. I have tested this repeatedly and this has always resulted in the same approximately 700ns delay between the two pulses, which is very convenient because it's almost midrange in the range of time intervals the TIC can measure (0 to 1000ns). To reduce this time interval to < 100ns one just "accelerates" the OCXO clock for a few seconds (by raising the Vctl value) while checking the value returned by the TIC. In an nutshell, that's (simplifying very much) how the PI algorithm in Lars' DIY GPSDO works.
Also note that the DSO measurement has itself a 2ns resolution (at 500M samples per second).
Finally: the objective of adding a picDIV and Erik's version of Lars' TIC (for a total cost of around 4€ and 100~200 lines of code) is to get a UTC aligned top-of-second PPS from the OCXO within an as small as possible time window, in this case, hopefully less than 100ns and ideally less than 50ns. This in turn will be passed on to an NTP/PTP server based on a 25€ STM32 Nucleo board to provide precise timing information to a local network.
Remember, the idea is to surpass the > $3000 to build (if you manage to purchase the "unobtainium" bits and pieces for it), > $3 million to develop, 200ns-accurate FacePlant
GPSDO "Time Machine" with a solution that outperforms it by 100% and costs < 1/20th as much to build.