GPS Disciplined Frequency Standard
(A project in progress)
Design plan B
My goal was to find a way to use readily available parts to make a stable
frequency reference. The major problem was standard crystals wouldn't be
temperature stable enough as I showed in my first design attempt.
Use a TCVCXO
I went looking for TXCO's figuring they would be outrageously priced. I
discovered that both Fox and International Cystals make TCVCXO's which are
pretty much interchangable parts. The Fox part is avaiable from Mouser for
about $14.00. International sell's their parts direct. Didn't find a price on
their web site.
How stable though? Specs show +/-2.5ppm over a -35 to 70 degree C range. Not to
bad, but with 10Mhz nominal, that's still +/-25Hz. Now if I could control the
temperature over a realistic range, I could reduce that. For the sake of
arguement, lets say I could control the temerature +/-0.125 degrees. That would
be +/-2 from the LM74 temperature sensor. Probably optimistic, but here goes.
10Mhz * (5ppm / 105deg C) *0.125deg C = +/-0.0592Hz
At least in the right ballpark, and possibly realistic. Another thing may help
improve this. In do reasearch, I learned crystal frequency drift is not linear
over the specified temperature range. It tends to be an exponential drift
curve. The shape of the curve is dependant on the angle of cut on the quartz.
Since other things are dependant on the cut angle, it isn't the most ideal.
However, frequecy drifts less near the 25 degree C operating point. Thus if
temperature is held within a few degrees, the frequency drift would be
considerably less than predicted by a straight line temperature curve.
Another thought was, properly insulated, the temperature may drift slow enough
that the frequency discipline control could handle. In this case heaters might
tend to make the temperature drift faster and be more detrimental than useful.
These TCVCXO's have a trimmer that can be used to set the frequncy as it
ages. There is also a Vc input with a range of +/-3ppm for a 3volt control
voltage swing. Hmm, would a 12 bit DAC work here?
10Mhz * (6ppm/2^12) = 0.0146Hz
This yields a control of 1 part in 0.7e9. In the right range, but kind of
pushing it.
A different microcontroller
A fundamental problem with the Microchip PIC family is that they don't allow
for feeding 10Mhz to the counter/timers. The oscillator frequency is divided
internally by four. This allows for intructions to be processed using a four
phase clock. The same divide by four frquency is also used to synchronize
external timer clock inputs. Thus, it precludes the use of 10Mhz inputs.
I went looking for alternatives. The Atmel AVR series microcontrollers looked
promising. In particular the AT90S2313. The AVR parts don't use a four phase
clocking scheme. In fact they run four times faster than a comparable PIC. Of
real importance here is that the microcontroller runs at 10Mhz and the same
clock can be fed interally to either of the counters.
A few added bonus features: Commonly available from Digi-Key for less than
$4.00, are about half the cost of most flash PIC parts. There is an analog
comparator input that can be configured to trigger the capture of the timer
values. This solves the problem of detecting the odd low voltage 1 Hz pulse
from the GPS reciver. On chip EEPROM to store PI loop coeficients. A UART for
stats reporting. Each interrupt source has it's own unique vector adress for
more efficient interrupt handling.
There is a PWM mode, but it is not usable when the timer is used in capture mode.
Since the heater control may not be used, this is probably a mute point.
Otherwise, pwm can quite easily be done in software. The second timer can be
used as a timebase.
The new design
Here is how I envison my design ending up. There will be a two small PCBs:
A board in a temperature controlled chamber for the TCVCXO and another with
the microcontroller, buffer and power supply circuits The micro controller board
will mount over a Garmin GPS25 module. Maybe some shielding is in order here.
The TCVCXO board
This board will hold the TCVCXO, a dual 12 bit SPI serial DAC, a LM74
temperature sensor and heater resistors. All parts will be surface mount.
This board will be housed in a well insulated enclosure to slow temperature
drifting.
The heater resistors will be included provitionally, since thay may not be
needed. The heater will consist of 4 SMT resistors series connected along each
edge of the board with everything else down the middle.
The LM74 temperature sensor will be included to provide temperature statistics,
even if the heater is abandoned.
A dual 12 bit DAC is slightly more costly, but allows finer control of the
TCVCXO. The outputs of the DACs are run through a simple current summing
juction such that, one DAC provides course control, the other fine control.
The DAC is included on this board since the voltage reference could drift with
temperature.
A local 3V LDO voltage regulator will be included. This will power the TCVCXO
and DAC reference. Current consumtion is only about 2ma and the board will be
supplied with 3.3V, so the power dissapation in this regulator will be only
0.6mw. The temperature sensor and DAC must be powered from 5V to allow
intefacing with the microcontroller which must run at 5V for speed.
Micro controller board
A second board will include the Atmel AVR microcontroller. The 10Mhz output
from the TCVCXO will be connected to the oscillator input of the micro through
a level shifter. The TCVCXO outputs a 0.9Vpp signal, so this must be level
shifted to 5V logic levels.
Microcontroller software
Timer 1 will be software configured to be clocked from the oscillator input.
The 0.9Vp 1us pulse of the 1Hz output from the GPS reciever will be fed to the
micro's analog comparator input. The software will connect the analog
comaprator output to the capture input of the capture/compare function of timer
1. Thus, timer 1 acts as a frequency counter for the TCVCXO output.
Timer 1 overflows about every 6.5ms, which generates an interrupt. The handler
for this intwrrupt simply increments a register as an 8 bit counter. This is
combined with the capture register to form a 24 bit counter.
Each time the counter value is captured, an interrupt is generated. The
interrupt handler grabs the value from the capture registers tacks on the upper
8 bits from the overflow counter and adds the result to a 32 bit accumulator.
Every 64 seconds, 640 million is subtracted from the 32 bit accumulator. The
result is the error for a 64 second sample. Thus, if the VXCO was 1Hz high,
the error would be 64. In other, words 1/64 of a hertz can be resloved.
The error is fed through a PI control algorithim. The output from the algorithim
is feed to the DAC on the VXCO board via SPI protocol. Since the AVR micro
doesn't have a SPI port, this is done in software. No big deal once every 64
seconds.
The error is output on the serial port for stats collection. The serial port
will use a common MAX232 for RS232 level conversion. RF filtering of the I/O
lines will be included. The RS232 port will also allow control alogrithim
tuning. Controller coeficients will be stored in EEPROM for restart in the
event of a power failure.
Coax drivers
Since I intend to drive several pieces of equipment with this frequency
standard via coax connections, buffer will be needed. I decided to use the
0.9V level from the TCVCXO since this is close to a standard 1Vp-p video
signal. Thus, I plan to use normal 75ohm video buffers in a terminated
configuration.
This will require some level shifting and squaring at the recieving end, but
should yield the cleanest signal. Another reason for this appoach is I plan to
use this as a reference to transverter local oscilators which will be remote
mounted at the antennas. I plan to include at least four and maybe eight
buffers using quad packages.
No more DIP switches
The DIP switches of the original design will be eliminated. Properly tuned the
PI controller should be able to control the TCVCXO imediately after power up.
The flipping of switches as things warm up seems a crude way to compensate for
a poorly tuned controller.
Thermal controller
The 1Hz capture interrupt could also be used as a timebase for the thermal PI
control loop. The temperature would be sampled from the LM74 sensor on the
TCVCXO board via the same SPI interface. Enable controls would select either the
DAC or the temperature sensor.
The output of the thermal control loop would generate two numbers, the on and
off times for a PWM output. Timer 0 would generate interrupts for each
transistion of the PWM waveform. The timer is first loaded with the on time and
a output bit is set high. When Timer 0 interrupts the timer is reloaded with the
off time and the output pin is cleared low. The next interrupt restarts the
cycle.
The PWM output drives a 2N4401 through a base resistor. Only a 1 watt heater
should be needed so current draw would be under 75ma at 13.8VDC. Alternatively,
the heater could be powered from the regulated 5V supply if heat output were
reduced to around 0.7 watt. Since the 13.8VDC could wander if it were a battery
the regulated supply might be desireable.
Power supply
It would be desireable for the whole thing to run from 13.8VDC like most
ham gear. The current draw of the Garmin GPS25 board peaks at 350ma and
averages 280ma. The rest of the stuff is under 20ma. So a 0.5A regulator
would handle it, but the power disapation in a linear regulator would be 3W.
So a 0.5A regulator would be overheated.
Looking at efficiency, 3W dissipated for 1.5W load, only 33% efficient. Not
great. I decided to use a LM2671 simple switcher here. It adds about $8.00 to
the cost, but the heat generation in close proximity to the sensitive TCVXCO
is reduced considerably. If the heater is power from the 5VDC as well, the
switcher makes even more sense,
A 3.3V linear regulator feeds the 3V regulator on the TCVCXO board, tripple
regulating that supply. Maybe overkill, but we don't want no stinking supply
fluctuations mucking up our frequency.
Bells and whistles
Five status LEDs complete the design: tempurature high, temperature low,
frequency high, frequency low and heart beat. There is one more free I/O pin,
so a 16x1 LCD display running in 4 bit mode could be used instead of LEDs.
|