I am currently building my own GPS disciplined oscillator. I have a OCXO which is used as clock source for a microcontroller and one of its counters, and the 1PPS signal from the GPS module is connected to one of the capture inputs of the same counter.
Currently, I have following control algorithm: On the rising edge of the PPS signal, the counter's value is latched and compared to the previous value. If the difference is something else than 10000000, then the EFC voltage of the OCXO is increased or decreased accordingly. I have my GPSDO now running for several days, and it appears to be rock stable compared to a commercial GPSDO from Trimble, but it has the problem that it takes at least one full day until it properly locks. So I try to find a control algorithm which locks faster.
I was thinking whether I could implement something like a PLL in software.
E.g. each time the rising edge of the 1PPS signal occurs, I could calculate the value the timer should have the next time when the rising edge occurs and so on. By subtracting the actual timer value from the desired one, I get something like a phase error which I then could use to steer the OCXO. I would expect that this should lock faster than my current approach, and it should be more accurate because the integration time is basically infinite - even the smallest error will, at some point, lead to a phase difference greater than 1 count.
A further problem I have with both approaches is: how do I determine when the GPSDO is actually locked?
Are there other, probably better approaches for the control of an OCXO by a 1PPS pulse?