[time-nuts] GPSDO with all-digital phase/time measurement?

Chris Albertson albertson.chris at gmail.com
Fri Feb 28 21:18:32 UTC 2014


Bob,

If your hardware can only measure if the phase leads or lags.  I thnk
you still want to change the DAC every second.  But you don't do it
directly.  Used a "PI" controller.  (PI is just PID with no D)

You phase detector DOES measure the phase error but the resolution is
poor, you only get one bit plus the sign.  So you must assume a value
for the one bit.  Just call it 0.5 degrees or whatever.  It may not
matter much if you guess wrong.  So you get either -0.5 or +0.5 for
each phase measurement.

Then the correction is to be applied each second is Kp * (phase
measurement) + Ki (the sum of all phase measurements)
Then you set the DAC to whatever it currently is plus the above correction.

If your GPSDO is working correctly and in sync "the sum of all phase
measurements" is be nearly zero but if at start up yu are way off the
error will add up and you will apply more and more correction.  Then
it over shoots but the error integrated over time eventually goes to
zero.  The key d finding Kp and Ki

This works if your local oscillation is good enough not to loose or
gain a full cycle per second. Have some other way (based on counting
cycles)  to set it "close" then let the Pi controller take over.
Once teetotal error gets to zero the PI controller should dither the
DAC by one count up and down.

On Fri, Feb 28, 2014 at 11:31 AM, Bob Stewart <bob at evoria.net> wrote:
> Hi Charles,
>
> The problem is that the only information available is the fact that a phase crossing occurred and whether there were more than 10M counts (or less) since the last PPS.  The phase error value is not available to me, nor is the sawtooth value; which would of course be of no value.  So, if I have a + phase crossing and then a - phase crossing, what do I know?  If they are closely spaced, I can guess that the reason for the bouncing is the jitter on the PPS.  If they are not closely spaced, then I can't really conclude anything other than that there is a phase offset in one direction or the other..  I could count the number of crossings over time and estimate the angle of the phase crossing, but I can't really be sure of the direction.  Also, since this is not a timing receiver, it tends to wander around about 10-20 ns.  So, that wander might be the only reason for a +/- count.  In the case where there are two + crossings, or two - crossings in a
>  row, it is a 1/T question.  And with 1/T, it may be a long time until the next crossing, depending on how close you are in frequency, and how much the receiver wanders around.
>
> I'm aware of the limitations of the hardware.  That's why I'm working on a TIC daughterboard.  I could have used someone else's board, and a different GPS receiver, and on and on, but what fun would that have been?  My goal is to do as much as possible with as little extra as possible using this particular board, learn as much as possible, and enjoy myself.
>
> I hope that helps.  It's entirely possible that I've made some newbie mistake and that there's a good answer available.  But, in that case, I would think that someone else would have already applied it to this board.
>
> Oh, and my granddaughter has been pestering me the whole time I've been writing this, so I hope I haven't been a bit short.  =)
>
> Bob
>
>
>
>
>>________________________________
>> From: Charles Steinmetz <csteinmetz at yandex.com>
>>To: Discussion of precise time and frequency measurement <time-nuts at febo.com>
>>Sent: Friday, February 28, 2014 12:29 PM
>>Subject: Re: [time-nuts] GPSDO with all-digital phase/time measurement?
>>
>>
>>Bob wrote:
>>
>>> You can achieve very good accuracy, but at the cost of waiting thousands of seconds between "phase points"; i.e. where your 1PPS coincides with the 10 millionth OCXO pulse.
>>>
>>> So, as your 1PPS pulse bobs back and forth, you will often encounter an OCXO pulse up to 10ns early, or up to 10ns late.  So, might you count 9,999,999 pulses from the OCXO immediately followed by 10,000,001 pulses.  Neither of those, by itself is a signal to change the EFC voltage to your OCXO.  In fact, it is normal for your count to alternate between the two for long periods, if you are very very close to exactly 10MHz, just from the quantization error on the 1PPS.  It is also normal for 1/T to control the time between phase crossings.  So you have to wait for two miscounts in a row in the same direction to make a change.
>>
>>I have been puzzled more than once by your comments about only changing the DAC count every several minutes or more.  I am not familiar with the circuit you are using, but in a digital PLL the errors (assessed every second) typically feed a digital filter that drives the DAC.  So, there is generally a very small correction every second according to the long running average of the individual errors, rather than a large correction after hundreds or thousands of seconds.  If you only adjust the DAC every two miscounts in one direction, you are guaranteed to get slipped cycles (which appeared to be one of the problems you were having when comparing oscillators).  This is a reasonable way to get an oscillator roughly on frequency if it is substantially off to start with, but it is not a good way to hold an oscillator within ppb of the desired frequency, and no way at all to hold it in phase lock with the reference.
>>
>>If that is really the way the circuit you are using works, perhaps it would be better to implement a proper all-digital PLL with digital filter than trying to get better results out of the circuit you are using than it is capable of delivering.
>>
>>Or, perhaps I'm not understanding what you are doing?
>>
>>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.
>>
>>
>>
> _______________________________________________
> 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.



-- 

Chris Albertson
Redondo Beach, California



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