Secondary Frequency Reference

After having been running a GPS unit for synchronising time on one of my local Linux machines for a couple of years, I found that the PPS made an excellent gating source for one of my frequency counters. The stability of the GPS source is such that I can easily see the timebase on the frequency counter drifting with temperature.

I though that it would be neat to be able to see how close I could get to GPS accuracy with some sort of local source. The best choice would be a Caesium or Rubidium standard, both of which seem to be available surplus from time to time. However, they are quite large and may be a bit power hungry, as well potenitially requiring replacment of parts (physics package) periodically that may be expensive.

As my budget for this project was close to $0 that was out.

Af far as accuracy goes the next best answer is a Crystal oscillator disiplined from the GPS source , as described here. This looks like it would be, by far, the best solution at the cheapest price, but it is perhaps a bit TOO simple.

So eventually I decided to build a crystal controlled reference and see what the ultimate stability and accuracy I can get out of it. Once the best result is achived, I could at some point disipline the oscillator from GPS for even better results.

Doing a bit of reserach on high precision Xtal oscillators, I found that up to the point that xtal oscillators were replaced with caesium beam as primary references, the best oscillators used 2.5 or 5Mhz AT cut overtone crystals. ( BRIEF HISTORY OF THE DEVELOPMENT OF ULTRA-PRECISE OSCILLATORS FORGROUND AND SPACE APPLICATIONS That is, the 2.5Mhz crystal oscllated at 2.5Mhz which was its 5th overtone mode. [ Note that crystal technology has proceeded past this point , but I thought that its unlikly I can achieve even mid 50s perormance ] If I ever turn up one of these 5th overtone 2.5 or 5Mhz xtals, I'll use that, but at this point the best xtals I have available are:

All the crystals were originally from 'Larkspur' type British military communication gear from the 50s/60s. I'm hoping the temperature turnover point of these xtals may be at the normal internal temperature of these sealed rigs which must be at least 40 °C.

In cruising the net I came across the circuit for a Sulzer 2.5 Mhz Frequency refrence at www.leapsecond.org. I decided that the oscillator , amplifier and AGC circuit was probably a decent pace to start from. I though I might get by with a single oven , so I bought an offcut of 3mm Wall 50x2255 aluminium tube about 180mm long to use as the oven.

Below is my first oven control circuit, which seems to work quite well. I was concerned that it might end up to be a .001Hz oscillator!


The Oven Control circuit

The LM335 has a voltage drop equal to the temperature in °K * 10mV. Thus 0 °C (273K) is 2.73V. and 40 °C (313K) is 3.13V. The 2K 10 turn trimmer is used to set the reference voltage (eg 3.13 V for 40°C) and the opamp turns on the MOSFET, which dissapates energy, heating the oven as longs as the pot voltage is greater than that from the LM335. The current through the MOSFET is limited to about 600mA by the 1 ohm resistor and the 2N2222. As the oven warms , the voltage from the LM335 increases, until the opamp lowers the gate voltage of the FET to a point where it is just dissapating enough to keep the temperature at 40°C.
The oven is enclosed in about 6mm thick non-closed cell foam to provide some insulation. It seems that closed cell foam will insulate better so I may change over to that.

With the current open-cell the heater draws about 200mA @15V for 36°C heat with ambient temperature in the shack.

The circuit of the oscillator, buffer-amplifier and feed back is shown below. The oscillator is somewhat different to the original Sulzer circuit because the 2Mhz xtal is operating in fundamental mode rather than overtone. All the caps around the oscillator are mica or film type . The emmitter inductor is currently an epoxy dipped axial type. It almoset certainly has an internal ferrite core which is not temperature stable, so I'll probably need to replace that. Also directly couipling the output of the oscillator off this indictor means any base emmitter capacitance changes of the buffer may retune the oscillator as well.
The frequency trimming cap is a glass piston type of which I have a few on hand. The maximum capacity is ~15pF and they have a tuning range that takes about 20 turns - nice and fine.

Ugly oscillator 17 Aug 2006
Missing oscillator cct

17/08/2006

As it currently stands, it seems thet the oscillaror , in the oven is moderatly stable after 4+ of hours warm up. The measured frequency 1.999,961,2 (counted over 14 seconds, with GPS is 1S gating source) doesn't change for hours. This is the best I can currently measure. However the assemly is not meachanically stable and moving causes wild frequency shifts.

17/08/2006
Tonight the oscillator kept firing up on about 5.3 Mhz. I think its due to resonance of the oscillator emmitter inductor and something else. I increased the inductor to a radial 1000uH type and things are back to ~2.00000 Mhz

21/08/2006
Over the weekend, I mechanically bolted the osillator board into the oven, and have sealed the open end of the oven with some double sided cct board with feedthroughs for pwer and a grounded line for signal out.
I have built the oven temperature regulator onto vero board and it seems to be more stable than it was on the prototype board. Howoever I think I have a few issues that need to be resoved. - Firstly how sesitive is the oscillator to input voltage changes? The actual osillator has a zener regulator but the buffer amp does not . The gain of the buffer seemed to be at least slightly effected by supply voltage, so the feedback to the oscillator may change some parameters slightly. Also the dropping resistor to the zener will get very slightly warmer with a higher voltage.

However I can't see any systematic differences when the osillator voltage is change from 12 to 15 and back to 12. This may be due poor frequency resolution oun the counter though. ( The counter is gated by GPS Pulse Per Second , and I'm integrating about 13 seconds. howwever with a 2Mhz signal the resolution is only 1/28 (.0357) PPM).

The other issue is that the 78L05 I'm using for the voltage reference for the temperature set pot on the oven regulator seems to not regulate too well.

Just checked, and varying input from 12 to 17 to 24V and the regulator output stayed within 10mV. However my meater will only read 10mV at 5V. Checking the ref voltage at the slider of the temperature set pot, there is a slightly different result:

	Vin	temp set 	
	12V	3.117V	
	17V	3.119V	
	24V	3.121V	

This implies ther would be a 0.1°C change in oven temp in going from 12 to 17V. I thought this moght be due to loading effects of the opamp, whose PS is unregulated. Adding 10Mohms in series with my meter halves its voltage sesitivity, but allows it to measure to 1 mV. With this mesurment I got:

	Vin	1/2 Voltage
	12V	2.561V
	17V	2.560V
	24V	2.562V

Which still shows 2 x 1mV change in goint from 12 to 17V. This isn't much, but untill I plot the oscllator temp vs freq curve , it may be enough to upset stability.
The second issue is the temperature stability of the 78L05 regulator. I'm about to test that by the appplication of heat from a soldering iron...

Well I could get 2 x 5mV=10mV change with a quick application of the iron to the ground lead of the 78L05. Thats no doubt a quite extreme temperature change of the device, but it would change the oven temp by ~ 0.6°C.

24/08/2006
Yesterday I built a divider to take the 2Mhz output down to 1 Hz , using 74HC390 (I bought a tube of 48 Surface mount 74HC390s from Rockby for $4!). Tonight I hookked it up to the server as a PPS input to NTP (refclock 22). The main sync source is the PPS form the GPS, so using NTP I can log the offset of the PPS from the oscillator vs the GPS.
These are the config lines from NTP.

 	server 127.127.22.0 minpoll 6 maxpoll 6 noselect iburst 
	fudge  127.127.22.0 refid OSC

Current xtal osc offsets

The slope of the chart gives the frequency error between the oscillaor and the GPS. Now I have a good way of measuring drift and small freq changes I should be able to isolate more issues.

26/08/2006

I've set up some more charts, the first shows the frequency of the oscillator calculated on each NTP refcolock update for this clock. The refclock is updated every 64 seconds (fromthe maxpoll/minpoll values of 6 with is 2^6 = 64) so I can caculate the frequency difference from a true 2.00000000000000 Mhz clock by the change in time offset over 64 seconds. This is what is plotted below. There is a fair bit of noise on this, possibly related to slight timing variation in timestamping the Oscillators PPS in the PC . I have noted though the the jitter field in the peerstats log for the PPS from the oscillator is quite high, so maybe there is some noise in the PPS itself.
Also I should note that the PPS output drives from +5 to ground which isn't really RS232 complient. Most RS232 Recivers have the threshhold at about 0.6V and obviusly the threshohold is seen, but maybe there would ba a cleaner transition is we did swing from +5 to -5V.
Ive just added a plot of the calc GPS PPS freq on the same chart and ist spread is even worse! This could be bacause the GPS sample time is 1/4 of the oscillator at 16 seconds. When I fiddled the script to get only every 4th GPS clock update the noise dropped to about the same as for the OSC, which sort of impliest that this measurement method may be too noisy.

The chart below shows that from a short cool down and restart of the oven at 05:00 it took at least 3 hours to stablise.

This next chart is a plot of the the time offsets (difference between GPS second and output form the PPS from the oscillators divider), but is has been normalised agains a linear best fit of the data points. Hopefully this will make small changes more visible. The only problem is if there is a major jump , typically due to me resetting the oscillator divider. In this case the y axis can contain upto one second which makes it a bit useless.

I seem to have some problems with noise getting into the divider and causing significant jumps

27/08/2006
I have put the osc, divider and reg on one lump of wood and soldered the signal connections. The jumps seem to have dissappeared, but the osc frequency has 'stepped' by about 1 Hz to 2,000,000.5 - why? the orientation is different , and VCC maybe slightly different.
When the board with the osc , divider etc is moved back to previuos position and running of the fixed 12V supply the freq has jumped back to 1,999,999.6 which is where it was before. The bench supply was set at 11.86 (if it hasn't changed since I disconnected it) and the fixed supply is 13.18V . Is this the difference? I'll have to try stepping the voltage at a later date to see what happens.

28/08/2006
The voltage out of the fixed supply seems to be varying somewhat. Yesterday it measured 13.18, and tongight its 13.05, Maybe the regulator is temp sensitive, or maybe its sensitive to 240V fluctuations causing input fluctuations.

Interestingly the PPM offset of the internal xtal osc in the server seems vauguly similar to the freq shifts on the xtal osc seen during today.

29/08/2006

Some very interesing results. The chart below shows the effect of stepping voltage to the whole unit. During the day the voltage was around 13V , 13.07 at 18:15 local (08:15 UTC). At this time I swapped over (with no break to a variable supply)and raised the voltage to 14.07V. At 20:10 (10:10U) I upped the voltage to 14.99V. The steps in the frequency are clearly visible.
Obviously something is quite Voltage sensitive, causing about a 0.3Hz (0.15 PPM) per volt frequency shift. To isolate this I split the supply, using a relativly fixed 13V supply for the oven and divider and a variable supply for the oscillator and buffer.
At 20:57(10:57U) I split the supplies, with a fixed 13.2V supply for the heater and divider, and variable for the Oscillator and buffer. The variable supply was at 13.2V . At 21:35(11:35U) I raised the variable supply to 14.08V, and at 22:12(12:12U) , I raised it to 14.95Volts. At 22:32(12:32U) I put both back on the ~13V fixed supply

Much to my surprise, it appears that the voltage sensitivity is on the Oven (I doubt it could be the divider, though I havent catagorically eliminated that). I'll bet the problem is temp sensitivity in the 5V reference used for the temperature setting as measured back on the 21/8


30/08/2006
This evening I have played with varying only the oven voltage only. The frequency change on going from 13.2 to 15V was about the same change as yesterday, so it looks like its all due to the heater. With the oven regulator cct voltage at 15V the oven temp sensor voltage = 3.119/3.120V . When oven voltage dropped back to 12.99V the temp sensor dropped to 3.117V. This represents a temperature change of .3°C. The frequency changed about 3.5PPM, thus the osc drift at this temperature is about 10PPM per °C. Obviously not the flat spot in the temp curve! This is so bad I'm thinking its something other than the Xtals temperature coefficient, probably the 1000uH inductor.
I was able to vary the inductance of a similar 100uH unit, as mesured on the VK3XU L-ometer, by a slight amount by heating with a soldering iron.

I'm thinking that the LM335 temp sensor may be a mistake in that I need a temp/voltage super-stable reference to compare against. A bridge arrangement using a thermister relies on temp stable resistors only, the voltage applied to the bridge doesn't matter. The long term stability of the thermistor may be an issue though. I think I'll try a 2K thermistor and see how it goes.
(Actually this is the kind of engeneering I like. Its too hard to get a drift free constant voltage reference, so we'll redesign to use an elegant bridge approach that eliminates the requirement for a stable voltage source !)

20:30 30/08/2006
Set ttyS0 & ttyS1 on hazchem to low latency with setserial /dev/ttyX low_latency. This is supposed to improve interupt handling speed.

31/08/2006
Swapped the LM335 (oven temp sensor) for a 2KOhm @ 25°C thermistor (Phillips KTY81-221). Its constant is 0.79% /°C . Its in series with a 2K from the locally regulated 5V. With this cct the change in voltage is almost 10mV/° at 25°C. The voltage change is now no longer linear with temperature, but the difference between the sensor voltage and the trimmer voltage should be effected by crappy voltage regulation.

Ive kept the LM335 just as a way of measuring the temperature . The temp is currently regulating at 38.7°C (3.117V on LM335). The oscillator is QUITE temp sensitive. At 3.129V ( 39.9°C) the frequency was 1.999,996,X , thats 2PPM low . At 38.7°C is sitting at about 1.999,999,9. I doubt if the internal temp has stabilised yet , so we'll see.

Today I also bought a 12.2880Mhz Osc manafactured by TDK. It maybe an OCXO (Oven), but I suspect its actually just a TCXO (Temp compensated Xtal Oscillator) . A combination of decade binary and /12 (74HC92) will divite it down to 1PPS.

	12288000 Hz /6
	 2048000 Hz /2048 (2^11)
	    1000 Hz /1000
	       1 Hz 
 

01/09/2006
I did some freq/temp tests that had rather disturbing outcomes..


	20:38 Initial  temp 38.2 ~1.999,999,6Mhz (adjusted temp trimmer 1/4 t CW)
	21:40 Stabilised at 28.9 ~2.000,023,5Mhz (adjusted temp trimmer poofteenth  t CCW)	 
	21:46 Stabilised at 30.2 ~2.000,023,0Mhz (adjusted temp trimmer poofteenth  t CCW)	
	22:10 Stabilised at 31.3 ~2.000,017,0Mhz (adjusted temp trimmer poofteenth  t CCW)
	22:33 Stabilised at 32.9 ~2.000,013,2Mhz (adjusted temp trimmer 1/4 t CCW)
	23:04 Stabilised at 40.0 ~1.999,996,0Mhz

Over the range 30.2 to 40.0 %deg;C there was a 27 Hz freq diff , giving 2.75 PPM per °C frequency variation.


02/09/2006
At about 10:00 (00:00 UTC) I replaced the 'Larkspur' 2Mhz Xtal with a standard 2Mhz type 'D' Xtal. This Xtal is brand new so it may show aging type drift.
At about 16:00 local (0600 UTC) I swapped back to the Fixed 13V supply from the variable(15.57V).

03/09/2006
The new Xtal seems to be much more stable. Thats a pity as I thought the big ex military xtal might be a winner. Oh well. I might try one of the 100khz Vacuum units some day.
Anyway there still seems to be be some wander in the xtal frequency, and I suspect its due to temperature. I suspect that there are some effets that will slightly vary the oven temp.
If the supply voltage changes, less current is required through the MOSFET for the same dissipation. This means its gate voltage will be slightly different. This in turn means that the difference between the temp sensor volatge and the reference (pot) voltage will be different by a voltage equal to the change in MOSFET gate voltage divided by the gain of the op amp circuit. The voltage gain is currently 100, but I may increase this to 1000 to reduce ths effect.

Also the input impedance to the opamp is not equal for both inputs. The TL072 I'm using have low input leakage currents , but they are quite temperature sensitive. There could be an oven temp shift caused by change in the TL072s input leakage variation. I think I can fix this by making both the temp sensor and reference ccts as close to identical as possible.

I'll try these mods to the oven controller after we see how the oscillator runs for a couple of days.
It looks like this exercise might be more about building high accuracy temperature controllers than any thing else !

07/09/2006
22:00 local time .Modified the oven control cct as previously discussed so that the cct is balanced, and there is more DC gain in the amplifier. There still seems to be a significant temp difference when the heater supply goes from 12 to 13V. Temp went from 3.129V (39.9°) to 3.141V(41.1°) This seems a huge increase.

09/09/2006
The variation in freq now seems much less, but it is still there from day to night. I think this is still temperature related effect in that the oven controller is changing the temperature because

10/09/2006
At 20:51 i stepped the heater voltage form 13.13 to 11.96. The freq moved from ~ 1,999,999.65 to ~ 1,999,999.74. Thats .05 PPM change for a one volt change to the heater. The variation I'm currently seeing cant be due to volteage flutuations to the heater as the voltage changes are , at the most 0.1V and the frequency changes are similar to what I've seen for this ~1V change.

The temp change at the LM335 sensor was from 3.128V to 3.126V , 0.2°C change.

Also, the heater cct now seems to be oscillating at a rate of about 1/60 Hz. The Amplitude is about +/-10mA pk-pk ontop of ~ 165mA current. Its a pretty rough and noisy waveform,and its heavily influeinced by any local air movement.

Actually, on more analysis , it may be that what appeared to be oscillation , was just cyclic effects from me moving in the shack!

I'm wondering if some of the long term variations may be due to the thermal sensor not representing the temperature of the whole oven (aluminium box). As the external temperature drops, the extremities of the box will be colder, than the temp sensor, so the average internal temperature will drop. Better insulation may improve this as the ratio of the heat conductivity of the box to the rate of loss will be better.

Back on 13V fixed supply at 21:55

11/09/2006
I replaced the insulation (~ 6mm soft grey open cell foam) with hard closed cell from from X366 packing.

Previously the oven current was about 150mA . With the new foam its about the same, but the oven temperature seems to have dropped a bit (I may hve moved something in the oven controller) . I suspect this new foam has more thermal leakage than the old foam. The Freq has jumped to almost exactly 2.000,000 Mhz and the temp is 3.13V (40°C).

15/09/2006
I disabled the oven and ran a plot of freq as the temperature dropped.

The oven took about 90 minutes to reach ambient temperature, but there is no turnover on the frequency. I was hoping to find a point wher the freq vs temp coeefficient changes direction. The temp where turnover is is the least temp sensitive point, and that oven shhould be set at that temp. It may be that the turnover is actually at 25 °C for this Xtal, which would make sense for Xtals in non temp controlled applications. Unfortunatly I cant operate the oven at 25°C!
The chart clearly shows a 3Hz or 1.5PPM shift from 40°C to 26°C

18/09/2006
On the weekend I was browsing in an Altronics catalog and I spied their range of 'Picaxe' micro controllers. These beasties are microcontrollers with preloaded a simple 'interperater' which runs a minimal version of basic. (Actually its not really an interperater, You compile the basic program on a pc , and the buyecode is uploaded to the picaxe where it uses a library of functions).
Anyway I had always dismissed these as toys, and real men always write their own machine code for micro controllers. However one of these devices Picaxe-08M was $5.95 and has three 10bit DtoA onboard. And only 8 pins to solder!
So today I bought a couple, and I can tell you there are quite nifty. The functions include serial output , using the same serial port used to program them, so writing a 3 channel data logger was as easy as :

main:	'Serial is 4800 baud by default
	sertxd ("3 channel A to D serial thingy",cr,lf)
loop:
	readadc10 1, w1    'read from ADC on port 1 into word register w1
	readadc10 2, w2
	readadc10 4, w3
	sertxd (#w1,09,#w2,09,#w3,cr,lf) 'send ascii number version of word registers
	pause 60000			 ' wait 60,000 mS
	goto loop

I'm impressed! I'll be using these again. Anyway now I have some voltage logging instrumentation, stand by for some interesting charts!

19/09/2006

I have the temperature logging on line. However with no heater current, I observe the oven temp is reading ~19°C and the ambient is ~ 23°C. I wouldn't have expected to see that much differennce in the sensors, assuming the oven and air temp are the same.

Measuring with a voltmeter, the oven is 2.977V and the ambient is 3.003V - a 2.6 °C difference.

Shorting the temp sensor inputs results in both channels reading the low reading which is the expected result, so it looks like the channels aare at least consistant. The ambient sensor has a 5k6 series resistor to 5V and the oven sensor has 3k9 to 5V.

Actually the AtoD doesn't seem exactly connect. Supposedly the ref i/p to the DtoA is Vcc for the picaxe chip , but it doesn't quite add up. Ive applied a slight correction to the temperature chart.

20/09/2006

Today we take a brief detour into Temperature Metrology.

Yesterday I obsereverd that the Oven temperature sensor was reading a few degrees lower than the Ambient sensor. Both of these sensors are 'LM335's. The Ambient sensor is a LM335Z and the Oven is an unknown variant (probably also a 'Z' ). The 'Z' actually seems to refer to the package type, a TO-92, rather than the accuracy.

Anyway, I was going to calibrate the Ambient sensor, but I didn't quite get that far. However I was able to measure its offset at 0°C. To do this I filled a small plastic cup with ice and water. While there is part water and part ice and the water is reasonably well stirred, the temperature of the water must be at 0°C untill all the ice is melted. If the sensor is dipper in the water it should be at pretty close to 0°C.

The chart below shows the result of doing this for the ambient sensor is in the chart below

You can see the temperature drops to about 5°C at 08:00 UTC and stays there until about 9:20. This is the time where the last of the ice melted. The water warms up exponetitally to ambient after this. This proves two things. Firstly that the ambient sensor is about 5°C high, and secondly the ice in water provides a quite stable temperature reference.

Another thing I should note is that with the ambient sensor removed, and the pullup resistor still inplace the AtoD was returning a value of around 1015, when it should return 1023 for Vdd on the AtoD port. This explians part of the correction I required to get the charts right.

23/09/2006

I pumped the temperature up to about 70°C and then let it drop back to the regulated temperature of 40°C. This is the result

Each 'tic' on the X axis is is 6 minutes. It looks like it took about 4 minutes for the crystal to actually get the effects of the temperature of the oven changing.. However the change in slope of the temperature coffeficinet of the crystal is clearly seen at 04:18 at 58°C and 06:33 at 56°C. This is probably a crystal temperature somewhere bout 57°C allowing for the lag between xtal temp and oven temp. Anyway there obviously a point around 57°C where the tempco changes direction. This is where The xtal temperature should be set.

(Note there temperatures are not spectacarly well calibrated as yet and their absolute value may be a couple of degrees out. The relative values should be pretty good though.)

The chart below shows the frquency offset for the 'optimum cut' AT Xtal [Ref 3]. This provides better than 12.5 PPM from -50 to +100°C. (My graph may not be exact, its just a 4th order quadratic function). I'm assuming most xtals will be this cut. Note the change in tempco direction at 60°C. This pretty well matches what the tests above show.
Typical freq offset for AT cut xtal relative to 25°C

A summary thus Far








Misc references