Author Topic: Lars DIY GPSDO with Arduino and 1ns resolution TIC  (Read 265602 times)

0 Members and 2 Guests are viewing this topic.

Online metrologist

  • Super Contributor
  • ***
  • Posts: 2197
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #75 on: October 16, 2018, 06:07:29 pm »
Here's my Allan deviation after one day, t=100.
ADEV of what?
I assume that 1ns of resolution average of 100 samples using Bliley NV47A1282.OCXO and Ublox NEO-M8T with ±11ns pps jitter - as reported by Lars solution (arduino output)?
« Last Edit: October 16, 2018, 06:11:12 pm by metrologist »
 

Offline larsTopic starter

  • Regular Contributor
  • *
  • Posts: 132
  • Country: se
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #76 on: October 16, 2018, 08:23:24 pm »
I saw the ADEV and as I have used the output from the Arduino my guess was that it is the DAC values taken directly from the Arduino serial port into timelab. I confirmed this with Miti in a PM.

In my GPSDO instruction on page 11 I give some hints how to find optimum Time Constant. This is also what Miti done. The difference is he choose TC=100. I have recommended TC=4. The reason is that below the TC the DAC value is heavily filtered. This is the reason the noise from the GPS is not affecting the 10MHz output. I enclose the picture from the instruction, Note it is the blue line that is the normal response from an OCXO the red contains a frequency jump that upsets the data . As you see it is MDEV and not ADEV as I think it get closer to the real word to find the optimum. In the instruction on page 11 i give an explanation. But in short the GPS signal is filtered in software so it more is like the MDEV that also is a filtered value. For the oscillator signal that more is dominated by flicker noise the ADEV and MDEV is quite close.

Ok so what you see on Mitis ADEV is not relevant below 100 sec (as the TC=100). From say 200-300s to 1000s you see the GPS. And the minimum is at around 1000s. If this curve had been done with MDEV the GPS part has been slightly lower like in my picture. Also the minimum had probably been at around 700s and the minimum value around 7E-12. This point is also probably what you can get as ADEV at 700sec as here both the GPS and OCXO is affecting the loop. At lower taus the OCXO is probably similar as at 700s and above the GPS will make the output OCXO output go towards lower ADEV's. Probably at Tau 10000s it will be around 1E-12 with a Neo7m and better with a timing receiver.

Lars

« Last Edit: October 16, 2018, 08:31:33 pm by lars »
 

Offline Miti

  • Super Contributor
  • ***
  • Posts: 1307
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #77 on: October 17, 2018, 01:15:37 am »
Yes, it is indeed the DAC.
Fear does not stop death, it stops life.
 

Offline iMo

  • Super Contributor
  • ***
  • Posts: 4627
  • Country: nr
  • It's important to try new things..
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #78 on: October 17, 2018, 10:30:22 am »
Do you mean the DAC value multiplied by "gain" (where gain = ppb/DAC)??
PS: I've been looking for best practices with the "similar" stuff here ..
« Last Edit: October 17, 2018, 10:36:31 am by imo »
 

Offline cdev

  • Super Contributor
  • ***
  • !
  • Posts: 7350
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #79 on: October 17, 2018, 01:31:31 pm »
Lars, have you ever thought of using a TCXO as an OCXO using a temperature control loop, say putting it in a foam insulated box with a resistor for heat, and a temperature sensor, shaving a bit of money off of the setup?
"What the large print giveth, the small print taketh away."
 

Offline larsTopic starter

  • Regular Contributor
  • *
  • Posts: 132
  • Country: se
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #80 on: October 17, 2018, 05:28:45 pm »
Do you mean the DAC value multiplied by "gain" (where gain = ppb/DAC)??
PS: I've been looking for best practices with the "similar" stuff here ..

Yes it is important with the scale factors when you work with Timelab. See page 12 in my instruction (found in first posts) and page 18 for a screenshoot of Timelab. Both for the DAC and ns-values it is good to have a sanity check of the scaling of your ADEV's MDEV's etc. I have often missed the ns or ppb and got a factor of a billion wrong. This is easy to see as you for example gets 1E-3 instead of 1E-12. It is worse if you just get a factor of 10 wrong. What is a little nice with the GPS modules PPS is that they are fairly predictable so if you from the PPS not get anything starting at about 1E-8 or 1E-9 at 1sec for ADEV and going down you can start to think. This is also true for the Time interval Counters whether it is the TIC inside the GPSDO controller or an extenal counter. For the TCXO or OCXO you can also guess a little what you want to see. TCXO seldom goes below 1E-10. Only best goes to -11 regions.

Well so for Timelab and a gain of 500 (in the Arduino GPSDO) the Time lab numeric field will be multiplied with 2E-12. With a gain of 100 it will be 1E-11 (1E-9/100).

Also numeric field #3 is the DAC. The other important field to use is the ns-value that is numeric field #2.

Lars
 

Offline larsTopic starter

  • Regular Contributor
  • *
  • Posts: 132
  • Country: se
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #81 on: October 17, 2018, 05:34:52 pm »
Lars, have you ever thought of using a TCXO as an OCXO using a temperature control loop, say putting it in a foam insulated box with a resistor for heat, and a temperature sensor, shaving a bit of money off of the setup?

Yes as I like to experiment. The problem are that even the best TCXO like a DOT050V (from eg Digikey) uses AT cut crystals and therefor are at least a factor 10 worse in noise compared to an OCXO with an SC-cut crystal.

Also as soon as you try to put a xtal osc in a heated temperature controlled box you looses a little of the power advantage a TCXO have including startup time.

Lars
 
The following users thanked this post: cdev

Offline Miti

  • Super Contributor
  • ***
  • Posts: 1307
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #82 on: October 18, 2018, 12:07:20 am »
I have to apologise, I shouldn't have post the graph without me understanding what it does and how to read it first. I do everything on the run lately. I should slow down or stop posting.
So what that graph is, I finally understood myself |O, it is what Lars said, the DAC captured in the third numeric field from the Arduino serial multiplied by 2E-12 which in Lars's example with a gain of 500 and 130ppb range is the correct Hz/bit but in my case with a gain of 120 and a range of about 546ppb iiiiisss not...
On top of that I didn't read that I should use t=4 so that graph is garbage...almost.
I will redo it when I find the time with the correct time constant and the correct multiplier which in my case is more like 8.33E-12.

Did I get it right this time Lars?  :-DD
« Last Edit: October 18, 2018, 12:09:50 am by Miti »
Fear does not stop death, it stops life.
 

Offline Miti

  • Super Contributor
  • ***
  • Posts: 1307
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #83 on: October 18, 2018, 01:50:59 am »
Hey Lars,

I see some wild jumps in the TIC, please see attached. Do you know where they could come from? I don't think my OCXO can jump that bad... or can it?
I don't think it is the temperature, it wouldn't create such a big jump. Maybe is the GPS? One of the satellites may be out of wack? What a crazy thought !
By the way, I'm using a Ublox NEO-M8T in fixed time mode.
The jump is bad enough that it looses lock. It recovers after awhile and it seems to be stable before and after that.
Fear does not stop death, it stops life.
 

Online metrologist

  • Super Contributor
  • ***
  • Posts: 2197
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #84 on: October 18, 2018, 08:22:52 pm »
Which one is the tic column? Is that the diff_ns right of Lock status? I would expect that to show the pps jitter and ocxo instability. Maybe you can trigger the pps and compare to the divided 1MHz on your scope to verify. It should not jump anywhere near as much as one cycle (1uS). IIRC, you would also see that as the pulse width on the phase detector output. Also, could it be something going on in the arduino?
 

Offline Miti

  • Super Contributor
  • ***
  • Posts: 1307
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #85 on: October 18, 2018, 10:32:39 pm »
The second column is TIC. There's a sudden jump from 6.9 to -88.8.
Fear does not stop death, it stops life.
 

Offline iMo

  • Super Contributor
  • ***
  • Posts: 4627
  • Country: nr
  • It's important to try new things..
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #86 on: October 19, 2018, 09:09:02 am »
In the 3.png (the second column) you may see a repeating pattern 6 samples long..
 

Offline larsTopic starter

  • Regular Contributor
  • *
  • Posts: 132
  • Country: se
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #87 on: October 19, 2018, 11:48:56 am »
I have to apologise, I shouldn't have post the graph without me understanding what it does and how to read it first. I do everything on the run lately. I should slow down or stop posting.
So what that graph is, I finally understood myself |O, it is what Lars said, the DAC captured in the third numeric field from the Arduino serial multiplied by 2E-12 which in Lars's example with a gain of 500 and 130ppb range is the correct Hz/bit but in my case with a gain of 120 and a range of about 546ppb iiiiisss not...
On top of that I didn't read that I should use t=4 so that graph is garbage...almost.
I will redo it when I find the time with the correct time constant and the correct multiplier which in my case is more like 8.33E-12.

Did I get it right this time Lars?  :-DD

Hello Miti,

You don't have to apologise. The DAC values are very useful too. Of course one of the problems is to give enough information of the surrounding conditions for both me and others.

I have used both TC=4 (best) and also the chosen TC (eg 200 or 500s) to get different information.

If the TIC (ns-value) has been normalized for min and max and you use hold-mode it will let you learn more about your GPSDO. The second column is the TIC value in ns and the third DAC-value and I find them most useful.

But go for the TC=4s for tests with DAC-values and timelab (MDEV) as this requires no TIC-lnearization if you want to find optimum TC.

Lars


Ps. I really like your and metrologist reports, pictures and charts. Continue with this.
 

Offline larsTopic starter

  • Regular Contributor
  • *
  • Posts: 132
  • Country: se
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #88 on: October 19, 2018, 12:10:29 pm »
The second column is TIC. There's a sudden jump from 6.9 to -88.8.

The first column is seconds since start. So after about 230000seconds this happens so about 3 days.

The jump seems to be about 100ns so one 10Mhz cycle. So my thought is a glitch in for example from the HC390, maybe ground?? I don't think it any problem with the GPS receiver or OCXO but a glitch. if you have got a glitch it will stay as it does here. Normally I never see a glitch. A side note: On row 9 you see the timer1 value of 25088. This should be around 25000 in locked condition (reset at start and at larger glitches etc.). The timer1 is the 10Mhz divided by two (5MHz) and counted between 0 and 49999 so repeats every 10ms.

Remember that the second row is the 1PPS with about 21ns p-p jitter (due to M8T) relative to the 10MHz, so what you see is the 1PPS jitter and that varies with the 48MHz from the M8T GPS module. The 48MHz will slowly drift so you get a triangular shape (repeating pattern) if you plot the ns-value (and sometimes hanging bridges!).

Ok as the locked condition requires the ns-value to be within 100ns but are low pass filtered with 16 seconds the unlocked condition will come after some (many) seconds. Here we can see it after maybe 40 seconds in 2.png. But the Pi-loop strives to get the ns-value to zero so after some time it will go to zero. To get Locked again we need to be below 100ns ns-value for at least five times the TC (that is in this case 500s*5).

So in the 3.png we are back again with almost zero ns-values and locked mode.

Lars


 

Offline Miti

  • Super Contributor
  • ***
  • Posts: 1307
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #89 on: October 26, 2018, 01:36:30 am »
Hi Lars,

I installed two temperature sensors, one in contact with the OCXO and the other one inside the enclosure to measure the ambient temperature. My thermostat is set to 23C when we're at home and 19 when we're not. I can see the temperature dropping up until 3:30 when the 23C setting kicks in. At that time, with TC=400, it has a hard time keeping with the drift. I would really like to add a temperature compensation but I don't know where to start between 1 and 10000. I know that you didn't have much success with the OCXO but maybe you can give me an idea where to start without over doing it so I can experiment around that number. I've attached a log that captured at least one of those temperature variations, maybe it can give you an idea. I know that it wouldn't be so trivial for me to figure out from the code how much weight that temperature coefficient would have in calculating the 16bit DAC value.

Thanks!
Miti
Fear does not stop death, it stops life.
 

Online metrologist

  • Super Contributor
  • ***
  • Posts: 2197
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #90 on: October 28, 2018, 07:05:03 am »
I moved my breadboard out into the lab where I have my Trimble UMCC running another experiment. I can use it's 10M sine wave output and monitor the OCXO under Lars disciplining solution. I can see the phase drift matches the reported ns value. (I had a lot of trouble getting my laptop to recognize Arduino, but eventually it just worked...)

I plotted a few hundred samples of ns (blue) and DAC (red). Using a TC of 4 and damping of 3. It's still open circuit flopping in the breeze. It's quite marvelous. I ordered some better parts to build it onto perf board.

I tried connecting with TimeLab and that seems to work. I'm not sure how TL knows which data to use. Also, when it connects it resets arduino.
« Last Edit: October 28, 2018, 11:23:17 am by metrologist »
 

Online metrologist

  • Super Contributor
  • ***
  • Posts: 2197
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #91 on: October 28, 2018, 02:28:45 pm »
OK, so I can use delayed acquisition or put a cap on the arduino reset pin. The live data does not look at all like the data that I can feed TL manually. I used the ns column with a 1E-9 multiplier. I need to tune the gain and TC proper to get meaningful results, this CTI OCXO should be better than this.
 

Offline Miti

  • Super Contributor
  • ***
  • Posts: 1307
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #92 on: October 28, 2018, 10:19:50 pm »
I will let it acquire more data but I think it is safe to conclude that a good TC in my case is around 500 not considering the temperature drift? Fact is that if I take the cover off of the distribution amplifier that hosts the GPSDO, it looses lock most of the time. I'll have to find the correct temp reference and compensation factor. Unfortunately my basement temperature varies wildly from 26 - 27 C in the summer to 17 - 18 C in the winter.
Fear does not stop death, it stops life.
 

Offline larsTopic starter

  • Regular Contributor
  • *
  • Posts: 132
  • Country: se
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #93 on: October 28, 2018, 10:29:35 pm »
Hi Lars,

I installed two temperature sensors, one in contact with the OCXO and the other one inside the enclosure to measure the ambient temperature. My thermostat is set to 23C when we're at home and 19 when we're not. I can see the temperature dropping up until 3:30 when the 23C setting kicks in. At that time, with TC=400, it has a hard time keeping with the drift. I would really like to add a temperature compensation but I don't know where to start between 1 and 10000. I know that you didn't have much success with the OCXO but maybe you can give me an idea where to start without over doing it so I can experiment around that number. I've attached a log that captured at least one of those temperature variations, maybe it can give you an idea. I know that it wouldn't be so trivial for me to figure out from the code how much weight that temperature coefficient would have in calculating the 16bit DAC value.

Thanks!
Miti

Hello Miti,

I enclose a picture from Excel with your data. I struggled with an old version of Excel and the result is fat from perfect but I hope you can understand. I have plotted your temperature, DAC-value and TIC ns values from about row 10000, The first 10000seconds I discarded as you had done some experiments I think.

Ok so the first about 30000seconds (about 8-9 hours) the temperature drops slowly but the DAC-value not so much. But as you say a temperature change happens (in just 45 minutes) this makes the DAC-value change much more. After a while the temperature changes again but much slower but again not a lot of DAC-value change. So here you see the problem that I am not so fond of temperature compensation for OCXO. I can see if you have much larger temperature excursions in a GPSDO in short times that it might be useful.

Ok so what about settings? First the temperature compensation uses ADC values that for an LM35 sensor is about 10 ADC steps per C. So for -2°C it is about -20 ADC steps. So 50 DAC steps is -20 ADC steps worst case. This would mean a temperature factor of -2.5 that should be multiplied by 100 and inverted. So +250. But this will overcompensate slow changes. Also read the short instruction on page 13.


Lars
 

Offline larsTopic starter

  • Regular Contributor
  • *
  • Posts: 132
  • Country: se
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #94 on: October 28, 2018, 10:43:30 pm »
Hello again Miti,

saw that you just made another reply.

I think my recent reply covered what you just say that quick temperature changes is critical. Your difference between summer and winter shouldn't be any problem.

And thanks for your MDEV plot. Will use it in a reply to Metrologist. As I understand you have used TC=4 and aquired DAC-values from row #3 (Arduino) in Time lab?

By the way a lot of my prototype GPSDO works best with TC=500s but i still have chosen TC=200s. even if it gives slightly worse result but less sensitivity to quick "large" temperature changes (like sun on the box). It also helps if the OCXO has small jumps that I have seen on several OCXO from eBay (also mentioned in appnotes from vendors like MTI).

In last reply i also forgot to calculate your apparent OCXO temperature sensitivityas I intended. As you have 50 DAC steps and a gain of 120 the frequency changes 50/120 ppb = 0.4ppb = 4E-10 for 2°C that is 2E-10/°C but for the slow changes it is much smaller of course.

Lars
 

Offline larsTopic starter

  • Regular Contributor
  • *
  • Posts: 132
  • Country: se
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #95 on: October 28, 2018, 11:01:39 pm »
I moved my breadboard out into the lab where I have my Trimble UMCC running another experiment. I can use it's 10M sine wave output and monitor the OCXO under Lars disciplining solution. I can see the phase drift matches the reported ns value. (I had a lot of trouble getting my laptop to recognize Arduino, but eventually it just worked...)

I plotted a few hundred samples of ns (blue) and DAC (red). Using a TC of 4 and damping of 3. It's still open circuit flopping in the breeze. It's quite marvelous. I ordered some better parts to build it onto perf board.

I tried connecting with TimeLab and that seems to work. I'm not sure how TL knows which data to use. Also, when it connects it resets arduino.

Hi Metrologist,

You are absolutely on the right way. With TC=4 you get information on both the 1PPS (GPS module) for low Taus from about 10 seconds in the Timelab chart. The OCXO is just seen when the OCXO gets worse than the 1PPS. For you OCXO it probably will also be like Mitis at about 500-1000secs. Here your MDEV curve will be in the E-11 or E-12 range. You need to take at least a few hours of data. I prefer to see both ADEV and MDEV Time lab charts but as I say in the instruction page 12 (start reading on page 11) the MDEV has been best for me.

As you gather DAC-value data from row 3 (see page 18, Timelab call it numeric field #3) from the Arduino serial line into Timelab needs to know that it is row #3. You also have to use the correct gain in the same place to get correct conversion (see page 12 for the calculation and examples). If you have saved at least a few hours data from the Arduino serial monitor with TC=4 you can also import data into Timelab and do the same (remember conversion due to gain). It is a lot of possibilities for postprocessing Arduino data :) .

Lars
 

Offline Miti

  • Super Contributor
  • ***
  • Posts: 1307
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #96 on: October 29, 2018, 01:03:24 am »
Thanks for your help Lars!

Yes, indeed, it is recorded with TC=4, 3rd numeric field X 8.33E-12. I didn't wait much longer as the plot didn't seem to change much, I will do it over a period of days once but I don't expect big change. I recalculated the gain by averaging 100 diff_ns readings for both h1 and h65535, before it was just by eye, and the new result is Gain=122, not too far from what I had before. I changed the temp ref to 420, it is about what I see now in the lab, and the temperature factor to 200, a bit less than you suggested so maybe I avoid over compensating. I'll keep an eye on the result and will post. I use TC=400 for now and will go down from there if needed or up to 500 if the TIC holds steady with the new temp factor.
 
Edit: The temp ref. =420 is the temperature of the OCXO and not what's in the lab since the temp sensor is silicon-ed to the OCXO side.  :phew:
Edit2: It is 420 though.
« Last Edit: October 29, 2018, 01:25:16 am by Miti »
Fear does not stop death, it stops life.
 

Offline cdev

  • Super Contributor
  • ***
  • !
  • Posts: 7350
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #97 on: October 29, 2018, 01:39:23 am »
I have a question for you all. I was surprised a few months ago to read that some of the non-professional grade GPSDOs still being sold for a lot of money on ebay basically are just a disciplined 10 Mhz source and GPS but the 1PPS is not disciplined any further by the OCXO GPS combination (to improve its jitter). They wire the internal GPS 1PPS directly to their 1PPS output and it is not smoothed out.

I suppose that to properly derive the 1PPS from the disciplined oscillator basically what would be required is a PIC chip that divides by 10 million (I think one of the the "PicDiv" preprogrammed PIC chips can do this) and then delivers a short pulse each time the positive going pulse occurs, with the setting for cable length on the input side fine tuned until the pulse matches the center of the stairstepping range (presumably the truest point along the 25 nanosecond second change range)

Its been a long day for me and I'm sleepy.. Is this right?
"What the large print giveth, the small print taketh away."
 

Offline Miti

  • Super Contributor
  • ***
  • Posts: 1307
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #98 on: October 30, 2018, 12:41:54 am »
And here are the results with and without temperature compensation. Looks more stable to me after I set the TempCoef=200. Ignore that spike in the first graph, that's me.
« Last Edit: October 30, 2018, 12:43:38 am by Miti »
Fear does not stop death, it stops life.
 

Online metrologist

  • Super Contributor
  • ***
  • Posts: 2197
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #99 on: October 30, 2018, 11:31:57 am »

Hi Metrologist,
...
Lars

Thanks, Lars. I calculate gain to be 19.2 (diff_ns = 1680 and -1740) and using g=20 you may see the green and blue curves below. It will not lock with TC over 10. I will wait for new components as I have electrolytic caps on the PWM filter and those old glass caps on the tic pulse (which might be OK), and also I have much better OCXO in 12V supply that may come to the board. I will need to read your info on setting linearization more. Note that I applied remove global linearization after acquiring data on each trace.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf