[time-nuts] First success with very simple, very low cost GPSDO

Tom Van Baak tvb at LeapSecond.com
Thu Apr 10 19:35:42 UTC 2014

Use 16-bits if you have it, especially during cold/warm start. But if you only have 8-bits then I can think of two solutions. One is to extend the h/w 8-bit timer with one or two bytes of s/w overflow count. The other is to reduce the sample rate by 2^N (you can do this on a PIC with a prescaler; not sure about AVR) so the numbers are smaller by a factor of 2^N and still fit in 16- or 8-bits. It's one of the rare cases where a trade-off between range and resolution is in your favor.

If your CPU doesn't have a prescaler, or maybe even if it does, just use 16-bits. Or implement the overflow code -- but realize that it's really tricky to make it work at the boundary conditions.


----- Original Message ----- 
From: "KD0GLS" <kd0gls at mninter.net>
To: "Tom Van Baak" <tvb at leapsecond.com>; "Discussion of precise time and frequency measurement" <time-nuts at febo.com>
Sent: Thursday, April 10, 2014 11:48 AM
Subject: Re: [time-nuts] First success with very simple, very low cost GPSDO

I should have said warm start, not cold. I was referring to the code, not the oscillator. So tell me, the OCXO is warm, there's no previous EFC information to draw upon, and the oscillator is off-frequency by more than can be measured with, let's say eight timer bits. What do those early measurements tell me, and which direction from midway should the EFC be adjusted?

> On Apr 10, 2014, at 13:28, "Tom Van Baak" <tvb at LeapSecond.com> wrote:
> I agree with Charles. Further, you don't even have to wait a predetermined amount of time (this would be oscillator or environment dependent). Instead simply monitor the rate of frequency change. When the drift rate drops to the level where your PID is known to be able to track, then start the PID.
> Realize that just 2 seconds after power-up you have your first frequency measurement. By 3 seconds you have your first drift measurement. Just wait until it falls to however few ppm/second or ppb/second you need for your loop to smoothly track. This avoids special case PID startup or wind-up code. Although you can argue it merely replaces it with special case drift rate code.
> I'm suspicious of fast/slow tracking loops. If you want to vary the tracking, perhaps it is best to continuously, transparently, smoothly vary loop parameters according to drift rate rather than use a hardcoded fast/slow algorithm binary switch. I'm sure there's deep theory on this, which I have not read yet.
> /tvb
> ----- Original Message ----- 
> From: "Charles Steinmetz" <csteinmetz at yandex.com>
> To: "Discussion of precise time and frequency measurement" <time-nuts at febo.com>
> Sent: Thursday, April 10, 2014 10:55 AM
> Subject: Re: [time-nuts] First success with very simple, very low cost GPSDO
>>> In my case, the cold-start frequency of my OCXO with EFC at midpoint 
>>> was off sufficiently far that I needed a minimum number of remainder 
>>> bits to know which way to initially steer it. Don't recall the exact 
>>> number I needed, but it was more than eight at 10 MHz. Like this 
>>> design, I had 16 bits to work with, which gave me a usable range.
>> Why even try to discipline an OCXO before it's warm?  Just leave the 
>> control loop off for a predetermined time at startup.  You can light 
>> up a bright red "unlocked" LED, and even inhibit the 10 MHz output 
>> until lock is achieved if you want.
>> Alternatively, you could figure out the EFC voltage needed to zero 
>> the cold oscillator and load the corresponding DAC code at 
>> startup.  However, if the control loop is slow enough for good GPSDO 
>> performance at tau out to 100 seconds or more, it would probably be 
>> too slow to track the oscillator as it warms up -- so you would 
>> likely need switched fast and slow loop filters.  (Switched "acquire" 
>> and "maintain" time constants are often very useful for a number of 
>> reasons, and a GPSDO can benefit from several different "maintain" 
>> time constants for best performance in noisy conditions and 
>> recovering from holdover.)
>> Best regards,
>> Charles
> _______________________________________________
> 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_lists.febo.com mailing list