[time-nuts] Home-brew GPSDO

Nick Sayer nsayer at kfu.com
Thu Mar 17 16:38:11 EDT 2016


I just went through the exercise of adding a phase comparator to my GPSDO. Jim Harmon from the list gave me the concept for it. It’s quite simple and elegant and so far it seems to be doing its job. I’m still in the throes of tuning the firmware to use it. Where I initially went wrong was thinking that I could more or less start over with the phase detector, but what’s working better is sticking with what was working before and merely adding the phase detection as a little bit of “salt” on the error signal.

I haven’t yet updated the project schematics at https://hackaday.io/project/6872-gps-disciplined-tcxo but I plan to shortly, hopefully along with updated firmware to match.

But the Reader’s Digest version is that you divide the 10 MHz by 10 with a 74HC390D. You then feed the resulting 1 MHz into COMP input of a 74HC4046A with the PPS going into the SIG input. The PC3 output goes into a schottky diode, and the cathode of that goes into an RC LPF. For mine, I used R = 1kΩ and C=680pF. Across the cap you also add a 10MΩ resistor. The time constant for charging is 680ns and for discharging it’s 6.8ms. After some discussions with Jim, he recommended instead a RC of around 1.4µs. I planned to change to a 2kΩ resistor for charging to accomplish that, but haven’t done it, mostly because of laziness.

Oh, you also tie the INH line of the 4046 high to disable the VCO - it’s not used.

Anyway, the phase discriminator will output a pulse at PPS of anywhere from 0 to 1 µs in duration, depending on the phase shift of the oscillator. The diode+RC will turn that into a sort of reverse sawtooth with a duration long enough to preserve the maximum value for reading, but short enough to be cleared by the time the next PPS arrives. You read the voltage of the output of that with an ADC as quickly as you can (but no less than 1 µs after the PPS rising edge). What you’ll get is an ADC reading roughly proportional to the phase shift (it’s not perfect because the TC curve is logarithmic. Jim’s advice about a longer time constant is to drive the range down into the more linear section of the curve, but it also requires reducing the ADC reference voltage and is going to be more noise susceptible). I’m steering my discipline towards the midpoint.

Anyway, my hat’s off to Jim - it’s an extremely elegant mechanism, and it was inexpensive both in parts and board space to add.


> On Mar 17, 2016, at 9:40 AM, Logan Cummings <logan.cummings at gmail.com> wrote:
> 
> Hi Nigel,
> 
>    Mostly just chiming in because I'm planning to do something very
> similar, disciplining or tuning a VCO to a precise frequency based off GPS
> PPS - with a Due (Atmel SAM3x8E).
> 
>    In my case the control voltage is much wider range, so I'm forced to
> use an external DAC - I picked one that's I2C controllable - easy to
> interface with the Due.
> 
>    As far as control loop improvements go, I haven't implemented them yet
> but my plan was to combine the frequency counting you describe above, with
> some form of sub-period phase offset measurement. After having no luck
> trying to find some links to share, I think the terms to search for are TAC
> (Time Amplitude Converter) and the digital version, Time Digital Converter
> (TDC). The ones I was looking at implementing are essentially the ramp
> interpolator described here:
> https://en.wikipedia.org/wiki/Time-to-digital_converter
> 
>     I was planning on using the Due's ADC to measure the voltage on the
> integrator capacitor, but hadn't decided yet about a "good" current source
> vs. a series resistor on the output of an XOR or DFF phase comparator to
> put charge on the capacitor.
> 
>     Hopefully someone else can chime in with some better links and circuit
> descriptions. Fairly certain this has been discussed a bit on the list and
> when I have some time I'll be searching the archives.
> 
> Cheers,
> -Logan
> 
> On Wed, Mar 16, 2016 at 9:47 PM, Nigel Vander Houwen <
> timenuts-nigelvh at nigelvh.com> wrote:
> 
>> Hello All,
>> 
>> Thanks to the advice earlier, I’ve gotten my HP 10544A OCXO working well,
>> and close enough in frequency that the EFC is useful. I’ve started work on
>> putting together a home-brew GPSDO. In short, it’s an Arduino Due, and a
>> u-blox MAX-7 module. (I may think about grabbing a LEA module in the
>> future, but the data sheet reference to PPS accuracy looks about the same,
>> so for now, the MAX-7 will work alright).
>> 
>> The Arduino Due has some nice 32bit timer/counters on board, and I’m
>> clocking one of them from the 10MHz output from the 10544A. The PPS output
>> of the GPS goes into a hardware trigger pin, so I can trigger a capture of
>> the counter value in hardware without the delay uncertainty of trying to
>> capture it in an Interrupt Service Routine.
>> 
>> I’m using one of the Due’s on board 12-bit DACs (Not PWM) to feed the EFC
>> input of the 10544A. The Due’s DAC output is only 0-3.3V, which is a fair
>> bit less range than the -5 to +5V of the EFC input. Since the EFC input is
>> inverting, I’ve got the crystal coarsely set just slightly high in
>> frequency, and the DAC operating from 0-3.3V will bring it down to where it
>> should be.
>> 
>> To put a VERY basic disciplining scheme in place, I’ve set it up so I’m
>> capturing the clock cycles of the 32bit counter (clocked from the 10MHz),
>> every second on the PPS trigger, adding them up over 420 seconds (a few
>> seconds shy of the 32-bit counter overflowing), and then taking the
>> average. If it’s high, voltage goes up, if it’s low, voltage goes down.
>> 
>> I haven’t yet put in place, but I plan to:
>> Reconfigure the u-blox module into stationary position mode, which should
>> help with accuracy over the default mode
>> Implement a survey routine to average some number of position samples on
>> request/on power up?
>> Implement different disciplining modes, at power on, give the oven time to
>> warm up, when first disciplining, average over shorter intervals to hone in
>> on the proper EFC level quicker, move to longer intervals for long term
>> disciplining.
>> 
>> I would like input on the control loop though. I can’t say I’ve done a lot
>> of control loop theory, but I imagine folks have good ideas for better ways
>> to discipline this crystal than just taking really long averages.
>> 
>> I haven’t put labels on the case yet, but here’s an album with some photos
>> of the build so far. I still need to add a buffer amplifier for the 10MHz
>> output so as to not load down the crystal too hard, but otherwise I’m
>> fairly satisfied with the build so far.
>> http://images.digitalnigel.com/index.php/GPSDO-Build <
>> http://images.digitalnigel.com/index.php/GPSDO-Build>
>> 
>> Anyway, thanks again for the insight earlier regarding tuning the oven
>> temperature, and I look forward to your thoughts regarding this build.
>> 
>> Thanks,
>> Nigel
>> _______________________________________________
>> time-nuts mailing list -- time-nuts at febo.com
>> To unsubscribe, go to
>> https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
>> and follow the instructions there.
>> 
> _______________________________________________
> time-nuts mailing list -- time-nuts at febo.com
> To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
> and follow the instructions there.



More information about the time-nuts mailing list