Golborne Vintage Radio

Full Version: A GPSDO frequency reference
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
This project was prompted by the availability of cheap GPS modules from china (ebay).
The module chosen was based on the ublox NEO-7M. This is not the best module for timing but it is a lot cheaper, under £6, than dedicated ones.  (It does require an active aerial, under £3.)
 
The NEO-7M does not any flash memory for storing the configuration data and the backup battery for the RAM does not last long.
The simplest solution is to use a microcontroller to configure the module via the serial port at power-up; once configuration is completed the micro is free to be used for other purposes e.g. as a synchronous divider.
 
The NEO-7M can produce a time-pulse selectable from 1Hz to 10MHz in 1Hz steps, like all(?) GPS devices this is derived from a numerically controlled oscillator (NCO) and will have jitter on its output equal to at least one cycle of the internal clock.  For the NEO-7M the clock is at 48MHz and thus the minimum jitter is approximately 20nS.
 
There are at least two components contributing to the jitter.
 
Firstly if the output frequency is not a submultiple of 48MHz then cycles will be dithered to give the correct sequency.  e.g. 10MHz is generated by a sequence of 10 half cycles each with a length of 2 or 3 clock periods to give a total length of 24 clock periods or 5 cycles in 24* 1/48M = 500ns.
At 1MHz there is no jitter from this cause.
 
Secondly the 48MHz clock (which is a simple crystal oscillator for the -7M) is not locked to the GPS and again a clock cycle must be ‘lost’ (or gained?) periodically to maintain the correct output frequency. This is the sawtooth effect, the time error builds up until a clock cycle is lost to correct the error.
 
For the simplest frequency reference e.g. checking the calibration of a counter the output of the module may be used directly. (see ‘Test’)
 
To provide a jitter free frequency reference an external oscillator must be disciplined by the GPS module, the more stable this oscillator is, the slower the correction required to hold it within the required limits. Usually a high quality ovened crystal oscillator is used with a very long control time constant giving great accuracy (~ 1 in 10^11) after a very long settling time (hours).
 
I built such a GPSDO several years ago but found what I really wanted was something that gave reasonable accuracy (better than 1 in 10^8) within a few minutes after power-on.
 
For me other desirable features were a selectable output frequency, simplicity and low cost.
 
When I found a micro oven crystal oscillator (10MHz) with a warm-up time of 60sec to within 1 in 10^7 of final frequency and a temperature stability if +/- 0.2ppm 0 to 60oC this project gelled.
 
I have used PIC processors in the past but for this project chose an AVR processor for its hardware division capabilities (the clock input can be divided by any even ratio from 2 upwards).
(The AVRs also have very low cost hardware and software for programming e.g USBasp and AVRdudess.)
 
As most of the program involved manipulating registers and I/O, assembly language was chosen.  I used an old version of AVRstudio (4.18) as the newer versions are far too bloated for my liking.
For simplicity, cost and availability I chose the ATtiny85 (in 8 pin DIP).
 
In order to achieve the desired settling speed a phase lock loop with a relatively high comparison frequency was chosen.
The NEO-7M and AVR divider are easily programmable over a wide range allowing the PLL time constant to be adjusted by varying the comparison frequency.
Settling speed may be traded against smoothing of GPS short term instabilities as required.
 
PLL design
Since both inputs are square waves (1: M/S) an exclusive OR type phase comparator was chosen for simplicity and its mid rail output when one input is missing.
Output from GPS module is 0 - 3.3v so 4046 was used with ‘Signal in’ AC coupled.
(4046 chosen for availability in DIP (ebay), 74HC4046 or 74HCT86 directly coupled could be used)
 
‘Gain’ of (exOR) phase comparator (Kp) = 10V/Cycle (5v in 180o)
For 10MHz OCXO used ‘Gain’ (Ko) = 25Hz/V
 
Try 10kHz comparison frequency, divider ratio required (N) = 10k/10m = 1000
 
 This gives PLL time constant (T) = N/(Ko*Kp) = 1000/(25*10) = 4 sec
 
Rule of thumb (Dominant Lag) - for good stability largest time constant in loop should be at least 4 times the sum of all other time constants.
 
Choose loop filter as single RC section with 1s time constant.
Measured OCXO control input resistance approximately 1M so choose 22k & 47uF to avoid loss of tuning range.
Add a second RC section to further attenuate 10 kHz from comparator choose 10k & 1uF.
 
Max OCXO error at extremes of tuning range ~ 100Hz giving 0.1Hz at phase comparator so output of filter should sweep almost full range (0-5v) at OCXO control input and thus easily acquire phase lock.
 
Simulation confirmed satisfactory performance.
 
 
Output divider
A range of output frequencies is provided by a second ATtiny85 again clocked from the OCXO.
It also provides a fixed 10MHz output from its clock buffer pin.
 
A 10 way switch is used to select frequencies of Off, 5M, 2.5M, 1M, 100k, 10k, 1k, 100, 10 or 1Hz
(Off position ensures no subharmonics on 10MHz output.)
 
ATtiny85 has limited number of I/O pins so resistor chain and (single) Analog Input pin was used.
Running the A/D continuously would compromise output purity so the comparator was used to generate interrupt when switch position changed.
This was achieved by the use of ten resistors in two chains arranged such that odd switch positions give voltages below the internal comparator reference (1.1v) and even positions give voltages above.
The ‘interrupt on comparator change’ function is then used to start the A/D only when required.
(The switch I used was MBB so the wiper was always connected. A stop was required between positions 1 and 10 to avoid shorting the supply.)
 
Adding a USB-TTL serial module (ebay again!) gives the ability to monitor the NMEA data from the GPS module (once per second), when the USB port is not in use the GPS module is reconfigured to suppress the output of NMEA messages.  (I’m not sure if this avoids 1Hz spurii but it makes me feel better if nothing else!)
(There is a slight penalty in that the divider output stops for approximately 2.5mS at the changeover but this does not cause much of a glitch. The delay is arranged to be an integer number of cycles at the comparison frequency.)
 
Power supply
A stable power supply is required and for lowest noise a linear supply is best, however low power dissipation is desirable to minimise heat rise within the equipment, ventilation would allow drafts to have more of an effect.
I chose an external power ‘brick’ and an internal switch-mode regulator with a lot of filtering (and a crowbar to protect the OCXO in case of regulator failure).



The zip file attached contains compiled and source code files for the ATTiny85s, fuse settings are in the source code headers.


'Test' is a simple circuit using the time pulse output of the NEO-7M to give a selection of preset frequencies from 1Hz to 10MHz (with jitter!).


Jim
Hi Jim
What a great project and write up. Thanks for sharing it.
I have thought of getting a frequency reference and this one may be the one I build.

Frank
Looks like a good project.

Good quality 10MHz oscillators are now widely available at reasonable cost. 0.2ppm basic tolerance is an interesting level of performance. I'm well aware of it because it's what's needed for a top quality TV sync pulse generator. Traditionally it was a bit out of reach for a TXCO but a rather low spec for an oven. The ovens were quite big and expensive too.

Now you can buy low-ish cost TCXOs with 0.2ppm stability over a reasonable temperature range. And you have found a low cost compact oven with similar stability.

You can also buy GPS disciplined OCXO modules. No idea of cost: https://www.iqdfrequencyproducts.com/pro...ned-ocxos/

If you really want to push the boat out you can get compact rubidium standards. Prices start at the $1000 level. Secondhand ones may well be very worn out - they don't last for ever. Most people would be better off with a GPS based system.
Rubidium (Rb) standards in module form (ex Chinese cellphone base stations) are still available (eg Efratom). Prices are £100-£200 now (used to be £50-£100). I have had a few and all were fine, with lots of life left in the physics package. Unless you plan to run them 24/7 they should have decades of life left in them. As long as they are fired up every month or so for some hours they stay very happy. They don't like to be left for years unloved!
For completely obsessive-level accuracy and stability you slave a RB standard to a GPSDO. I have both but not linked. The main advantage of a RB standard is that it does not rely on antennae and clear sight of the sky.
Our radio club had a project based on those excellent Ublox modules. The ones from China are almost certainly clones but work fine. Various designs exist including one in Practical Wireless April 2018.
-Jeremy
A quick update that may be of interest; I recently came across a very cheap source of OCXOs that are suited for this project (CTI OSC5A2B02)

Cost was £9.21 for 5 including VAT, P&P from Aliexpress. Although a little battered all 5 were within specification.


Radio frequency 1988 store

Spec is here


ebay_queen's_land


With this OCXO the loop time constant is 13.3 sec so I increased C3 to 180uF (T= 4sec)


Stability was improved at the cost of slightly increased warm-up time and power consumption.


Jim
(21-07-2021, 03:34 PM)jimmc101 Wrote: [ -> ]A quick update that may be of interest; I recently came across a very cheap source of OCXOs that are suited for this project (CTI OSC5A2B02)

Cost was £9.21 for 5 including VAT, P&P from Aliexpress. Although a little battered all 5 were within specification.


Radio frequency 1988 store

Spec is here


ebay_queen's_land


With this OCXO the loop time constant is 13.3 sec so I increased C3 to 180uF (T= 4sec)


Stability was improved at the cost of slightly increased warm-up time and power consumption.


Jim

Hi Jim. I've got that same OCXO but according to my measurements, Kv=43,98 rad/s/V. So that would be a time constant of approximately 2,3sec
How did you get to obtain 13.3sec?
The units used must be consistant, if rad/s/V are used for Kv then V/rad must be used for Ko.
I use Hz (cycles/sec) for Kv and V/cycle for Ko as this seems more practical to me.
In either case the units cancel (radians or cycles).

eg for 5v EXOR phase comparator Ko = 5V/(half cycle) = 10V/cycle = 10V/(2.pi) = 1.59 v/radian
  and VCO with Kv of 7Hz/V = 43.98 rad/s/V
  and division ratio N of 1000

  T = N/(Ko.Kv) 1000/(10x7) = 14.3 seconds or
  T = N/(Ko.Kv) 1000/(1.59x43.98) = 14.3 seconds

Sorry for any confusion, I'm just to old and lazy to convert form cycles to radians when they cancel anyway.

Jim
Hello Jim,

Have you done any comparisons between MSF and your GPSDO? Just curious since you have MSF there.

Sam
W3OHM
You have WWV and its subsidiaries there, they are much the same as MSF really. MSF is as accurate as, if not better than, GPS. Even the carrier frequency is locked to atomic time.
As GPS uses "below the noise" signal levels it needs a lot of averaging to get good data, this helps getting a good DO (defined oscillator). MSF however is (here at least) a big signal and can be used directly especially for near as damn it seconds pulses. For a stable DO some temporal averaging is used such as a crystal PLL.

I don't have a GPSDO but do have a 198kHz (BBC Radio 4 longwave, the carrier is from a Rubidium standard) frequency source, it works well.
Sorry I have not done any comparisons with MSF.
Jim
Pages: 1 2