[time-nuts] New Subscriber, DIY GPSDO project (yes, another one)

Jim Harman j99harman at gmail.com
Sun Mar 8 16:02:32 UTC 2020


Here is the procedure I use to set up my GPSDO, which is based loosely on
Lars Walenius' excellent write-up on his system. To tune the filter you
need to have a Hold mode that opens the control loop and lets you set the
DAC value and a way to monitor the raw phase detector output minus its
nominal value, i.e. the input to the filter. Call this value err.

There will be a DAC value that causes err to remain constant, i.e. to set
the oscillator to exactly 10 MHz. Call this value DAC_Offset

For testing and setup, it is also very helpful to be able to set the time
constant on the fly

The filter updates once per sec. If your system updates at a different
rate, you will have to scale things accordingly.

The filter starts with a prefilter to smooth the GPS data. This does a
moving average of err and has a time constant of 1/2 to 1/4 of the PI
filter TC and a gain of 1. You can start with 2 for the prefilter divisor.
Call the output of the prefilter errFilt.

The PI filter has 3 parameters:

gain is the system's sensitivity to a change in err. It is the change in
DAC counts it takes to make err change by 1 count per sec.
TC is the time constant. It controls how fast the filter responds to a
change in err.
damping is the filter's damping factor. It controls the relative size of
the filter's I term and affects how much overshoot the filter has.

The PI filter boils down to
pTerm = errFilt * gain
iTerm += pTerm / (TC * damping)
output = (pTerm + iTerm) / TC

and the value sent to the DAC is output + DAC_Offset.

To tune the system, start by determining DAC_Offset. In Hold mode, adjust
the DAC value so that err stays constant. You will want to warm it up for
at least 1 hour before trying this

Next we determine the gain. Still in Hold mode, adjust the DAC value by an
amount a so that err starts to move up or down and measure its rate of
change r in counts/sec. Then gain = a/r. For example if an adjustment of
100 DAC counts makes r go from 0 to 1 count/sec, the gain is 100.

You can set the damping to 1.75 to start.

Once you have set the gain and the DAC offset, you can try closing the
loop. Set the initial TC short - 100 sec or so - and the system should
stabilize in a few minutes. My experience with an OCXO is that once the
system has thoroughly warmed up you will get best performance with a time
constant of 500-1000 sec. Optimizing the other parameters takes some
experimentation. You can observe the filter's response characteristics by
forcing step changes in the error or the DAC output or the nominal phase
detector output, but in the end as others have said, you will have to
compare your system to a known good reference.



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