[time-nuts] Yet another GPSDO project.

Achim Gratz Stromeko at nexgo.de
Tue Mar 19 18:30:30 UTC 2019


Tobias Pluess writes:
> I was reading on this list for quite a while, but still have some
> questions I'd like to ask. Please forgive me my perhaps silly
> questions since I am a newbie to the timenuts world :-)
>
> So I have built my own GPSDO. I used a low phase noise OCXO from
> AXTAL, a LEA-M8T module and a small STM32F303 microcontroller.  Since
> this was my very first attempt in this topic, my approach was quite
> basic: I used the OCXO as clock source for a free-running counter and
> the rising edge of the 1PPS signal was used to sample the counter. I
> then subtracted the last sampled value from the most recent one and
> thus had a measure of the OCXO's frequency. Since the counter is
> free-running, any frequency error should, at some point, accumulate
> such that there is 1 count difference (at least I think so).

Yes, but there are several wrinkles to take care of with that method.
The first is that the PPS output of the GPS module has jitter that your
OCXO should not try to chase.  The other is that once the frequency
difference becomes small enough you're having to wait a long time before
you notice the frequency is still a bit off and then you don't know
exactly by how much.

> If there are more than 10e6 counts, my OCXO is too fast, and if there
> are less than 10e6 counts I know the OCXO is too slow. So depending on
> these two conditions, the value of a DAC is increased or decreased.

If both the measurement and the OCXO are stable enough this will indeed
work, but your problem is that you need to wait for 100ns of error to
accumulate to make your next decision.  So when you come very close to
target frequency you will probably be in the rising portion of the ADEV
for the oscillator again since your steering gets too sparse in time.

> In theory, a GPSDO with this scheme should basically "lock" at some
> time, however I expected that the performance wo uldn't be amazingly
> good (but I wanted to see where I can get).  Next step, I tested the
> GPSDO. For this purpose I got an Oscilloquartz STAR4, and I let both
> GPSDOs run and warm up for about a week before I did some
> measurements. In my own design, I also implemented a 1PPS output (just
> by dividing the 10MHz clock with timer), and I used the 1PPS of my
> GPSDO and the STAR4 together with a HP 5335A time interval counter.
> It was a bit disappointing to see that there is, even after a week of
> warmup, still some drift visible. My own GPSDO (for sure it's not the
> STAR4 :-)) appears to drift about 10ns in 10min, and I have the
> impression that this is way too much.

Provided the drift rate is almost constant, you'd be down to about
2e-11 at 1s with that figure.  That's not too shabby given the simplicity
of your scheme.

> So I didn't even try to do some Allan Deviation measurements, I bet it
> would be a nightmare. (I also made a timelapse video of the two OCXO
> signals displayed on a 'scope. Nothing beautiful :-/ ) Instead I would
> like to make a 2nd version. This time I would like to implement a
> PLL. The reason is also that I want the 1PPS to be aligned to UTC, as
> commercial GPSDOs seem to do this.  And this is now the point where I
> need some advice! :-) I think I will still divide the 10 MHz down to a
> 1PPS signal, and then phase lock that to the 1PPS from the GPS
> module. One could do this e.g. with a phase/frequency detector with
> two D-flipflops, e.g. like this one:
>
> https://electronics.stackexchange.com/questions/301402/phase-frequency-detector-in-pll
>
> The signals UP and DN could then be used to steer the OCXO. A counter
> could be incremented whenever an impulse comes from the UP signal, and
> the very same counter could be decremented if there is an impulse from
> the DN signal. However I think this is way too basic, I need a proper
> loop filter. But what do I do with the phase detector signals and how
> to interface them with a proper loop filter, say an FIR or even IIR
> filter? the STAR4 GPSDO has an adjustable loop filter time constant,
> default 200s. I want something similar, but it is currently not yet
> clear how to interface a digital filter with a phase detector.
> Later I would also like to add the sawtooth correction, but so far I
> have not yet found out how to do that - I couldn't find out in the
> uBlox manual where I can find info about the 1PPS timing.

Considering you have a timing module, there are more possibilities
inside that module you can use before going for external circuits.  For
starters, you can timestamp the PPS from the OCXO with the module itself
and get a better estimate of how far off you are.  Second, the module
can ouptut an additional higher frequency clock that you can use for
determining the phase difference to your OCXO more precisely.  Last but
not least, the timing modules have a frequency aiding mode where you can
feed in a stable frequency to one of the EXTINT pins (I think up to
500kHz, see UBX-MGA-INI-FREQ message) and tell the module what frequency
and stability it has and the module will come up with a better estimate
of its own internal frequency and converge much faster.  If you had FTS
firmware on the module (unlikely), there'd even be a mode where the PPS
from your OCXO would directly processed to a signal that drives a DAC to
steer its frequency on target.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Samples for the Waldorf Blofeld:
http://Synth.Stromeko.net/Downloads.html#BlofeldSamplesExtra




More information about the Time-nuts_lists.febo.com mailing list