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

0 Members and 2 Guests are viewing this topic.

Offline lars

  • Regular Contributor
  • *
  • Posts: 132
  • Country: se
Lars DIY GPSDO with Arduino and 1ns resolution TIC
« on: August 11, 2017, 09:18:19 pm »
Yet another DIY GPSDO! On the internet you can find a lot of DIY GPSDO designs. What are the differences between them? Why this?
Some + and – I can come up with for mine:

+ 1ns resolution TIC (Time Interval Counter)
+ PLL (not FLL)
+ Uses Arduino (ok some might say it is negative)
+ Low parts count and cheap components
+ No need for a specific GPS receiver only requires 1PPS in
+ Easy adaption to different oscillators (from simple VCXO to Rubidium)
+ Configuration for VCO range, time constant (4-32000s) and a lot of other parameters
+ Outputs time error (ns), DAC value and temperature (and a lot of other information) to the serial port
+ Logs time error, DAC value and temperature every third hour
+ Stores last DAC value for use at power-up
-DAC resolution (now 16bits) and stability could be better
-No saw tooth correction
-No adaptive time constant
-Not using information from receiver e.g. number of satellites etc.
-No standardized communication protocol like many commercial GPSDO’s
-No display

Why did I do this? Since about 2010 I have developed my GPSDO. It started just because I was lazy and tired of tweaking my 10MHz house standard. The only thing I am proud of is the 1ns resolution TIC. A couple of years ago I published an old version on the time nuts forum. This time I decided to use this forum instead as I think my DIY GPSDO is something for experimenters in this forum.

For me it is perfect for experiments. I have learned a lot during the years I have used it (and developed it).

I have built several complete GPSDO’s but now the only one I have running continuous is a rubidium based DIY Arduino GPSDO I use as a lab standard for my instruments. That Rb GPSDO has been running almost continuous for more than five years with different versions of my Arduino software.

Today you can get a GPS module + antenna for about 10USD from eBay, an OCXO for 10-20USD, a metal box and connectors for about 10USD, the Arduino pro mini and all other components for about 10USD, So around 50-60USD should be enough to get all components for a complete GPSDO.



As I had problems with file extensions I added .txt to the arduino sketch .ino. You have to take away the .txt and place it in a folder with the same name. To easier read the file without arduino see the .txt without .ino in the file name.

I also had to divide the instruction as it was about 2MB. Sorry for the inconvenience.

Lars

Offline lars

  • Regular Contributor
  • *
  • Posts: 132
  • Country: se
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #1 on: August 11, 2017, 09:19:50 pm »
Pages 8-18 of instruction
 
The following users thanked this post: cdev

Offline lars

  • Regular Contributor
  • *
  • Posts: 132
  • Country: se
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #2 on: August 11, 2017, 09:23:18 pm »
Last pages 19-21

Lars
 
The following users thanked this post: cdev

Offline Gyro

  • Super Contributor
  • ***
  • Posts: 4669
  • Country: gb
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #3 on: August 12, 2017, 07:51:04 pm »
An impressive looking design Lars. Thank you for sharing the full details and code.  :-+

Given the very low circuit complexity and cheap arduino based implementation (I think it is a positive), it would be hard to find a reason not try it out. Time to modify my messy LEA-6T 100kHz PLL breadboard.
Chris

"Victor Meldrew, the Crimson Avenger!"
 

Offline jpb

  • Super Contributor
  • ***
  • Posts: 1621
  • Country: gb
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #4 on: August 12, 2017, 10:12:15 pm »
Thanks for publishing your design and experiences.

I have a long term project to produce a GPSDO but have got side-tracked on trying to improve my ADEV measurements (so I can select OCXOs). Also I keep changing my design approach which is half the fun.

I was interested to see that your currently run a rubidium full time - is this on all the time are just when you need it? I was leaning towards using an OCXO rather than rubidium because of better phase noise, lower power consumption and longer life. I have a couple of rubidiums but I wouldn't like to run them 24x7 for years because I'm not sure how much lamp life is remaining.
 

Offline edpalmer42

  • Super Contributor
  • ***
  • Posts: 1623
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #5 on: August 12, 2017, 11:10:52 pm »
FWIW, I have an Efratom FRK Rb Standard that's been running 24/7 for 6 years.  The voltage that represents the lamp output hasn't moved.  These things have a long design life and are expected to be on 24/7.  Problems with the lamp do occur, but I don't think it's something you need to worry about.

Ed
 

Offline jpb

  • Super Contributor
  • ***
  • Posts: 1621
  • Country: gb
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #6 on: August 13, 2017, 09:18:22 am »
FWIW, I have an Efratom FRK Rb Standard that's been running 24/7 for 6 years.  The voltage that represents the lamp output hasn't moved.  These things have a long design life and are expected to be on 24/7.  Problems with the lamp do occur, but I don't think it's something you need to worry about.

Ed
Thanks, that is useful to know.
They are certainly more stable when left running all the time - I found with mine that they needed a couple of hours or so to settle when I was making measurements - though they only take a few minutes to lock.
 

Offline jpb

  • Super Contributor
  • ***
  • Posts: 1621
  • Country: gb
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #7 on: August 13, 2017, 09:37:33 am »
Hi Lars,

I realise that the forum requires you to split your pdf but, as a very minor point, it would be good to split it even pages so that those of us who still like to print things out and do so duplex can seamlessly merge the different sections.
eg 1-6, 7-14 etc.

Thanks again for writing up and sharing. This is probably a better forum to do so as I (and I suspect others) read stuff here but only read stuff on time-nuts if doing a particular search. I did join time-nuts for a while but the number of emails landing in my inbox, only some of which were relevant to my interests, was too much for me. (I know you can set up email filters etc but I prefer to keep my emails for communications and forums for news/general discussions.)
 
The following users thanked this post: W0MPM

Offline Gyro

  • Super Contributor
  • ***
  • Posts: 4669
  • Country: gb
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #8 on: August 13, 2017, 12:00:16 pm »
Quote
I realise that the forum requires you to split your pdf but, as a very minor point, it would be good to split it even pages so that those of us who still like to print things out and do so duplex can seamlessly merge the different sections.
eg 1-6, 7-14 etc.

The simplest way to reconstitute them into a single pdf is the online PDF Merge. https://www.pdfmerge.com/

You can then manage the odd/even printing as you normally do.
« Last Edit: August 13, 2017, 12:04:47 pm by Gyro »
Chris

"Victor Meldrew, the Crimson Avenger!"
 
The following users thanked this post: jpb

Offline retrolefty

  • Super Contributor
  • ***
  • Posts: 1604
  • Country: us
  • measurement changes behavior
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #9 on: August 13, 2017, 02:11:19 pm »
I need to follow this. I have most the stuff but just to lazy sometimes to follow up. Main problem is that I don't really require a bench 10Hz standard, but still I feel any guy must have one of these humming along.

 Does that mean I might potentially a time-nut disease candidate?   :-DD

 
 

Offline Gyro

  • Super Contributor
  • ***
  • Posts: 4669
  • Country: gb
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #10 on: August 13, 2017, 03:26:46 pm »
Quote
Main problem is that I don't really require a bench 10Hz standard

It looks as if you're a Million times less susceptible than others.  ;)
Chris

"Victor Meldrew, the Crimson Avenger!"
 
The following users thanked this post: cdev

Online pigrew

  • Frequent Contributor
  • **
  • Posts: 509
  • Country: us
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #11 on: August 14, 2017, 01:26:17 am »
I've also been thinking putting together a GPSDO, and my thinking has been similar to your design. Some quick ideas for your design: could the 10M pull down be removed, and instead toggle an internal pulldown in the MCU at the appropriate time? I also worried about the temperature coefficient of the diode. Perhaps using a small high-side pFET instead of the diode could work better?

For my design, I was contemplating using the TDC7200, but that may be overkill.
 

Offline cdev

  • Super Contributor
  • ***
  • Posts: 5082
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #12 on: August 14, 2017, 03:28:05 am »
Have you seen the Navspark, even the Navspark Mini, which is both a GPS and a microprocessor (32 bit) that can run Arduino code and is substantially faster than an Arduino? Also the GPS in it is quite good.

In keeping with the "ghetto" approach I am not even considering their timing GPSs, their $7 Mini will do.

Its PPS seems to be very reliable, even with a passive antenna and it's got the ability to act as a semi-stationary GPS to some extent.

It can generate a higher frequency signal by telling it to generate a certain frequency as a clock signal for i2c. How stable that is, if it is locked to GPS I don't know but it seems to me as if it does use the GPS to discipline its internal clock within limits so it is possible that even though it is a non-timing GPS the integration of the controller into a GPS might make it possible to implement a GPSDO with only the GPS/CPU and the OCXO and a display and perhaps some switches and a USB-UART dongle. With your existing code, since its Arduino-compatible.

 It also has Beidou in addition to GPS which gives it very stable fixes when Beidou sats are available alongside the GPS ones..   
« Last Edit: August 14, 2017, 01:58:30 pm by cdev »
"What the large print giveth, the small print taketh away."
 

Online pigrew

  • Frequent Contributor
  • **
  • Posts: 509
  • Country: us
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #13 on: August 14, 2017, 04:13:59 am »
Have you seen the Navsark, even the Navspark Mini, which is both a GPS and a microprocessor (32 bit) that can run Arduino code and is substantially faster than an Arduino. Also the GPS in it is quite good. In keeping with the "ghetto" approach I am not even considering their timing GPSs, their $7 Mini will do.

Its PPS seems to be very reliable, even with a passive antenna and it's got the ability to act as a semi-stationary GPS to some extent.

It can generate a higher frequency signal by telling it to generate a certain frequency as a clock signal for i2c. How stable that is, if it is locked to GPS I don't know but it seems to me as if it does use the GPS to discipline its internal clock within limits so it is possible that even though it is a non-timing GPS the integration of the controller into a GPS might make it possible to implement a GPSDO with only the GPS/CPU and the OCXO and a display and perhaps some switches and a USB-UART dongle. With your existing code, since its Arduino-compatible.

 It also has Beidou in addition to GPS which gives it very stable fixes when Beidou sats are available alongside the GPS ones..

I worry there is no over-constrained timing mode in the NavSpark mini.. That'll probably add a bit to its PPS jitter. (I'm not sure how much).

I'm not convinced it's necessary to use a higher frequency reference clock. The PPS signal from GPS is normally specified to be accurate with sigma=10 or 15ns, even with  sawtooth correction. Sampling the higher frequency from the receiver won't help (if sawtooth correction is used).

Also, loop constants are normally many minutes, comparisons more often than every second won't be helpful.... There should already be enough averaging.
« Last Edit: August 14, 2017, 04:49:23 am by pigrew »
 

Offline texaspyro

  • Super Contributor
  • ***
  • Posts: 1296
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #14 on: August 14, 2017, 04:47:57 am »
How stable that is, if it is locked to GPS I don't know

It isn't locked to anything...   
 

Offline metrologist

  • Super Contributor
  • ***
  • Posts: 1786
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #15 on: August 14, 2017, 06:25:23 am »
would I be able to use a different phase detector, such as MC4044P? It looks like the phase detector#2 out is the same as specified detector #3, which changes state only on any rising edge?

http://www.unitechelectronics.com/MC4044P_PLL.pdf
 

Offline Gyro

  • Super Contributor
  • ***
  • Posts: 4669
  • Country: gb
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #16 on: August 14, 2017, 09:03:55 am »
The MC4044 is a TTL device rather than CMOS. I that means that it will have greater input loading on the OCXO. Its TTL output levels (rather than full swing CMOS) will probably affect the the characteristics of the voltage ramp on C1 (I note that the MC4044 needs an internal charge pump and amplifier in its loop filter).

As an aside, the HC4046 includes self-biasing CMOS Sig. and Comp. inputs, meaning that they can be AC coupled. Lars hasn't used this feature but it may be useful, depending on the output swing of the OCXO.
Chris

"Victor Meldrew, the Crimson Avenger!"
 

Offline retrolefty

  • Super Contributor
  • ***
  • Posts: 1604
  • Country: us
  • measurement changes behavior
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #17 on: August 14, 2017, 02:52:47 pm »
Quote
Main problem is that I don't really require a bench 10Hz standard

It looks as if you're a Million times less susceptible than others.  ;)

Good one    :-DD

Typos can be so fun on a technical site.    :-+
 

Offline metrologist

  • Super Contributor
  • ***
  • Posts: 1786
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #18 on: August 14, 2017, 07:24:27 pm »
The MC4044 is a TTL device rather than CMOS. I that means that it will have greater input loading on the OCXO. Its TTL output levels (rather than full swing CMOS) will probably affect the the characteristics of the voltage ramp on C1 (I note that the MC4044 needs an internal charge pump and amplifier in its loop filter).

As an aside, the HC4046 includes self-biasing CMOS Sig. and Comp. inputs, meaning that they can be AC coupled. Lars hasn't used this feature but it may be useful, depending on the output swing of the OCXO.

That sounds like a no... Otherwise I have an ON 14046, but not with the #3 detector, so I think it won't do either. I'll have to draw up a list of parts to make the shipping from DK worth it. Thanks.
 

Online pigrew

  • Frequent Contributor
  • **
  • Posts: 509
  • Country: us
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #19 on: August 14, 2017, 08:57:05 pm »



That sounds like a no... Otherwise I have an ON 14046, but not with the #3 detector, so I think it won't do either. I'll have to draw up a list of parts to make the shipping from DK worth it. Thanks.


Why not use a SR latch/flip flop like the SN74LS279 or SN74*74? Are they higher jitter?
 

Offline metrologist

  • Super Contributor
  • ***
  • Posts: 1786
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #20 on: August 14, 2017, 10:30:07 pm »



That sounds like a no... Otherwise I have an ON 14046, but not with the #3 detector, so I think it won't do either. I'll have to draw up a list of parts to make the shipping from DK worth it. Thanks.


Why not use a SR latch/flip flop like the SN74LS279 or SN74*74? Are they higher jitter?

I'm not savvy enough to figure that out. I suspect it would downgrade the design to FLL and there is still the matter of TTL levels (where is one reading CMOS levels for the specified PLL anyway? It is CMOS and TTL compatible so I thought output would be Vcc?).
 

Offline albert22

  • Regular Contributor
  • *
  • Posts: 177
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #21 on: August 15, 2017, 04:58:42 pm »
Excelent info Lars. Specially in what to expect with different types of oscillators and gps.
I am starting to experiment with this and your post was useful to bring me down to reality,

here is another good article with a similar interpolator method that uses a74hc74.
http://n1.taur.dk/gpsdo2a.pdf

Thanks for sharing all your data
 

Offline metrologist

  • Super Contributor
  • ***
  • Posts: 1786
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #22 on: August 16, 2017, 01:35:36 pm »
Yes, thanks all for posting the project information with so much details. I was looking more into the Time Interpolator circuit and discovered a patent issued in 2012 to Lewis Masters/Phase Matrix Inc. It's quite a brilliant way to increase the timing resolution.
 

Offline jpb

  • Super Contributor
  • ***
  • Posts: 1621
  • Country: gb
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #23 on: August 16, 2017, 06:20:21 pm »
Yes, thanks all for posting the project information with so much details. I was looking more into the Time Interpolator circuit and discovered a patent issued in 2012 to Lewis Masters/Phase Matrix Inc. It's quite a brilliant way to increase the timing resolution.
2012 sounds very recent. The general approach of time dilation by charging capacitors at different time constants has been around a long time - I think many oscilloscopes used to use it.
 

Offline metrologist

  • Super Contributor
  • ***
  • Posts: 1786
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #24 on: August 16, 2017, 07:07:51 pm »
Yes, there are many patents dating back to the 60's and many are referenced:

https://www.google.com/patents/US8324952

Masters implementation is just different than the others discussed here (but I think Lars may have made reference to a similar approach in his write-up - I did not look into those other designs yet). What really qualifies it as unique  :-// seems very much the same idea, just using switches to turn off charging and discharging circuits, and an amplifier before the ADC.

The concept was not something that I was familiar with, but the general problem was something that was lurking in my thoughts of using a micro to time the events by counting cycles, and how I was going to overcome this problem.
« Last Edit: August 16, 2017, 07:33:37 pm by metrologist »
 

Offline lars

  • Regular Contributor
  • *
  • Posts: 132
  • Country: se
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #25 on: August 16, 2017, 08:40:22 pm »
Yes, there are many patents dating back to the 60's and many are referenced:

https://www.google.com/patents/US8324952

Masters implementation is just different than the others discussed here (but I think Lars may have made reference to a similar approach in his write-up - I did not look into those other designs yet). What really qualifies it as unique  :-// seems very much the same idea, just using switches to turn off charging and discharging circuits, and an amplifier before the ADC.

The concept was not something that I was familiar with, but the general problem was something that was lurking in my thoughts of using a micro to time the events by counting cycles, and how I was going to overcome this problem.

The patent from 2012 looks very similar to the PICTIC II design from 2010
http://www.ko4bb.com/doku2015/lib/exe/fetch.php?media=precision_timing:pictic_ii_schematic.pdf
see page two with a current source Q1, diode D5 and capacitor C116 and two switches through D1 and D2 going to an op-amp and ADC!

Of course these designs are better than mine but not as simple. I have not yet seen any just using the diode, series resistor, capacitor and discharging resistor (except those clearly based based on my design as Nick Sayers and the Elektor GPSDO).

Lars
 

Offline lars

  • Regular Contributor
  • *
  • Posts: 132
  • Country: se
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #26 on: August 16, 2017, 08:44:48 pm »
Excelent info Lars. Specially in what to expect with different types of oscillators and gps.
I am starting to experiment with this and your post was useful to bring me down to reality,

here is another good article with a similar interpolator method that uses a74hc74.
http://n1.taur.dk/gpsdo2a.pdf

Thanks for sharing all your data


I really like Kasper's article and have read it closely. I even at a time wondered if I should change to his design but still think my are simpler and easier with enough resolution and stability. I also have worked a lot to prove that my design is robust with regard to the sync between the phase detector and timer1 readings. Testing a new design, including all kind of modes, user cases and environment takes time.

Lars
 

Offline lars

  • Regular Contributor
  • *
  • Posts: 132
  • Country: se
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #27 on: August 16, 2017, 09:20:06 pm »
Hello all,

And thanks for the positive comments.

About the pdf's:
Probably in the long term I should publish this somewhere else if the design works well for more people. Pdf-merge seems to be a good way to combine them even if I haven´t tried it (I have a complete pdf that took some time to divide   ;)? ) .

About rubidium or OCXO:
I have my rubidium powered all times. Of course we have power interrupts. The longest continuous run without an interrupt has been above 30 million seconds on the internal time counter, that is almost a year!

I was happy to buy two LPRO rubidiums cheap five years ago so I have one spare that I only power up seldom. Now it has been on for a couple of months as I have done a lot of tests and wanted a second opinion from another rubidium. The reason I use the rubidium is that it is by far the most stable oscillator I have in hold mode (free running). For me that want to test other GPSDO´s this is the best choice. My continuously powered rubidium has very low drift. From the 3 hour logs the last 9 months I can see a drift of 700 dac_value units, that is about 1.2E-11 for 270 days so about 4E-14/day. Worse is the temperature coefficient that is about 8E-13/C but in hold mode the temperature is compensated so probably within +-2E-13/C. The worst problem is the air pressure sensitivity of about 7E-14/mbar. I have a pressure sensor BMP180 built in but it doesn´t compensate. The air pressure is mostly a problem for me at long runs that are week long, as the air pressure varies slowly.

For most people I guess an OCXO based GPSDO is best. It will give about 9-11 digits of frequency accuracy. For those that want even lower power of course an VCTCXO based with e.g. DOT050V is a very good choice but only gives 8-9 digits for short times (seconds to minutes).

A lot of people think OCXO based GPSDO's take too long time to start up. If you want the GPSDO to lock in 5 minutes that is just the warm-up time for the OCXO, but remember that even with a retrace of 10ppb after being off for a long time, you will never be off more than 10ppb, as the old DAC value is stored in the EEPROM. So you will have 8 digits and probably better within 5 minutes, but no locked LED. If you set a short time constant say 20 seconds the locked LED will come on within just minutes after warm-up. This will of course give more ripple on the frequency but not worse than other designs that promise short start-up times. If you really want very good frequency accuracy you need to have long time constants mostly depending on the 1PPS stability that limits this. Another thing to remember is that I have used a quite conservative lock time of five time constants to be sure the loop has settled. The frequency probably is stable after half of that time at most start-ups.

Lars
 
The following users thanked this post: cdev, Gyro

Offline lars

  • Regular Contributor
  • *
  • Posts: 132
  • Country: se
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #28 on: December 04, 2017, 07:58:06 pm »
Going through the last weeks time-nuts archive I found that Stanford has updated the FS740 GPSDO/counter/generator manual (that some may have downloaded an earlier version from the links on page 15 of my instruction).
http://www.thinksrs.com/downloads/PDFs/Manuals/FS740m.pdf

The updated manual now contains the complete BOM and 20 pages of schematics last in the manual. For me that are curious it is always interesting to see commercial designs.

Here you can see how they have done their Time interval counter with 1ps resolution. They also seems to combine a 16+12bit DAC to steer the oscillator.

Read also the comments by Attila in the time nuts archive here:
https://www.febo.com/pipermail/time-nuts/2017-November/107608.html

Lars
 
The following users thanked this post: BradC

Offline Qw3rtzuiop

  • Regular Contributor
  • *
  • Posts: 60
  • Country: de
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #29 on: May 11, 2018, 09:08:28 am »
Thanks for your efforts! I build the minimal design on a protoboard with one of those 10$ OCXOs from ebay.
It worked well but i can only test it with my 53131a with the HS OCXO.
Now i started to design a pcb for that. If it works i want to add a distribution amplifier.
 

Offline lars

  • Regular Contributor
  • *
  • Posts: 132
  • Country: se
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #30 on: May 22, 2018, 07:33:52 pm »
Hello Qw3rtzuiop,

Nice to see a PCB design of my GPSDO. It is always possible to have a lot of comments. Both on the layout and also on the schematic.
But my advise is just to go on if not someone find something really stupid you should change.

I decided not to do a PCB design for several reasons. The first is that everyone have different requirements on for example output ports, oscillator pinout and connectors. You have a point in having a distribution amplifier. I had salvaged boxes from automated test stations I designed long ago (as can be seen in the instruction). They had three BNC on one side appropriate for the 10MHz outputs so my prototypes uses parallel 74HC or AC04 for buffering with square waves out (+about 40-50ohm in series). Second: I have always been fortunate to have good PCB designers at my side in my professional job. So in a case like this I had just told them that I wanted a good ground plane and that the oscillator and buffer should be placed so crosstalk from the Arduino and GPS module power and signals were minimized. A third reason is that I am struggling with my health that is also a reason I am not very active on EEVblog neither reading nor writing.

Lars
 
The following users thanked this post: cdev

Offline lars

  • Regular Contributor
  • *
  • Posts: 132
  • Country: se
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #31 on: September 07, 2018, 07:39:01 pm »


I feel a little guilty to haven’t answered PM’s and probably will not do but instead do some general comments here. As I said my health is not well – frankly I am suffering cancer and treatments are tough. So for a long time I haven’t done something to my GPSDO project.

My LPRO rubidium based GPSDO is on all time and a little sporadic I check it. It is still very stable and due to the internal data logging up to 18 days (every third hour) I can follow the drift of the LPRO. So after 5-6 years I can see drifts below 1E-13/day (averaged over long times).

One question is if I have an updated software and the answer is no. Actually I have not found or heard of any bug so severe that I have had a reason to do any changes. I have a long list of improvements but as testing is so important I would like to have a very good reason to do changes.

Some ask about LCD and my answer is again about robustness and also that it is so many different GPS module so I recommend adding the display to a separate processor that also reads the GPSDO controllers serial line. Others ask about changing components but again robustness. Some ask about changing processor but that is really something for everybody interested in experimenting except me.

Back in March I was a little bit better and decided to start two of my OCXO based GPSDO’s to get more data and charts as I had seen a lot of more or less strange comment in other GPSDO thread here on EEVblog. I decided to take two GPDO that I know had OCXO’s with a lot of retrace, so not the best. One OCXO with about +10ppm retrace for a month and the other with -10ppm instead. Both OCXO were STP2187 double oven from eBay. I also had seen that at least one of them had jumps in the E-10 range even if with days or longer between.

As the Trimble thunderbolt is very admired by time-nuts I decided to setup the OCXO time constants to give about the same ADEVs as a non-optimized thunderbolt with TC 100 seconds. That is to give an ADEV at about 1E-11 at 100 sec. This also gives the frequency accuracy as I see from e.g. the leapsecond .com tests that give frequency stabilities and accuracies of about 1E-10.
http://www.leapsecond.com/pages/tbolt-tc/   
http://www.leapsecond.com/pages/tbolt-8d/
As my GPSDO is not as good as the thunderbolt I chose 200s TC, so settling time will be about twice as long is my guess. One of my GPSDO’s had a NEO 6M and the other an LEA6T (timing receiver) as the LEA can be set for position mode I tried that first. This also showed that the ADEVs at 100 seconds were similar and at about 1E-11 for both the NEO and LEA. With a good survey and timing mode it was possible to get ADEVs in the higher -12 range, maybe a factor of two better for the LEA.
 
One of the things I wanted to test was how long time does it take to get the frequency accuracy in this case. My goal were 1E-10. After about 30 minutes both GPSDO were within 1E-10 measured with a TAPR TICC versus the rubidium GPSDO. It took about an hour to get the locked LED ON. This shows the conservative locked spec in the Arduino program but I prefer this instead of the other way. As the locked condition requires the phase/time to be within 100ns (low pass filtered with 16 seconds) for at least 5 time constants this means that the frequency should be within 100ns/200secs * 5 that is 1E-10 so on par with my goal of 1E-10 in this case. But if you look on a PI-loop with the damping I have set, that also corresponds to the default setting of the Thunderbolt it will converge in a smooth manner that gives better results. I have had that it is a drawback to have just one time constant and no switching of time constant or FLL locking in the beginning but I am not sure it is really a problem from a settling time point either. Having just one time constant and the classic third order PI-loop are very robust in my opinion. Having seen comments on time nuts with HP 38xx GPSDO’s giving strange results after jumps also gives these conclusions as a jump recovers nice on my design.

During the month I had the GPSDO’s on I had one jump that were enough large to turn off the locked LED. As I said the locked LED requires the time to be within 100ns. If the OCXO jumps 2E-10 and the time constant is 200seconds the loop will go away just below 100ns so the jump was above 2E-10.

I also had another occasion with the locked LED off that I traced to the signal from the PPS but don’t know if it were the GPS module or antenna. I should say I at both of these occurrences had a terminal program that logged the output of the GPSDO serial line otherwise I only afterwards could have seen from the logged 18 days data that the GPSDO were unlocked during 3 hours.

Lars
 
The following users thanked this post: jpb, 3apw, mycroft, Theboel, imo

Offline Bryan

  • Frequent Contributor
  • **
  • Posts: 572
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #32 on: September 13, 2018, 09:10:23 am »
Hello:

Is there any other recommendations for a GPS receiver module, I note you recommend the Neo7M, but wondering if there are others that can be considered. Are some better suited to supplying a frequency reference. There is also the 8M/T model(s) and the Venus, but not sure as to what advantages/disadvantages they have. I was going to start with a old Jupiter-T TU60-D120 module that I have as it has a 1pps output.

Jupiter-T datasheet
6.1.1 Pin J1-6: 1PPS output This signal is a positive going pulse with the leading edge being the point of measurement for synchronisation with the GPS satellite transmissions. The pulse width is approximately 26 ms.

Regards
-=Bryan=-
 

Online t1d

  • Frequent Contributor
  • **
  • Posts: 604
  • Country: us
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #33 on: September 13, 2018, 09:37:58 am »
You might enjoy this series, on the topic...
Scullcom Hobby Electronics # 35 - Design & Build a GPS locked Frequency Reference Standard

Also at his website.
 

Offline lars

  • Regular Contributor
  • *
  • Posts: 132
  • Country: se
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #34 on: September 13, 2018, 05:59:21 pm »
Hello:

Is there any other recommendations for a GPS receiver module, I note you recommend the Neo7M, but wondering if there are others that can be considered. Are some better suited to supplying a frequency reference. There is also the 8M/T model(s) and the Venus, but not sure as to what advantages/disadvantages they have. I was going to start with a old Jupiter-T TU60-D120 module that I have as it has a 1pps output.

Jupiter-T datasheet
6.1.1 Pin J1-6: 1PPS output This signal is a positive going pulse with the leading edge being the point of measurement for synchronisation with the GPS satellite transmissions. The pulse width is approximately 26 ms.

Regards


Hello Bryan,

As you indicate the new timing modules from uBlox like the 8-series and the Venus 838 could be better choices. I prefer the uBlox.
I only recommended the NEO7M as it were cheap, available and is easy to use and at the same time gives good performance that I have measured. For simple position receivers with 1PPS I guess the ones from Adafruit is worth looking for even if not state of art for a GPSDO.

I am also curious about the Furano GT87 and hope that somebody will test it and give ADEV and MDEV's.

The nice thing with Lars GPSDO is that almost every GPS module with a 1PPS out can be used if the amplitude is 3.3-5V and the 1PPS is accurate on the positive going flank. The pulse width can be down to 10uS and probably even shorter. A square wave also works.

As you have a Jupiter-T I would definitely use that first. I started with even older and more jittery GPS modules and without timing mode and it worked. Of course a modern timing receiver will give better frequency accuracy and ADEV's but the loop should settle in the same time.

Lars
 

Offline texaspyro

  • Super Contributor
  • ***
  • Posts: 1296
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #35 on: September 13, 2018, 08:33:16 pm »
Does anybody sell a Lars board (bare or stuffed) or have some Gerbers available?   I've been wanting to do one but have not had the time available.  Lady Heather does have some support for it.

I have a couple of GT87's.   They are probably the best GPS out there in regards to the 1PPS.   Their sawtooth correction range is a couple of ns and the span of the 1PPS jitter is in the 5 ns range.
 

Offline Bryan

  • Frequent Contributor
  • **
  • Posts: 572
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #36 on: September 14, 2018, 10:31:45 am »

Hello Bryan,

As you indicate the new timing modules from uBlox like the 8-series and the Venus 838 could be better choices. I prefer the uBlox.
I only recommended the NEO7M as it were cheap, available and is easy to use and at the same time gives good performance that I have measured. For simple position receivers with 1PPS I guess the ones from Adafruit is worth looking for even if not state of art for a GPSDO.

I am also curious about the Furano GT87 and hope that somebody will test it and give ADEV and MDEV's.

The nice thing with Lars GPSDO is that almost every GPS module with a 1PPS out can be used if the amplitude is 3.3-5V and the 1PPS is accurate on the positive going flank. The pulse width can be down to 10uS and probably even shorter. A square wave also works.

As you have a Jupiter-T I would definitely use that first. I started with even older and more jittery GPS modules and without timing mode and it worked. Of course a modern timing receiver will give better frequency accuracy and ADEV's but the loop should settle in the same time.

Lars

Thanks Lars, used to have a UCCM and Trimble but gave them up as unfortunately I have a poor view of the sky. But have the bug again so wanted to try a project for the fall, will give the Jupiter a try. One advantage I see with the newer modules is they can see more satellites, and for the most part should have better timing.
-=Bryan=-
 

Offline Bryan

  • Frequent Contributor
  • **
  • Posts: 572
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #37 on: September 14, 2018, 10:34:15 am »

I have a couple of GT87's.   They are probably the best GPS out there in regards to the 1PPS.   Their sawtooth correction range is a couple of ns and the span of the 1PPS jitter is in the 5 ns range.

Interesting, I haven't seen the GT87's for sale in many places, at least not on Ebay. Digi-Key, but not very cheap though.
-=Bryan=-
 

Offline texaspyro

  • Super Contributor
  • ***
  • Posts: 1296
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #38 on: September 14, 2018, 05:02:49 pm »
Here is a place in Germany:
https://www.buerklin.com/en/gnss-module-und-gps-module/p/64s3196

The GT-8736 is the module on a breakout board.   
 

Offline Bryan

  • Frequent Contributor
  • **
  • Posts: 572
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #39 on: September 14, 2018, 06:26:26 pm »
Thanks, for the link, Digikey has a couple which is probably comparable in price. Still pricey compared to the Neos,

https://www.digikey.ca/products/en/rf-if-and-rfid/rf-receivers/870?k=furuno
-=Bryan=-
 

Offline jpb

  • Super Contributor
  • ***
  • Posts: 1621
  • Country: gb
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #40 on: September 14, 2018, 08:12:15 pm »
Digikey seem only to sell the module or the very expensive development kit.

The GT-8736 module looks more useful at a reasonable price. The Furano web site doesn't have much info on the module except it reveals that it emulates the Motorola M12+ on which there is a lot of info:
https://www.cnssys.com/files/M12+UsersGuide.pdf

 

Offline texaspyro

  • Super Contributor
  • ***
  • Posts: 1296
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #41 on: September 14, 2018, 09:01:57 pm »
The Furano web site doesn't have much info on the module except it reveals that it emulates the Motorola M12+ on which there is a lot of info:
https://www.cnssys.com/files/M12+UsersGuide.pdf

The GT-87 can speak NMEA, M12, or Furuno ESIP protocols.   Lady Heather can switch between them.  The ESIP protocol seems to be slightly better than M12... it can report the sawtooth error to sub-nanosecond resolution.  M12 is limited to nanoseconds (integer value). 

The GT-87 docs say the the GT-87 can also support Furuno PFEC protocol, but this puts it into a funky, undocumented binary protocol that effectively bricks the unit... Heather blocks all attempts to enter PFEC mode.
 
The following users thanked this post: jpb

Offline Bryan

  • Frequent Contributor
  • **
  • Posts: 572
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #42 on: September 15, 2018, 10:39:34 am »
Texaspyro mentions the GT-87 has superior 1pps performance, but not sure how the GT-8736 would perform.
-=Bryan=-
 

Offline texaspyro

  • Super Contributor
  • ***
  • Posts: 1296
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #43 on: September 15, 2018, 05:56:43 pm »
Texaspyro mentions the GT-87 has superior 1pps performance, but not sure how the GT-8736 would perform.

The 8736 is jus the GT87 on a board with the M12 form factor/pinout.   It's the one I did the testing on.
 

Offline Miti

  • Frequent Contributor
  • **
  • Posts: 451
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #44 on: September 30, 2018, 07:18:44 pm »
Hey Lars,

I made your GPSDO on a breadboard and I can't get it to lock. Please see attached. I assume the schematic is good and I verified everything with the oscilloscope.
I use Bliley NV47A1282.OCXO. The only problem with this OCXO is that it seems to have an internal voltage divider that keeps the VFC pin around 2.8V. I had to add a 100K resistor to GND to bring the control voltage below 1.54V (that's the VFC for 10MHz on my OCXO) with h1.
Could you give me a hint?

Edit: It locked few times but it is unstable. It keeps saying "Missing 10MHz?".
« Last Edit: September 30, 2018, 10:42:55 pm by Miti »
That big spark at power up was by design!
 

Offline Miti

  • Frequent Contributor
  • **
  • Posts: 451
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #45 on: October 01, 2018, 03:58:52 am »
Success, it locked!
However, it doesn't lock with the calculated gain which is 100. I had to increase it to 200. I also get a lot of "Missing 10MHz?" before it gets close to the correct DAC.
That big spark at power up was by design!
 

Offline lars

  • Regular Contributor
  • *
  • Posts: 132
  • Country: se
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #46 on: October 01, 2018, 08:47:54 pm »
Success, it locked!
However, it doesn't lock with the calculated gain which is 100. I had to increase it to 200. I also get a lot of "Missing 10MHz?" before it gets close to the correct DAC.


Hello Miti,

good that it locked but you have to blame me and my instruction that you have "missing 10MHz" due to insufficient hardware instructions on the 10MHz oscillator. The small section on the 10MHz oscillator doesn't mention square wave versus sine wave outputs from the OCXO. You have an OCXO with sinewave out. I have tested several with sinewave with good result. What I have missed in the instruction is that if the output is sinewave it is critical to have bias on the 10Mhz input. That is to add for example two 100kohm resistors as pullup and pulldown to ground and +5V respective on the HC390. This gives a DC bias of 2.5V. So my first suggestion is to add 100kohm from HC 390 pin 1 to pin 16 (+5V) and another from pin 1 to GND.

Hey Lars,

I made your GPSDO on a breadboard and I can't get it to lock. Please see attached. I assume the schematic is good and I verified everything with the oscilloscope.
I use Bliley NV47A1282.OCXO. The only problem with this OCXO is that it seems to have an internal voltage divider that keeps the VFC pin around 2.8V. I had to add a 100K resistor to GND to bring the control voltage below 1.54V (that's the VFC for 10MHz on my OCXO) with h1.
Could you give me a hint?

Edit: It locked few times but it is unstable. It keeps saying "Missing 10MHz?".

For the EFC input to Bliley NV47A1282.OCXO you have done exactly correct to add a resistor , in this case 100k to ground. Later you can probably test to have even a little lower resistance depending how the oscillator drift. If you have lower resistance the gain will change so you have to test it again.

As the output impedance of the PWM is about 78Kohm (39k+39k) and the input impedance on the OCXO according to the data sheet is 10-100kohm you get a voltage divider to the internal OCXO ref that you say is 2.8V. In this case you have an OCXO range of 0-4V. Some OCXO as for example the 8663 type might have above 5V EFC. In this case you need a resistor to a higher voltage. I have often used a 10k trimpot from the Vref on The OCXO to GND on the OCXO. Some OCXO's don't like as low a load of 10kohm on the Vref so that could sometimes be a problem but in very few cases.

-

I like your screen shoots. If you add the two 100kohm resistors (values not so critical, even a factor of ten will work to get 2.5VDC as long as the values are the same, if the OCXO has no coupling capacitor on the output you might need to add for example 10nF in series), it will be interesting to see a screen shoot of h1 and h65535 to see the diff_ns to see why you get instability with a gain factor of two wrong. Of course it could be due to the missing 10MHz that that I hope have gone away.

Lars
 

Offline Miti

  • Frequent Contributor
  • **
  • Posts: 451
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #47 on: October 02, 2018, 01:43:28 am »
Hi Lars and thank you for the quick response!

It stayed locked for almost one day now. One thing I forgot to add regarding the sine wave output, I used a second HC4046 to make it square like in Brooks Shera's schematic, except for the 10K and 50K resistors, I injected the full 1.5Vpp to the input of HC4046 through 100nF capacitor. I've attached that part of the schematic. My 10MHz should be very reliable square wave. I observed that after power up, during and after warm up period, when TIC is high (500+) I get that message "Missing 10MHz?" so it must be something in the software. One thing that seems to have made it better, and I don't pretend I know why and what all the numbers mean, is when I changed the TIC_Offset from 500 to 650.
« Last Edit: October 02, 2018, 01:50:13 am by Miti »
That big spark at power up was by design!
 

Offline lars

  • Regular Contributor
  • *
  • Posts: 132
  • Country: se
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #48 on: October 02, 2018, 08:22:52 pm »
Hello Miti,

As you have used Shera's sine to square circuit it shouldn't be the problem I suggested in hardware. So now I am more confused!

The problem I see is that the "missing 10MHz" comments just is written instead of the TIC_value 1023 that is the ADC0 value read in the very short interrupt routine in the beginning of the program. The ADC0 reading is triggered by the 1PPS input.

So missing 10MHz must be because the pulse on the HC4046 output is too long and gives maximum ADC value. As the HC4046 is set high by the 1PPS and reset by the divided down 10MHZ to 1MHz the 1MHz if it isn't missing shouldn't give more than a 1us (1000ns). If the diode+3.9k+1nF and discharge resistor 10M are ok this shouldn't give more than around 970+-40 maximum ADC reading. With h1 or h65535 you should see the ADC readings changing fast on the filtx10 value but multiplied by 10 so if the filtx10 value is 6500 it is an ADC value of 650. The second row with ns values around zero (in locked condition) has some math on them and also subtracts the TIC_offset. Note: the filtx10 is only the ADC value in non locked condition as in the locked condition it is a low pass filtered value.

It is also intersting that now you don't seems to get missing 10MHz? Have you let the GPSDO cool down and restarted to see if you get the problem again?


About the TIC_offset it just and offset on the ADC reading. So if the TIC_offset is 500 and you have an ADC reading of 500 the input to the PI-loop will be 0 and no shift of the DAC value will happen. If you change the TIC_offset it will strive to 650 ADC reading instead. So if you change it on the fly you will see a reading on the ns value on the serial monitor of -150ns as the ADC reading is around 500 and the TIC_offset higher at 650.

Would be intersting to see what happens if you change the TIC_offset back to 500. As this is more than 100ns difference you will loose lock. But it should only take about 5-10 time constant to get lock again.

I have selected 500 as TIC_offset as that is around the mid point of the ADC range 0-1023.

Lars



 

 

Offline Miti

  • Frequent Contributor
  • **
  • Posts: 451
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #49 on: October 03, 2018, 02:07:42 am »
Hey Lars,

I attached the h1 and h65535 screenshots.
One weird thing I observed, I would expect the voltage on C1 to have a base line of 0V with some short pulses. Instead, it stays around 200+mV with pulses. See the attache scope shots. Interesting thing is that if I disconnect the cap from the ADC input, everything is as expected so I thought there may be a leakage from the ADC input. The ADC input however stays flat at 0V. Only when they are connected together, the baseline jumps to over 200mV. This is SF ... or electronics.   :-DD Could you check your circuit?

Edit: Just to be clear, when I say I disconnect C1 from A0, I mean that I separate R1, R2, C1 from A0, see the cut in the attached minimum working schematic.
« Last Edit: October 03, 2018, 02:40:15 am by Miti »
That big spark at power up was by design!
 

Offline imo

  • Super Contributor
  • ***
  • Posts: 1763
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #50 on: October 03, 2018, 09:17:57 am »
The C1 must be a quality foil capacitor. What type do you use?

PS: at the pin15 of the 4046 you should see a short square 5V pulse, the pulse up to 1us long, once a second.
It charges the C1 (the longer the pulse the more peak voltage at C1) and the MCU does an ADC measurement asap.
The voltage at the C1 drops down to zero then (because of the 10M discharge resistor, D1 leakage and A0 input clamp diodes leakages).
Double check you get the <1us pulse at 4046_pin15 once a second. When you get the pulses more frequently it could create your "200mV dc level".
Also double-check the R1, R2, C1 values. Much larger C1 value than 1nF may create the 200mV dc level as well.
« Last Edit: October 03, 2018, 09:55:19 am by imo »
 

Offline Miti

  • Frequent Contributor
  • **
  • Posts: 451
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #51 on: October 03, 2018, 12:31:04 pm »
Hi imo,

C1 is a foil capacitor, not sure the exact type, and I do get a pulse between 0 and 1us and if you look at my scope screen shots, if I disconnect the circuit from the uC ADC, the result is as expected. Only when I connect them together I see that DC level, that's what puzzles me.
That big spark at power up was by design!
 

Offline imo

  • Super Contributor
  • ***
  • Posts: 1763
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #52 on: October 03, 2018, 12:44:12 pm »
It could be your grounds (the gnd of the 4046 vs. the gnd of the Pro mini or atmega328) are 200mV off.
« Last Edit: October 03, 2018, 12:53:37 pm by imo »
 

Offline metrologist

  • Super Contributor
  • ***
  • Posts: 1786
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #53 on: October 03, 2018, 03:45:12 pm »
Thank you for mentioning Shera. I had bought all the components to build that design but got stymied by CPU programming and its environment. I can work with Arduino (not sure if I can comprehend the code here), but at least I have two HCT4046 detectors, and I must have had an idea for HC390 as my earlier post did not mention it. Anyway, I think I have all the parts, even a 5V VC/OCXO so I'll attempt to breadboard this up and see what I can get it to do. I really needed another GPSDO to verify the two repurposed Trimble units...

Thanks again Lars. Hope you are feeling well.
 

Offline 9aplus

  • Regular Contributor
  • *
  • Posts: 88
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #54 on: October 03, 2018, 06:13:16 pm »
Can someone draw&post here, full schematic of Lars GPSDO solution, please?
 

Offline metrologist

  • Super Contributor
  • ***
  • Posts: 1786
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #55 on: October 03, 2018, 06:51:23 pm »
I was just going to build the minimum schematic and the Arduino source as-is. The first post has all the details and PDF descriptions.
 
The following users thanked this post: 9aplus

Offline lars

  • Regular Contributor
  • *
  • Posts: 132
  • Country: se
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #56 on: October 03, 2018, 08:20:03 pm »
Hello Miti,

First I have to correct myself. The filtx10 is not only the ADC but also adds or subracts 10000 every 1000ns change on timer 1. But from your first screen shoot it seems the minimum value is 5250 that is 525 on the ADC. This explains why you had to set 650 as TIC_offset to get it locked. Normally the minimum ADC is around 10-12 (filtx10 =100-120).

Just another parentes is:
The h1 also shows that the diff_ns is about 100 and the h65535 on the next screen shoot shows -500 so the difference is 600. This is what I use for gain calculation Gain = 65535/600 that is about 100 that should be stored to Gain in EEPROM.


Ok so this is interesting   (for me) and weird. I can't really see the problem. But as imo points out it could be a missing ground so please check them.

Your oscilloscope shoots are really nice. The time constant seems to be about 5ms that is very reasonable if your probe has about 10Mohm impedance. In parallell with R2 it will give 5Mohm and with 1nF it gives 5ms. So my guess is that R1, R2 and C1 is ok and also the diode.

What is strange is of course that both side of the disconnection goes to zero but not when connected together. I guess the probe ground have not been moved between the three measurements?

Another observation is that the slope on the disconnected is more an exponential function. On the faulty it seems to go down to 160mv and stop. Could be some diode effect??

Another strange thing is that the minimum ADC value of 525 corresponds to about 550mV. This is more than three times the value without the oscilloscope probe. I would have guessed maximum two times if the probe is 10Mohm.

Another test, if the Grounds are ok, is to parallel or change R2 to 1Mohm to see if it is a difference.

Another question: You are using a Pro Mini board?

The 1nF I have used have been ceramic SMD0805 NPO from diffent suppliers without problems so I don't think they are so critical.

Lars

 

Offline lars

  • Regular Contributor
  • *
  • Posts: 132
  • Country: se
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #57 on: October 03, 2018, 08:39:32 pm »
Hi everybody,

The minimum schematic should work (with a 10MHz square input). If you want to add a temperature sensor have a look in the instruction of recommended types and setup.

The software should work without any changes. So you don't have to go into the code if you don't want to learn something about the code. The only important parameter to setup from the serial monitor after you have downloaded the program is GAIN. This is the loop gain and very important. In the instruction it is described how. In my last post I almost told everything with h1 and h655365 command and diff_ns to find the Gain. Remember to store it to EEPROM. The h1 to h65535 sets the PWM-DAC fixed. Very useful for testing.

Lars

@metrologist: Sorry to say my health is not going better. The cancer is too much spread, just hoping it will spread slowly only, for the moment.


 

Offline Miti

  • Frequent Contributor
  • **
  • Posts: 451
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #58 on: October 04, 2018, 03:34:18 am »
Hi Lars,

I'm really sorry to hear that you're not doing well. Please let me know if you're not in the mood to respond to my questions.

I appreciate your help and the fact that you shared this complex project with us. The issues that I have are clearly related to my implementation. I measured quickly all the GND points and they are all within fractions of mV. I shorted C1 just to see the ADC reading and it was 10000 so technically 0. If it was a ground issue, the offset would still be present. I suspect some flux residues even tough I used rosin core which should be neutral, I will give it a good wash with Vigon EFM in the weekend. That stuff is amazing at cleaning boards. Why it doesn't show up when I disconnect the circuit, beats me. I will do more work in the weekend as I'm very busy these days.
I am using this https://www.banggood.com/Wholesale-New-Ver-Pro-Mini-ATMEGA328-328p-5V-16MHz-Arduino-Compatible-Nano-Size-p-68534.html?rmmds=myorder&cur_warehouse=CN pro mini board.
The capacitor is polypropylene film https://www.vishay.com/docs/26016/kp1830.pdf but as you said, shouldn't be critical. The GPS module is a Ublox Neo-M8T-0.

PS: If I can get it to work properly, with your permission, I intend to design a board. All SMT with Atmel and Ublox on the board. BTW, do you know what settings I need to do to take advantage of the timing features of Ublox NEO-M8T?
« Last Edit: October 04, 2018, 03:47:14 am by Miti »
That big spark at power up was by design!
 

Offline metrologist

  • Super Contributor
  • ***
  • Posts: 1786
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #59 on: October 04, 2018, 07:51:38 pm »
Hey, I just had an idea/question: what would it take for the Lars GPSDO to work with LadyHeather?  I'm sure LH will work with most commercial GPS, but I suspect the Arduino would need to parse the GPS data and add its internal tuning and magic to its serial output. It might be able to emulate some other device, or LH expanded to cover this custom build.

I have verified that I have the two chips (one older SN7490N and newer HCT4046) and passives needed. Just need to find a diode and I should be ready. I have hundreds of SMT diodes, but have not figured out how to class them.
« Last Edit: October 04, 2018, 07:55:04 pm by metrologist »
 

Offline 9aplus

  • Regular Contributor
  • *
  • Posts: 88
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #60 on: October 04, 2018, 08:10:42 pm »
Hey, I just had an idea/question: what would it take for the Lars GPSDO to work with LadyHeather? 
Supported already in Beta version....
pls look here:
https://www.eevblog.com/forum/metrology/lady-heather-v6-beta-for-windows-exe/msg1434005/#msg1434005
« Last Edit: October 04, 2018, 08:13:17 pm by 9aplus »
 

Offline metrologist

  • Super Contributor
  • ***
  • Posts: 1786
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #61 on: October 04, 2018, 11:53:32 pm »
Thanks! I see it in the list and am thankful Lars's design is being recognized. I really like this approach. I am not clear on what data is being used since the GPS and Arduino have different serial streams? I think you can run multiple instances of LH though. I suspect LH should use the Arduino serial data as that would provide the kind of data we're interested in for the oscillator. :-+
« Last Edit: October 04, 2018, 11:57:13 pm by metrologist »
 

Offline texaspyro

  • Super Contributor
  • ***
  • Posts: 1296
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #62 on: October 05, 2018, 12:17:46 am »
You can use the Lars GPSDO as the main "receiver" input device where it is treated as a time interval counter.

You can also use it as an "extra" input device with the GPS receiver as the main input device.  In this mode the Lars GPSDO is used to calculate ADEVs while the main display is the GPS info.  To use this mode use the /ei=port /itl command line options.

Note that support for the Lars GPSDO is a bit sketchy.  I don't have one to refine the support.  Also Heather does not send any commands to configure the Lars device (except via the !u (send user command).  You can use the !t terminal emulator mode to talk to the Lars.
 

Offline metrologist

  • Super Contributor
  • ***
  • Posts: 1786
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #63 on: October 05, 2018, 12:38:26 am »
Thanks! I didn't know LH could utilize and extra input.  :-+
 

Offline texaspyro

  • Super Contributor
  • ***
  • Posts: 1296
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #64 on: October 05, 2018, 01:09:59 am »
Thanks! I didn't know LH could utilize and extra input.  :-+

Yes, Heather now supports several external device ports including:
   echo receiver data to a port
   echo receiver data to a port in NMEA format
   ticc/counter port
   environmental sensor port
   satellite / sun / moon / time tracking port
   temperature control port
   DAC / ADC port (not yet fully implemnted)

 
The following users thanked this post: cdev

Offline Miti

  • Frequent Contributor
  • **
  • Posts: 451
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #65 on: October 05, 2018, 03:26:14 am »
Thanks texaspyro!

I've got LH to work with Lars GPSDO as an extra input device but it keeps resetting the statistics. Every few seconds it flickers and the graph starts from zero again. It doesn't happen if I see only the GPS. Also, I cannot see the ADEV on the graph and I tried /ga.
It doesn't work for me as the main receiver or I don't know how to configure it. What commands do I have to send?
That big spark at power up was by design!
 

Offline texaspyro

  • Super Contributor
  • ***
  • Posts: 1296
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #66 on: October 05, 2018, 06:42:37 am »
I've got LH to work with Lars GPSDO as an extra input device but it keeps resetting the statistics. Every few seconds it flickers and the graph starts from zero again.

There was a bug in some versions that caused the data to be reset every 10 seconds or so in some configurations.   I am going to post an updated version in a few days.

The "A" keyboard menu controls what kind of ADEV info to show.  The GA keyboard command toggles the ADEV plots on and off.

The GLP keyboard command will set the lat/lon displays to private so you don't have to edit your screen dumps.
 
The following users thanked this post: 9aplus

Offline metrologist

  • Super Contributor
  • ***
  • Posts: 1786
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #67 on: October 06, 2018, 03:14:43 pm »
just a proof - it locked for a couple seconds. The osc seems very sensitive to the environment, but not so much to the tuning control. I can monitor both GPS 10MHz and my OCXO and can see it is close to lock, looks stable for minutes, but then starts to drift. Tune voltage is typically stable around 2.2V, then the osc does not seem to respond quickly when it starts to bounce around 300mV swings, but the frequency can adjust high to low... I probably have bad components - the two "caps" make 1nF, but I'm not sure what kind they are - and everything on long leads hanging out in the air.  :-DD I have a better oscillator, but then I'd need all the voltages, 12, 5, 3.3... It'w worth it to build it up right in an enclosure.

What's the batch file line (switches) so LadyHeather sees it? It did not recognize it.

"C:\Program Files (x86)\Heather\heather.exe" /5 /br=9600:8:N:1

 

Offline Miti

  • Frequent Contributor
  • **
  • Posts: 451
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #68 on: October 07, 2018, 02:30:13 am »
I did a bit more work on the GPSDO today and I managed to reduce the voltage offset on C1 to about 100mV by cleaning up and shortening the ground connections. I still don't understand where is this offset coming from. It is way more stable now, I reduced the TIC_Offset back to 500 and I don't get the "Missing 10MHz?" message anymore.
I use separate regulators, one for OCXO and digitals, one for the Arduino. The GPS is supplied from the USB for now. Star ground, both 5V are rock stable but I still have the 100mV offset.
Anyways, it locks and stays locked now.

@texaspyro

I don't know why but whenever I connect the GPS module to LH SW, its sensitivity is greatly affected to the point where it doesn't get a fix anymore. The sensitivity stays low until I connect with U-Center and do a "Revert to default configuration" when it comes back to life again.
That big spark at power up was by design!
 

Offline metrologist

  • Super Contributor
  • ***
  • Posts: 1786
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #69 on: October 07, 2018, 03:39:58 am »
I've been having trouble with my old 7490 chip, the divided outputs are too low - rather it is my USB drive that struggles with the 500mA output and supply voltage drops to 3.9V. I was hoping to power solely from USB. I added a battery bank and it helped.

It will lock and stay for minutes. I found gain of h1 = 1600 and h65535 = -1750. I set gain at 20 and it locked in a couple minutes. Here I am, I will have to watch it for long time. 8)

So much more to read.  :-+

edit added 8hr diff-ns plot, only lost lock for a brief period  ;D
« Last Edit: October 07, 2018, 12:47:11 pm by metrologist »
 

Offline Miti

  • Frequent Contributor
  • **
  • Posts: 451
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #70 on: October 09, 2018, 01:45:47 am »
I have finalized the circuit and put it in the box. I still have some things to clean up but it is 95% done. The box is an Extron Ada 6 300MX that I modified for 50 Ohm like Gerry Sweeney did. The result is pretty good but not perfect. There's a bit of distortion in the sine wave and I think is again ground related. I may need to add a 15 - 20MHz low pass filter to clean a bit the high frequency components. It also may need some tuning. I think that once a proper board is designed, this may be a pretty good GPSDO.
That big spark at power up was by design!
 

Offline imo

  • Super Contributor
  • ***
  • Posts: 1763
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #71 on: October 09, 2018, 09:55:18 am »
Quote
I managed to reduce the voltage offset on C1 to about 100mV by cleaning up and shortening the ground connections. I still don't understand where is this offset coming from.
Look at the voltage difference between the "gnd pin of the atmega328" and the "gnd at the pro mini pcb pin".
Quote
There's a bit of distortion in the sine wave and I think is again ground related.
It looks like ringing. A suboptimal source/load impedance matching somewhere (it could be induced from an adjacent square wave signal, or, via gnd..)??
« Last Edit: October 09, 2018, 10:01:49 am by imo »
 

Offline Miti

  • Frequent Contributor
  • **
  • Posts: 451
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #72 on: October 09, 2018, 10:45:49 pm »
Yes, impedance matching is another possibility. The cable and the amplifier input are 50 Ohm but the OCXO output may be not. I'll have to rethink the circuit in that area.
Here's my Allan deviation after one day, t=100.
« Last Edit: October 10, 2018, 01:38:17 am by Miti »
That big spark at power up was by design!
 

Offline Miti

  • Frequent Contributor
  • **
  • Posts: 451
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #73 on: October 16, 2018, 01:06:21 am »
I did a bit more work in the weekend and here's the result. It is not perfect but I'm happy. The frequency counter doesn't seem to have a problem, it is very stable and the spectrum analyzer doesn't show tooo much garbage. The second harmonic is almost 56dB down, the third harmonic is only 36.5dB down but without a filter probably is the best I could get, and the fifth harmonic is 51dB down. There are some harmonics around 330MHz but they are 48dB down, I'm not too worried about them. Probably I should be worried if this was used as a reference for a radio but at this moment I'll be using it for my instruments only.
I tried a TC of 1000 but it looses lock in the afternoon when the sun hits my basement window. TC=500 seems to work well even though I think I'll try a bit higher when I have time.
« Last Edit: October 16, 2018, 01:08:08 am by Miti »
That big spark at power up was by design!
 

Offline imo

  • Super Contributor
  • ***
  • Posts: 1763
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #74 on: October 16, 2018, 01:57:16 pm »
Here's my Allan deviation after one day, t=100.
ADEV of what?
 

Offline metrologist

  • Super Contributor
  • ***
  • Posts: 1786
  • 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 lars

  • 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

  • Frequent Contributor
  • **
  • Posts: 451
  • 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.
That big spark at power up was by design!
 

Offline imo

  • Super Contributor
  • ***
  • Posts: 1763
  • Country: 00
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: 5082
  • 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 lars

  • 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 lars

  • 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

  • Frequent Contributor
  • **
  • Posts: 451
  • 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 »
That big spark at power up was by design!
 

Offline Miti

  • Frequent Contributor
  • **
  • Posts: 451
  • 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.
That big spark at power up was by design!
 

Offline metrologist

  • Super Contributor
  • ***
  • Posts: 1786
  • 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

  • Frequent Contributor
  • **
  • Posts: 451
  • 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.
That big spark at power up was by design!
 

Offline imo

  • Super Contributor
  • ***
  • Posts: 1763
  • Country: 00
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 lars

  • 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 lars

  • 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

  • Frequent Contributor
  • **
  • Posts: 451
  • 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
That big spark at power up was by design!
 

Offline metrologist

  • Super Contributor
  • ***
  • Posts: 1786
  • 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 »
 

Offline metrologist

  • Super Contributor
  • ***
  • Posts: 1786
  • 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

  • Frequent Contributor
  • **
  • Posts: 451
  • 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.
That big spark at power up was by design!
 

Offline lars

  • 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 lars

  • 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 lars

  • 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

  • Frequent Contributor
  • **
  • Posts: 451
  • 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 »
That big spark at power up was by design!
 

Offline cdev

  • Super Contributor
  • ***
  • Posts: 5082
  • 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

  • Frequent Contributor
  • **
  • Posts: 451
  • 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 »
That big spark at power up was by design!
 

Offline metrologist

  • Super Contributor
  • ***
  • Posts: 1786
  • 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.
 

Offline Miti

  • Frequent Contributor
  • **
  • Posts: 451
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #100 on: October 30, 2018, 02:44:31 pm »
Metrologist,

A gain of <20 may be too low to have a decent control, you jump too much up/down per every bit of DAC. Even my gain of 122 I consider too low, one should aim toward 500 at least, as recommended by Lars, or even 1000. Too high though and you may not be able to control long time drift so I'm guessing, depending on the OCXO, up to 1000 you should be ok. I think is preferable to use an op-amp to adjust the gain and offset rather than resistors.
And here comes the question for Lars.
I know that you recommend resistors/trimmer pots to adjust the gain and the offset based on individual OCXO needs but doesn't that change the RC constant of the filter? In my case I had to add two 50K from VC pin of the OCXO to ground just to bring the DAC towards the middle of the scale. Adding more resistors to reduce the range/increase the gain would lower even more the impedance seen by the DAC. How would that affect the loop?
That big spark at power up was by design!
 

Offline imo

  • Super Contributor
  • ***
  • Posts: 1763
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #101 on: October 30, 2018, 03:20:29 pm »
The R3,4,5 and C2,3 low-pass filter the two PWM digi outputs - thus creating the "16bit DAC" (by changing the PWM duty).
Loading them with R lowers the DAC max output voltage accordingly. It should have had no impact on the PI control loop timing..
I would add an single supply rail-rail opamp - you may amplify (EDIT: or divide in your case - for example from 0-5V DAC's output to 0-500mV , and add an X Volts offset such your OCXO's tuning range will be from X to X+500mV) and offset the DAC values easily then. It may add some noise and drift when not designed with care.
« Last Edit: October 30, 2018, 07:41:57 pm by imo »
 

Offline metrologist

  • Super Contributor
  • ***
  • Posts: 1786
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #102 on: October 30, 2018, 06:24:29 pm »
Yes, Miti. I was surprised that the diff_ns range was so large (note that now I posted the CTI spec and if my thinking is correct, then the voltage control range of 1000 to 2000 ppb yields gain of 32 to 65).

Also, there is a lot of drift when set to hold mode and it can vary in both directions. Setting damping too high and it will overcome one cycle. I'll look at the gain value again and measure the time difference directly. I'm going to try and optimize two circuits with two different OCXO's.


I found the CTI specs.

Product type: OSC5A2B02-10MHz
Nominal Frequency: 10.000MHz
Supply Voltage: +5V
Supply Current: Starting: ??600mA. Stability: ??250mA/+25Deg
Frequency Tolerance: 200PPb/ Vc=+2.0V(+25Deg)
Frequency stability vs. Temperature: 10PPb
Operating Temperature Range: 0Deg--+75Deg
Load Stability: 2PPb

Power Supply Stability: 2PPb
Aging: (after 30 days' power on) 0.5ppb/day
0.1ppm/first year
0.4ppm/10years
Short-term Frequency Stability: 0.05ppb/second (Allan Variance)
Warm-up Time: 100PPb/ Vc=+2.0V(+25Deg)
Voltage Control Characteristics:
Voltage Control Range: 1 ~2 ppm
Control Voltage: 2.0V

Slope: Positive
Linearity: 10%
Input Impedance: 100K??
Modulation Bandwidth: 10 KHz
Output Waveform: HCMOS Square Wave
Output Voltage:
VOH 4.5V min.
VOL 0.5V max.

Duty Cycle: 45/55 %
Rise/Fall Time: 6nS
Load: 15pF
Phase Noise: -80dBc/1Hz, -120dBc/10Hz, -140dBc/100Hz, - 145dBc/1KHz, -150dBc/10KHz
Operable Temperature Range: -40Deg~+85Deg
Storage Temperature Range: -55Deg~+105Deg
Package: 25.4mmX25.4mmX12.5mm(tin package)


The other I have are Milliren:

Output Frequency: 10.000MHz
Thermal Stability: ±1.0E-08
Temperature Range: -54°C to +85°C
Frequency Tolerance: ±1.0E-07 @ +25°C
Daily Aging: 1.0E-09/day after 24 Hours Continuous Operation
Mechanical Tuning: ±1.2E-06
Warm Up: 1.0E-08 after 3 Minutes referenced to 30 Minutes @ -40°C
Oven Supply Voltage and Power: 20VDC +/-5%; 7.5W Warm-up, 1.8W continuous at -40°C
Oscillator Supply Voltage and Power: 10 to 16VDC; 0.2W Max.
Output Power: +1dBm ±2dB
Short Term Stability: 5.0E-12 at 1 Second
« Last Edit: October 30, 2018, 06:51:08 pm by metrologist »
 

Offline imo

  • Super Contributor
  • ***
  • Posts: 1763
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #103 on: October 30, 2018, 07:59:39 pm »
Guys, in order to entertain you a little bit during your hard work - here is an idea how to adjust gain and offset such it fits an OCXO's tuning range best..  :D

The schematics:
1. at the input there is a resistive Divider (ie. it divides 1-5V DAC output to 100-500mV),
2. then an Adder (adds an Offset, ie. 6V for your OCXO) and
3. a "minus one" Multiplier (as the Adder does -1*(DAC+Offset) )
4. and finally the output goes to the OCXO's EFC input (the 100k there is the internal impedance of the OCXO).

With given values a DAC output of 1-5V divides to 100mV-500mV, adds approx 6V Offset (set via the pot trimmer) and the OCXO's EFC is then 100-500mV range around those 6V.

It needs a negative supply rail - that is pretty annoying..  :palm:

The below five colors are outputs for 1,2,3,4,5V input from the DAC.
You have to add a decoupling, use some better opamps (noise, offset, tempco), use stable and clean power supply.
Provided as-is, use at your own risk.. :)
« Last Edit: October 30, 2018, 08:19:03 pm by imo »
 

Offline metrologist

  • Super Contributor
  • ***
  • Posts: 1786
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #104 on: October 30, 2018, 11:17:21 pm »
Metrologist,

A gain of <20 may be too low to have a decent control, you jump too much up/down per every bit of DAC.

I thought it was the other way around, as a linear multiplier (or divisor). For example, higher end XO move less with proportional voltage change - if I understand, my Milliren moves only ±12Hz on the full 0 to 10V tune range. The CTI specs seem to say 20Hz over 5V range - but it looks like it moves a lot more and I need to measure it.

Guys, in order to entertain you a little bit during your hard work - here is an idea how to adjust gain and offset such it fits an OCXO's tuning range best..  :D

Oooh, that's fancy! Thanks!!! I was going to try a passive circuit. Am I right to think we do this to increase DAC resolution?
« Last Edit: October 30, 2018, 11:36:45 pm by metrologist »
 

Offline Miti

  • Frequent Contributor
  • **
  • Posts: 451
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #105 on: October 31, 2018, 01:41:15 am »
Metrologist,

A gain of <20 may be too low to have a decent control, you jump too much up/down per every bit of DAC.

I thought it was the other way around, as a linear multiplier (or divisor). For example, higher end XO move less with proportional voltage change - if I understand, my Milliren moves only ±12Hz on the full 0 to 10V tune range. The CTI specs seem to say 20Hz over 5V range - but it looks like it moves a lot more and I need to measure it.



On page 10 "gain = 65536 / VCO range (in ppb)". That means that your gain is too low because the VCO range is too big. Lars recommends restricting the range to 130 ppb using a "good" OCXO for a gain of 500, I don't know if this is only something that he chose empirically or he did some experiments with even lower range/higher gain. I'm talking OCXO only here because next he mentions Rubidium having a range of 1 ppb with the corresponding gain of 65536.
The PWM DAC that Lars implemented has a range of 5V. The CTI that moves 20Hz (I assume +/- 10HZ at 10MHz) over 5V has a huge range of 2ppm while the Milliren's range is 600ppb over 5V.
The jump per bit in the case of CTI would be 30.5ppt while for Milliren is only 9.2ppt. Lars's 130ppb recommended would jump about 2ppt and Rubidium would jump a whooping 0.015ppt (15ppq).
The reason why we want to use the resistors or the fancy circuit is to compress and offset the range of the DAC thus decreasing the 1LSB from 5V/65535 to a much lower value. The DAC resolution is defined as the number of bits and that stays at 16, it doesn't change. I've attached a diagram that shows the control voltage (thick black line) that my OCXO needs to keep the output frequency at 10MHz from power up to about 6 - 7 min when the warm-up period ends. You would expect to be a straight line after that but it isn't. In long term it seems to drift down very slowly meaning that the frequency tends to go up. The danger is that if you compress the range too much, after few years you may be out of the control range of the OCXO.
I hope it makes sense.
« Last Edit: October 31, 2018, 10:46:46 am by Miti »
That big spark at power up was by design!
 

Offline metrologist

  • Super Contributor
  • ***
  • Posts: 1786
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #106 on: October 31, 2018, 02:45:18 pm »
Thanks, Miti.

I was taking CTI 2ppm as 2000ppb, so the gain calculates to 32. I cannot maintain lock much over a TC of 8 with that low gain. The worst case should be g=65 if 1000ppb. I still need to measure the actual tuning range and that will be first thing I do next.

In honor of the hallowed ween, I have some scary images to post.

I set the gain to 200 and TC=12, shown in the first scope shot below. The phase oscillates within the 10s persistence, just under the TC, and keeps lock. The magenta trace is the tune voltage and it does not move much. If I increase gain, the phase change is faster and overcomes the TC and I loose lock (not shown).

I lower the gain to 100 and the phase change is slower and the tuning voltage is faster, shown in scope shot 2.

Lowering the gain to 32 I see scope shot 3. I cannot quite explain these results.

I have set my gain to 100 again and TC to 16 and was maintaining lock, so I started an MDEV analysis which had collected about 4 hours of data when I left it running. The "inflection" point Lars discusses was happening around 80 sec.
 

Offline metrologist

  • Super Contributor
  • ***
  • Posts: 1786
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #107 on: October 31, 2018, 04:11:33 pm »
imo, what do you think of this circuit? I suspect it will be heavily influenced by the osc tune circuit, so perhaps a series resistor to the tune pin?
 

Offline imo

  • Super Contributor
  • ***
  • Posts: 1763
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #108 on: October 31, 2018, 04:15:20 pm »
Guys, in order to entertain you a little bit during your hard work - here is an idea how to adjust gain and offset such it fits an OCXO's tuning range best..  :D
Oooh, that's fancy! Thanks!!! I was going to try a passive circuit. Am I right to think we do this to increase DAC resolution?
Yes, you may transform the 0-5V DAC range (ie the Lars design) to, say, 0-500mV (still 16bit resolution) and position this new DAC range around your OCXO EFC voltage of interest -> the voltage which fits 10.000MHz (with the Offset trimpot). You may power the Offset trimpot (the 10k trimpot in my schematics) from the OCXO's Vref output (to make it stable), for example.

Example: my OCXO has got the EFC tuning range from 1-6V, where my current exact 10MHz is at 4.2344V. I may go with the 500mV DAC range (Lars' 0-5V compressed to 0-500mV, and still 16bit resolution) and I will set the DC offset close to 4.00V.

Therefore the Lars' 16bit DAC will tune from 4.00 to 4.50V with full 16bit resolution. And my current exact 10MHz is in the middle of that range.
With aging it will walk somewhere, you have to judge how far it will walk and whether the 500mV range creates enough headroom for such a walk.
« Last Edit: October 31, 2018, 04:47:43 pm by imo »
 
The following users thanked this post: cdev

Offline lars

  • Regular Contributor
  • *
  • Posts: 132
  • Country: se
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #109 on: October 31, 2018, 10:07:05 pm »
Some general comments about "gain". If you measure gain by using h1 and h65535 (min and max from DAC) and the formula you should be enough close for correct gain. If the gain is close say up to a factor of two it should still work. You could get more or less ringing when the DAC voltage should tune in but it should work still. If you look at the P-term it is proportional to gain but the I-term is proportional to the square. So if the gain is wrong it will affect both the time constant and damping of the loop but are not super critical.

The reason I choose 130ppb range and 2ppt (0.002ppb) DAC resolution is a compromise between ability to handle long term drift and quantization noise with only 16bits.

If we start with the 2ppt DAC resolution it affects the best possible ADEV you can get. With 2ppt (2E-12) you can get below 1E-12 in ADEV so a really good OCXO is needed. On page 18 figure 8 in my instruction I have by purpose selected a larger range so the minimum step is 1E-11 and still the OCXO131 gives 5E-12 in ADEV. I will come back to Metrologist's result later that seems strange.

For the total range of 130ppb I have used different ranges even if 130ppb seems ok for me even due to drift. I have had OCXO monitored for more than 10 years but not drifting above 100ppb. Often the first year are worse than the next 10. In many OCXO's with SC-cut xtals including the one Metrologist is using the 10 year drift are specified to 400ppb.

So with a 16 bit DAC it is a compromise between enough resolution to use the best ADEV compared to long term drift of the OCXO.

To change the gain Imo's tips are very good to add an op-amp as it gives a lot of flexibility. But I should should say I have only used trimpots and resistors. Most of the time my OCXO have had a Vref. But if not I have added a Vref IC of 5v or a MC7805 that have been enough stable.

As the PWM-DAC can be seen as a perfect 0-5V DAC with low output impedance followed by the filter with a DC output impedance of 78kohm (39+39k) any impedance to ground or Vref will shunt the output voltage. For example a 10kohm poentiometer in the middle position will be two 5kohm resistors in parallell making the parallel combination 2.5k. So with a 78kohm in series and 2.5kohm shunted the range will be about (78+2.5)/2.5 is about 32 times lower range. With a 50kohm pot it will be about 8 times lower range (higher gain). I have used 10-50kohm and some different resistors in series with the pot to get what I want. The pots have mostly been 20-25 turn small trimpots like Bourns 3296, Spectrol 64W or noname from eBay.

If we add a trimpot or other shunt element the last stage in the RC filter will be affected, but it is not so critical. Another possibility is to add some more series resistance after the last RC before the shunting trimpot (resistor). The two 4.7uF are selected to suppress the 488Hz PWM signal from the Arduino. So we want to have less than 1LSB of ripple after the RC filters. This are ok with 4.7uF but also close with say 2.2uF. I have also used 10uF. The time constant in the RC filters are still in the seconds region and don't gives a lot of phase shift compared to the time constants in the PI-loop and software low-pass filter.

One thing with the 4.7uF is that I recommend tantalum 35v as leakage may be a problem. I wouldn't recommend electrolytic. Film will probably be ok. I have a couple of new ceramic 4.7uf SMD that I have intended to test but not yet done. So far I have only used different brands of tantalum 25 or 35V with good results.

Lars











 
The following users thanked this post: cdev

Offline lars

  • Regular Contributor
  • *
  • Posts: 132
  • Country: se
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #110 on: October 31, 2018, 10:34:02 pm »
Hello Metrologist,

If I compare Miti's and your MDEV curves it is something fishy with yours. Miti's ends at about 1E-11 but yours at 1E-9 so a factor of 100 higher. As your OCXO is specified at 0.05ppb (5E-11) short term noise (ADEV) I would suggest that your curve at least should be below 1E-10 but probably 1E-11 also if ok.

With 1E-9 the result are as poor as a medium qulity TCXO and a TC above 10s is difficult to get for such a TCXO as it is so much frequncy ripple so the loop will go above 100ns that is the condition for locked. On page 18 figure 8 you can see a really good TCXO DOT050V from Digikey that gives ADEV's of 1E-10 but still don't use longer than TC=50s to get optimum results.

I can see some reasons:
- Fault in OCXO even if my experience says no even if it is used OCXO from eBay.
- The 5v supply and decoupling
- The 4.7uF electrolytic
- Noise due to grounds and the prototyping

Suggestions:
-Use different 5v to Arduino and OCXO and maybe add more decoupling on them (and close especially on the OCXO).
-Change the 5uF electrolytics to tantalum. Even 10uF or 2.2uF would be better if you have them in tantalum.
-Add a 20-100kohm trimpot (or two resistors) between +5v and 0v to the input of the OCXO to test if it gives a different result. You have to find out a new gain.

Another comment about the oscillocsope pictures. I really like oscilloscope pictures but in the this case the 10Mhz jitter will still be were even with a working loop if you check over some time due to the 1PPS (GPS noise). In this case with wrong gain and oscillations it is more reasonable to see it on the serial monitor and the DAC value going corrupt. What is reasonable is difficult to say. At short TC's the ripple of the DAC is higher but should be more just noise due to the 1PPS than something that oscillates up and down.

Lars

 

Offline lars

  • Regular Contributor
  • *
  • Posts: 132
  • Country: se
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #111 on: October 31, 2018, 11:14:41 pm »
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?


Hello cdev,

Even if i am no expert I would say you are correct in your conclusions. I guess that the "professional" GPSDO's often have been used in telecom applications that requires good absolute timing compared to the "non-professional" like BG7TBL that more seems to be 10MHz frequency references. My intent with my GPSDO have also been a 10MHz reference. Of course the timing requirement is of importance. If +-11ns extra jitter is OK you an use the output from a uBlox series 6, 7 or 8 direct. We have to remember that the GPS in itself have many nanoseconds of variations over both a day and even in the minute range (for example due to satellite shifts). here I really recommend to see the NIST data archieves with data taken every 600 seconds to see the limits even under good conditions.

I have thought of how to add a jitter free 1PPS to my GPSDO. The simplest (that I use) is to add a PICDIV. This will not syncronize the GPS 1PPS but give a jitter free PPS. It is many PICDIV versions that can give 1PPS and also be syncronized. See Tom van Baaks PICDIV pages. You can buy them for just a few dollars and also Tom gives you the code so you can program the 12F675 by yourself. As the PICDIV #26 also give gives a chance to set another division factor I like it for testing of the TIC in my GPSDO.

If I were to make the best 1PPS I probably would add an extra uP (Arduino) to handle what i think is most important: Robustness. I think that having software to check that the 1PPS out really are aligned well with the GPS receivers jittery PPS are very important. How often should you check and what is a wrong PPS so it is time to align again? You have two edges of the 48MHz that makes the PPS possible to be +11ns or -11ns. Which are correct? So absolutely not impossible to handle but needs some care to get right.

Also the 10MHz gives 100ns between the positive (or negative edges) and need to be aligned either by the Arduino e.g TIC_offset and/or e.g. the cable delay in the GPS receiver.

Lars


 
The following users thanked this post: cdev

Offline Miti

  • Frequent Contributor
  • **
  • Posts: 451
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #112 on: October 31, 2018, 11:47:26 pm »
imo,

I think we were simulating "for fun" in the same time. My version only needs 5V and any cheap rail to rail will do it.
The plots are before and after the 78K (to simulate the output of the DAC) and the outputs of the op amps.
R4 should be a trim pot to adjust gain and R1/R2 another trim pot for offset.
But as Lars said, a trim pot may be enough.   ;D
That big spark at power up was by design!
 
The following users thanked this post: imo

Offline imo

  • Super Contributor
  • ***
  • Posts: 1763
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #113 on: November 01, 2018, 04:58:38 pm »
Yea, making simulation is fun.. There are some limits, however :)

Opamps - with above schematics the 1LSB will be around 8uV (!). You would need a pretty good opamps for that - with input drift tempcos below 8uV/degC, for example. Also mind all possible noise sources start to interfere into your business.. On the other hand the DAC resolution with the above schematics will be 1-2ppt (with a 200ppb/Volt OCXO). So the question is whether the stuff with those opamps will not be over-engineered  a bit :)

The PWM filtering - I would use a combination of tantalum and ceramics. The new ceramic multilayer capacitors (ie 10-22uF) have got an issue - their capacity drops down with applied DC bias - ie a 10uF/6V ceramic may drop to 2uF at 6V.

The PWM includes a lot of high freq content (ie the edges) thus ceramics in parallel with the tantalum one may help. Also mind the PWM made by atmel328 will always copy its 5V Vcc noise and stability..

« Last Edit: November 01, 2018, 05:12:35 pm by imo »
 

Offline imo

  • Super Contributor
  • ***
  • Posts: 1763
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #114 on: November 01, 2018, 06:46:24 pm »
Another idea - to decouple the PWM DAC from the noisy MCU or FPGA. You may use a single 5 pin smd gate, the gate gets its own 5V quality voltage regulator and good decoupling.

 

Offline Miti

  • Frequent Contributor
  • **
  • Posts: 451
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #115 on: November 02, 2018, 12:11:26 am »
Yea, making simulation is fun.. There are some limits, however :)

Opamps - with above schematics the 1LSB will be around 8uV (!). You would need a pretty good opamps for that - with input drift tempcos below 8uV/degC, for example. Also mind all possible noise sources start to interfere into your business.. On the other hand the DAC resolution with the above schematics will be 1-2ppt (with a 200ppb/Volt OCXO). So the question is whether the stuff with those opamps will not be over-engineered  a bit :)

The PWM filtering - I would use a combination of tantalum and ceramics. The new ceramic multilayer capacitors (ie 10-22uF) have got an issue - their capacity drops down with applied DC bias - ie a 10uF/6V ceramic may drop to 2uF at 6V.

The PWM includes a lot of high freq content (ie the edges) thus ceramics in parallel with the tantalum one may help. Also mind the PWM made by atmel328 will always copy its 5V Vcc noise and stability..

Before posting, I looked on Digikey's site for the cheapest rail to rail I/O from Maxim. Why Maxim, because they have a pretty good sample program  :-[. I'm not an experienced designer so I may have missed something but look at MAX4232AKA, the cheapest in stock for $1.73 CAD. Offset voltage tempco +/-3uV/°C, sounds really good to me.
I agree that it may be a bit over engineered but hey, this is just for fun, for experimenting.
Talking about ceramic capacitor voltage bias characteristic, the manufacturers publish such data so you can select a capacitor that has the desired capacitance at the control voltage that your OCXO needs. This circuit is particularly predictable since the variation around that voltage is minuscule.
That big spark at power up was by design!
 

Offline Miti

  • Frequent Contributor
  • **
  • Posts: 451
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #116 on: November 02, 2018, 12:30:16 am »
Just for fun, my Lars GPSDO and a second Ublox Neo M8T set to output 10MHz. The time-pulse jitter for this module should be +/-11 nS but looks a bit higher to me but maybe my signal is too weak, I'm using a small antenna in the window.
That big spark at power up was by design!
 

Offline imo

  • Super Contributor
  • ***
  • Posts: 1763
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #117 on: November 02, 2018, 09:11:11 am »
Just for fun, my Lars GPSDO and a second Ublox Neo M8T set to output 10MHz. The time-pulse jitter for this module should be +/-11 nS but looks a bit higher to me but maybe my signal is too weak, I'm using a small antenna in the window.
The 10MHz output from Neo 7/8 is broken. The clean output frequencies are those = 48MHz/N, where N=integer (like 4,5,6,..). It has been discussed few times here.
 

Offline Miti

  • Frequent Contributor
  • **
  • Posts: 451
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #118 on: November 02, 2018, 11:50:32 pm »
The 10MHz output from Neo 7/8 is broken. The clean output frequencies are those = 48MHz/N, where N=integer (like 4,5,6,..). It has been discussed few times here.

You are right, it is broken and I forgot about that, that may be the reason why the jitter is higher than specified. 2MHz is not broken though and the jitter seems to be within the limits.
That big spark at power up was by design!
 

Online hamster_nz

  • Super Contributor
  • ***
  • Posts: 2035
  • Country: nz
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #119 on: November 03, 2018, 12:56:59 am »
The 10MHz output from Neo 7/8 is broken. The clean output frequencies are those = 48MHz/N, where N=integer (like 4,5,6,..). It has been discussed few times here.

You are right, it is broken and I forgot about that, that may be the reason why the jitter is higher than specified. 2MHz is not broken though and the jitter seems to be within the limits.
Humm, you think you have problems :D

Here is the PPS from two modules, both running in my front (equator facing) window for half an hour... that is quite a big spread, plus 250ns of lag...
Gaze not into the abyss, lest you become recognized as an abyss domain expert, and they expect you keep gazing into the damn thing.
 

Offline cdev

  • Super Contributor
  • ***
  • Posts: 5082
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #120 on: November 03, 2018, 02:32:41 am »
Poke around in your vendors software for a cable delay setting. 

Also you should look at the power supply situation, make absolutely sure that either the two GPSs are on separate supplies that supply each adequate voltage and current independently, or if they are on the same supply that the current draw from one isnt impacting the power supplied to the other significantly, in other words, make sure you have enough power to have the voltage stay stable to both at the peak current.

The 10MHz output from Neo 7/8 is broken. The clean output frequencies are those = 48MHz/N, where N=integer (like 4,5,6,..). It has been discussed few times here.

You are right, it is broken and I forgot about that, that may be the reason why the jitter is higher than specified. 2MHz is not broken though and the jitter seems to be within the limits.
Humm, you think you have problems :D

Here is the PPS from two modules, both running in my front (equator facing) window for half an hour... that is quite a big spread, plus 250ns of lag...
« Last Edit: November 04, 2018, 12:29:22 am by cdev »
"What the large print giveth, the small print taketh away."
 

Offline imo

  • Super Contributor
  • ***
  • Posts: 1763
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #121 on: November 03, 2018, 08:35:58 am »
In case you plan to use the Neo modules for time/freq measurement purposes always use, for example, the external "28dB 3m cable" $3 antenna and put it outside your window..
« Last Edit: November 03, 2018, 08:45:15 am by imo »
 

Offline Bryan

  • Frequent Contributor
  • **
  • Posts: 572
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #122 on: November 03, 2018, 08:47:46 am »
May want to look at page 40 on the discussion on using ground planes with these puck antennas.

https://www.eevblog.com/forum/projects/a-look-at-my-symmetricom-gpsdo-(ocxo-furuno-receiver)/975/
-=Bryan=-
 

Offline Miti

  • Frequent Contributor
  • **
  • Posts: 451
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #123 on: November 03, 2018, 11:39:49 am »
In case you plan to use the Neo modules for time/freq measurement purposes always use, for example, the external "28dB 3m cable" $3 antenna and put it outside your window..

I'm using Trimble 56237-50 and it is located in my basement's window. It only sees the west side of the sky. Talking about Ublox modules time mode, how do you put Neo M8T in time mode? This is what I did:
- In TMODE2 I selected Time Mode = 2 - Fixed Mode
- Fixed Time Mode True Position I entered the Long, Lat and Alt indicated by U-Center
- In  NAVX5 I restricted Min/Max SVs to 1 -3
- In NAV5 Min SV Elevation = 10 deg

What's the difference between TMODE, TMODE2, TMODE3? What are the best settings for a GPSDO setup with a small patch antenna like this?
« Last Edit: November 03, 2018, 11:52:42 am by Miti »
That big spark at power up was by design!
 

Offline Miti

  • Frequent Contributor
  • **
  • Posts: 451
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #124 on: November 04, 2018, 12:46:23 pm »
My version of Lars GPSDO with TC=500 did not loose lock once after I enabled temperature compensation.

Good job Lars, thanks!
« Last Edit: November 04, 2018, 12:48:09 pm by Miti »
That big spark at power up was by design!
 

Offline cdev

  • Super Contributor
  • ***
  • Posts: 5082
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #125 on: November 04, 2018, 01:26:41 pm »
The NavSpark Mini can be bought in a pack of six for $35 plus a few dollars shipping. They may also still be giving away one free if you pay shipping, So you can get seven for around $40.

All of my Skytraq receivers are extremely sensitive, and the Minis also support Beidou which seems to make them significantly better than my GPS and SBAS only older Venus 5 and 6 based non RTK GPSs once they have warmed up.

The (windows only, but wine-friendly) configuration tool gives a surprisingly large number of configuration options for such a cheap GPS and the sensitivity (with all skytraqs) is extremely good which means that it almost never loses lock, even indoors, if its on a half decent antenna (a passive antenna works fine). It is much better than Ublox in that respect.

In terms of reliability of its 1PPS being present frankly, its the best GPS Ive ever seen. It just works.

I have several of them now connected to my RaspberryPis indoors with no special care needed as to antenna placement, Only one is upstairs, none are on outdoor antennas, two are on home-assembled Taoglas 25mm passive patch antennas - They work great, literally 'never' losing their GPS lock.

I worry there is no over-constrained timing mode in the NavSpark mini.. That'll probably add a bit to its PPS jitter. (I'm not sure how much).

I'm not convinced it's necessary to use a higher frequency reference clock. The PPS signal from GPS is normally specified to be accurate with sigma=10 or 15ns, even with  sawtooth correction. Sampling the higher frequency from the receiver won't help (if sawtooth correction is used).

Also, loop constants are normally many minutes, comparisons more often than every second won't be helpful.... There should already be enough averaging.

« Last Edit: November 04, 2018, 01:33:51 pm by cdev »
"What the large print giveth, the small print taketh away."
 

Offline PT_Dreamer

  • Contributor
  • Posts: 34
  • Country: pt
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #126 on: November 06, 2018, 03:17:07 pm »
Hi,

I have been trying to understand Lars's code but even though it's partially documented I have been having difficulties making sense of some hard coded variables.

For example line 166:
Quote
timer_us = timer_us + 50000 - (((timer1CounterValue - timer1CounterValueOld) * 200 + TIC_Value - TIC_ValueOld)+50000500)/1000;

Where do the magic 50000 and 50000500 values come from? Any help?

Thanks,

José
 

Offline imo

  • Super Contributor
  • ***
  • Posts: 1763
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #127 on: November 06, 2018, 08:00:38 pm »
timer_us = timer_us + 50000 -

(((timer1CounterValue - timer1CounterValueOld) * 200 + TIC_Value - TIC_ValueOld)  >>>  those are in 200ns timer1C_ increments (OCXO/2) and you add TIC_V diff value (TIC is the voltage measured by the ADC from 4046+diode+3.9k+1nF) in nanoseconds  to it thus everything is in nanoseconds now

+50000500)/1000;  >> you add 50000500 because you do modulo 50000 and you want to round properly (xxx.500) and finally you divide all by thousands to get microseconds

You do modulo 50000 therefore (an example)

timer_us = timer_us + 50000 - (((1)*200 + 530 - 490) + 50000500)/1000 = timer_us + 50000 - ((200+40) + 50000500)/1000 = timer_us + 50000 - (50000740)/1000 = timer_us + 50000 - 50000 = timer_us +  0    >>> no change as the 1PPS came within 1usec.. (or better to say: the OCXO's freq at this moment is such thus it fits into 1PSS +/-0.5us).

« Last Edit: November 06, 2018, 08:24:01 pm by imo »
 
The following users thanked this post: PT_Dreamer

Offline texaspyro

  • Super Contributor
  • ***
  • Posts: 1296
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #128 on: November 07, 2018, 01:07:25 am »
The (windows only, but wine-friendly) configuration tool gives a surprisingly large number of configuration options for such a cheap GPS

Lady Heather also talks to them... it's the same as Venus receivers.  It might be recognized as a NMEA receiver unless you use the /rxv command line option.
« Last Edit: November 07, 2018, 01:09:19 am by texaspyro »
 

Offline PT_Dreamer

  • Contributor
  • Posts: 34
  • Country: pt
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #129 on: November 07, 2018, 06:15:55 pm »
timer_us = timer_us + 50000 -

(((timer1CounterValue - timer1CounterValueOld) * 200 + TIC_Value - TIC_ValueOld)  >>>  those are in 200ns timer1C_ increments (OCXO/2) and you add TIC_V diff value (TIC is the voltage measured by the ADC from 4046+diode+3.9k+1nF) in nanoseconds  to it thus everything is in nanoseconds now

+50000500)/1000;  >> you add 50000500 because you do modulo 50000 and you want to round properly (xxx.500) and finally you divide all by thousands to get microseconds

You do modulo 50000 therefore (an example)

timer_us = timer_us + 50000 - (((1)*200 + 530 - 490) + 50000500)/1000 = timer_us + 50000 - ((200+40) + 50000500)/1000 = timer_us + 50000 - (50000740)/1000 = timer_us + 50000 - 50000 = timer_us +  0    >>> no change as the 1PPS came within 1usec.. (or better to say: the OCXO's freq at this moment is such thus it fits into 1PSS +/-0.5us).

Hi,

Thank you very much for the detailed explanation, all clear now!
 

Offline Satbeginner

  • Regular Contributor
  • *
  • Posts: 130
  • Country: es
  • Dutch, early retired, living in Spain
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #130 on: November 08, 2018, 07:00:35 pm »
Hi Lars,

I found your thread and I really liked the way it is set up, so I decided to build one myself.
I already had a Bliley 10MHz ocxo with the following specs:
VCC=5VDC, Vout =0-5V, Vcontrol to obtain 10MHz =2,76V, so that should fit well in your design.

I used one of the Chinese NANO AT328 boards with USB on board, it runs your software well.

I ordered the parts and put it together, but.....

It did not work directly, so I did some troubleshooting.

I found the 10MHz being OK, meaning a reasonable square wave between 0V and 4.5V with an duty cycle of about 50%.
The divided 5MHz and 1MHz are OK too.

I used a Chinese 5V GPS receiver board, where I picked the 1PPS from the onboard series resistor with blue LED, also with proper levels.

And still it would not work.
It would never lock, but I would see the ns column and the ns difference column counting up- and down.

So, I tried to see the 0-1us pulse going into the arduino, and.... it was not there?!? :palm: :palm:

It took me a while, but I goofed big time when I ordered my parts.
I assumed that a CD4046 would be the same as a 74HC(T)4046, usually the CD4xxx is the same as a TI4xxx or a MC4xxx etc.

But, it turned out a CD4046 only has the first two comparators, pin 15 inside a CD4046 is just a zener coming from the +5V,  |O |O |O
while a 74HC(T)4046 has the third comparator output on pin 15 you actually use in your design... :-+

So I ordered some 74HC4046's , as soon as they are here, I will follow-up.

To be continued, thanks for now,

Un saludo,

Leo
You need a scope to repair a scope, and you need many multimeters to repair another multimeter!
*Tek 2465B, Tek 2465B, Tek 485, Keithley 175A, Keithley 2000's, HP 3468B, HP 3457A, HP 34401A, PM 6671, PM 5716, Fluke 45, Fluke 75, Fluke 77, Fluke 79, AFX 9660BL, KPS 605D, etc. *
 

Offline Miti

  • Frequent Contributor
  • **
  • Posts: 451
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #131 on: November 11, 2018, 04:37:40 pm »
I finalized my GPSDO and placed it on the shelf where it belongs. Locked since October 2018.  :-DD
It has 18 X 50 Ohm outputs.
« Last Edit: November 11, 2018, 04:39:47 pm by Miti »
That big spark at power up was by design!
 

Offline cdev

  • Super Contributor
  • ***
  • Posts: 5082
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #132 on: November 12, 2018, 01:38:12 am »
Those Extron cases rule!

I have two of them and I think I am going to put my TruePosition into one and put one of these GPSDOs into the other. It will be a good learning experience.

I finalized my GPSDO and placed it on the shelf where it belongs. Locked since October 2018.  :-DD
It has 18 X 50 Ohm outputs.
"What the large print giveth, the small print taketh away."
 

Offline Miti

  • Frequent Contributor
  • **
  • Posts: 451
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #133 on: November 13, 2018, 12:28:31 pm »
Those Extron cases rule!

I have two of them and I think I am going to put my TruePosition into one and put one of these GPSDOs into the other. It will be a good learning experience.

I finalized my GPSDO and placed it on the shelf where it belongs. Locked since October 2018.  :-DD
It has 18 X 50 Ohm outputs.

True position?
That big spark at power up was by design!
 

Offline cdev

  • Super Contributor
  • ***
  • Posts: 5082
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #134 on: November 13, 2018, 01:11:13 pm »
True position?

Yes, but ...  I'm being stupid about it.

I have (two) ADA 3 180s which have 9 10 MHz capable outs and 3 "TTL" outs each, plus four additional BNC cutouts which have black plugs in them now. 

However- my TP GPSDO's and its GPSDO controller's current home is still inside a plain white cardboard box, with the holes for jacks and wires cut out of it.  :o

It works but its a visual embarrassment.

Frankly, I am still indecisive about how I want to implement it.

I cant decide whether I want the 'front' or 'back' of the case to be the accessible/ control area, (leaning towards duplicating the same set of LEDs in both places) I haven't fully decided what controller to use or even if I want to use any of the existing ones. There is no great hurry, but I would like to get it done eventually and put it into a nice case.  My Extron qualifies as more than just a nice case, its basically an ideal case, so I really have no excuse whatsoever now not to at least mount it in there so I can use it with external control with the distribution amp and TTL amp for the PPS while I try to cure my indecisiveness over the rest of the design.


TruePosition units are removed from telco service as cellphone time-delay of arrival locator units. They are similar in many respects to the symmetricom and Trimble UCCM GPSDO cards. Instead of the 5v supply they run off a 12v supply and are meant to live in a rack with other identical units. They speak to either RS232 or 3.3v UART controllers.

Thanks to pigrew and texaspyro, and a few others a very complete set of commands to work with them is available and for the money they cost (around $40-45) they are a real bargain. As far as accuracy they are comparable to the other telco surplus units. Which tend to cost a lot more.

They use the same Furuno timing GPS as many of the Symmetricom units. 


Despite my now having one,  the idea of building a GPSDO still appeals to me a lot, in terms of learning how they work.


Might be interesting to have one alongside the other maybe even receiving the exact same signal, split, to see what factors influenced the accuracy.


« Last Edit: November 13, 2018, 01:39:17 pm by cdev »
"What the large print giveth, the small print taketh away."
 

Offline texaspyro

  • Super Contributor
  • ***
  • Posts: 1296
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #135 on: November 13, 2018, 07:22:15 pm »
I haven't fully decided what controller to use or even if I want to use any of the existing ones.

Raspberry PI with the "official" 7" 800x480 touchscreen running Lady Heather...

Or, if you are a masochist, a $12 3.5"  480x320 touchscreen that plugs onto the PI... might even work with a PI Zero.
 

Offline cdev

  • Super Contributor
  • ***
  • Posts: 5082
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #136 on: November 13, 2018, 07:40:52 pm »
I have a very small 320x240 color ILI9341 SPI TFT display but its not a touch screen. I've thought it would be fun to try to make a useful display that somehow managed to make the dozen or so most relevant pieces of info visible in one glance but I'm not a good enough coder yet to do it without some toolkit and other programs to get the core elements from.

Although I like LH, I would never build a LH device to leave on all the time. The whole LH display of the satellites is overkill for me. But it would be great to be able to graph the GPSDO's fix or holdover status in a small area of it along with the other info. Pushing a button could turn on the full display for some length of time. pigrew's controller conveys a lot of info about the temperature of the oven vs. voltage being supplied and fix status. Correct me if I'm wrong but both LH and his controller work by putting the GPSDO into debugging modes. I wonder if that has any impact on the stability of the output signals?

Right now it seems to be unavoidable if one wants to get all the various bits of info at once. I wonder what is on the multitudes of pins on that huge header. Most of those extra pins seem to remain completely unexplored. I wonder if some additional probing might turn up more clues.

I would be happy to simply turn up some additional 3.3 or 5 volt logic signals on those headers to drive LEDs to indicate the various modes without needing to activate debugging modes..

I like the brightness and sharpness of the very small monochrome oled displays, but I am concerned about their longevity.

I am very sorry, I need to stop though, please forgive me for hijacking Lars' thread.
« Last Edit: November 13, 2018, 07:48:46 pm by cdev »
"What the large print giveth, the small print taketh away."
 

Offline texaspyro

  • Super Contributor
  • ***
  • Posts: 1296
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #137 on: November 13, 2018, 07:52:30 pm »
Although I like LH, I would never build a LH device to leave on all the time. The whole LH display of the satellites is overkill for me. But it would be great to be able to graph the GPSDO's fix or holdover status in a small area of it along with the other info. Pushing a button could turn on the full display for some length of time. pigrew's controller conveys a lot of info about the temperature of the oven vs. voltage being supplied and fix status. Correct me if I'm wrong but both LH and his controller work by putting the GPSDO into debugging modes.

You are wrong...  there is no debugging mode.  We do use some commands that output additional "debug" info.

What's wrong with overkill?  Overkill is a good thing.   Nobody like underkill.  If you click on the plot header or use the ZP command, Heather shows the plot area in full screen mode.

 

Offline cdev

  • Super Contributor
  • ***
  • Posts: 5082
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #138 on: November 13, 2018, 08:19:53 pm »
I suppose a display could be dimmed to extend its life.

My main concern is display and GPSDO longevity.


You are wrong...  there is no debugging mode.  We do use some commands that output additional "debug" info.

What's wrong with overkill?  Overkill is a good thing.   Nobody like underkill.  If you click on the plot header or use the ZP command, Heather shows the plot area in full screen mode.


Yes, that's what I would likely leave it on.
« Last Edit: November 13, 2018, 08:21:48 pm by cdev »
"What the large print giveth, the small print taketh away."
 

Offline texaspyro

  • Super Contributor
  • ***
  • Posts: 1296
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #139 on: November 13, 2018, 08:29:24 pm »
I suppose a display could be dimmed to extend its life.

Not really... most displays now use LED backlights... which tend to last for pretty much forever.   I have LED backlit displays that have been on 24/7 for over a decade.   

Older displays with CCFL backlights are a different matter.  Those do degrade over time and the tubes need to be replaced... which is usually a royal pain in the ass.
 

Offline JTDolan

  • Newbie
  • Posts: 2
  • Country: us
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #140 on: November 14, 2018, 08:20:39 am »
Yet another DIY GPSDO! On the internet you can find a lot of DIY GPSDO designs. What are the differences between them? Why this?
Some + and – I can come up with for mine:

+ 1ns resolution TIC (Time Interval Counter)
+ PLL (not FLL)
+ Uses Arduino (ok some might say it is negative)
+ Low parts count and cheap components
+ No need for a specific GPS receiver only requires 1PPS in
+ Easy adaption to different oscillators (from simple VCXO to Rubidium)
+ Configuration for VCO range, time constant (4-32000s) and a lot of other parameters
+ Outputs time error (ns), DAC value and temperature (and a lot of other information) to the serial port
+ Logs time error, DAC value and temperature every third hour
+ Stores last DAC value for use at power-up
-DAC resolution (now 16bits) and stability could be better
-No saw tooth correction
-No adaptive time constant
-Not using information from receiver e.g. number of satellites etc.
-No standardized communication protocol like many commercial GPSDO’s
-No display

Why did I do this? Since about 2010 I have developed my GPSDO. It started just because I was lazy and tired of tweaking my 10MHz house standard. The only thing I am proud of is the 1ns resolution TIC. A couple of years ago I published an old version on the time nuts forum. This time I decided to use this forum instead as I think my DIY GPSDO is something for experimenters in this forum.

For me it is perfect for experiments. I have learned a lot during the years I have used it (and developed it).

I have built several complete GPSDO’s but now the only one I have running continuous is a rubidium based DIY Arduino GPSDO I use as a lab standard for my instruments. That Rb GPSDO has been running almost continuous for more than five years with different versions of my Arduino software.

Today you can get a GPS module + antenna for about 10USD from eBay, an OCXO for 10-20USD, a metal box and connectors for about 10USD, the Arduino pro mini and all other components for about 10USD, So around 50-60USD should be enough to get all components for a complete GPSDO.



As I had problems with file extensions I added .txt to the arduino sketch .ino. You have to take away the .txt and place it in a folder with the same name. To easier read the file without arduino see the .txt without .ino in the file name.

I also had to divide the instruction as it was about 2MB. Sorry for the inconvenience.

Lars

Thanks for sharing. Working it this way really cuts the price down huh...
 

Offline cdev

  • Super Contributor
  • ***
  • Posts: 5082
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #141 on: November 19, 2018, 10:21:07 pm »
There are a bewildering number of 10 MHz ovened oscillators available on ebay. What should somebody look for- what are good choices to use in your design that are also usually pretty affordable?
« Last Edit: November 19, 2018, 11:02:29 pm by cdev »
"What the large print giveth, the small print taketh away."
 

Offline metrologist

  • Super Contributor
  • ***
  • Posts: 1786
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #142 on: November 19, 2018, 11:01:36 pm »
Good question cdev. I am now using CTI from queens_land, and I notice he has new samples now too. The used one is $6USD and I am using it simply for 5V convenience with Arduino and GPS module supply voltages.
 

Offline Miti

  • Frequent Contributor
  • **
  • Posts: 451
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #143 on: December 07, 2018, 11:16:36 pm »
Anybody heard anything from Lars lately? I hope he's OK.
That big spark at power up was by design!
 
The following users thanked this post: cdev

Offline cdev

  • Super Contributor
  • ***
  • Posts: 5082
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #144 on: December 07, 2018, 11:28:36 pm »
This post on time-nuts describes his posting here, and it includes his email address. I don't see any more recent posts there, this is from September.

http://lists.febo.com/pipermail/time-nuts_lists.febo.com/2018-September/094020.html
"What the large print giveth, the small print taketh away."
 

Offline Satbeginner

  • Regular Contributor
  • *
  • Posts: 130
  • Country: es
  • Dutch, early retired, living in Spain
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #145 on: December 08, 2018, 04:21:41 pm »
Hi all,

here is my follow-up on the build of the Lars GPS-DO.
After I received the proper 74HC4046 I was able to complete the setup.
It's on a breadboard for now, because I haven't decided yet what kind of case I am going to use.

Anyway, here some of my findings during the build:

- I was able to test the 1PPS using a scope and could confirm the levels were OK. (Moving between 0,3V and 4,5V with clean flanks)
- The 10MHz coming from a 5V Bliley OCXO (bought cheap on eBay, used, taken from redundant Cellular Equipment. Nice actually, some people think -because they are 'old'- they will have less drift)
  The signal is a square wave, but the flanks are not as clean as I would like them to be, more later.
- Using the IDE serial monitor I could send all the required commands like "h1", "h65535", "e22", "gxx", "s1" and finally "r".

I measured the voltage controlling the OCXO:
after sending "h1" [ENTER] I measured 0,47V at the input of the OCXO, and the value of "diff_ns" was around +720
after sending "h65535" [ENTER] I measured 4,67V at the input of the OCXO, and the value of "diff_ns" was around -750

So, according to Lars's description, my gain-value should be the difference between  -750 and +720 = 1470, so 65535 / 1470 = 44,58 => 45
I wrote this value using "g45" [ENTER] followed by "s1" [ENTER]
After that I send a "r" [ENTER].

I let it run for some time (around 5-6 minutes) and at that point it found a "lock", with a "diff_ns" value of 34444 and an OCXO control voltage of 2,46V which sounds OK for a Bliley OCXO,  but it would lose it after a few minutes again...

I checked all signals again using my scope, the only one a bit tricky was the HC390 output into the Arduino??
I will try to find how this input is setup in the code (Input_Pullup, Change, etc.), but by temporarily putting a 10k resistor to ground cleaned it up.

Without it, I found the "diff_ns" value would "jump" at random moments 220 down, so instead of a value around zero (between +17 and -15 ns) it suddenly would be -235 (just one time!) and come back to normal from there.

Obviously it doesn't help that my setup is on a breadboard for now, it will work better after I put all parts on a little PCB with shorter and cleaner wiring.

Anyway, for now it works and I am happy.

To be continued, un saludo,

Leo

« Last Edit: December 08, 2018, 04:23:44 pm by Satbeginner »
You need a scope to repair a scope, and you need many multimeters to repair another multimeter!
*Tek 2465B, Tek 2465B, Tek 485, Keithley 175A, Keithley 2000's, HP 3468B, HP 3457A, HP 34401A, PM 6671, PM 5716, Fluke 45, Fluke 75, Fluke 77, Fluke 79, AFX 9660BL, KPS 605D, etc. *
 

Offline imo

  • Super Contributor
  • ***
  • Posts: 1763
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #146 on: December 09, 2018, 09:47:52 am »
- I was able to test the 1PPS using a scope and could confirm the levels were OK. (Moving between 0,3V and 4,5V with clean flanks)
The HC output signals should be much closer to Vcc and Gnd..
 
The following users thanked this post: Satbeginner

Offline Satbeginner

  • Regular Contributor
  • *
  • Posts: 130
  • Country: es
  • Dutch, early retired, living in Spain
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #147 on: December 09, 2018, 10:03:39 am »
- I was able to test the 1PPS using a scope and could confirm the levels were OK. (Moving between 0,3V and 4,5V with clean flanks)
The HC output signals should be much closer to Vcc and Gnd..

Hi, I am in the process of putting it all on a perfboard pcb today as we speak, will check all levels after that again.
Using the breadboard and the somewhat longer wires caused a lot of ringing, all this was interfering with the signal quality.

Thanks for your remarks,

Leo
You need a scope to repair a scope, and you need many multimeters to repair another multimeter!
*Tek 2465B, Tek 2465B, Tek 485, Keithley 175A, Keithley 2000's, HP 3468B, HP 3457A, HP 34401A, PM 6671, PM 5716, Fluke 45, Fluke 75, Fluke 77, Fluke 79, AFX 9660BL, KPS 605D, etc. *
 

Offline Miti

  • Frequent Contributor
  • **
  • Posts: 451
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #148 on: December 09, 2018, 05:21:13 pm »
Leo,

Does it unlock if you don't touch it? My GPSDO always looses lock if I turn it on the side or upside down. It is known that gravity affects frequency in the OCXOs.
That big spark at power up was by design!
 
The following users thanked this post: Satbeginner

Offline Satbeginner

  • Regular Contributor
  • *
  • Posts: 130
  • Country: es
  • Dutch, early retired, living in Spain
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #149 on: December 10, 2018, 09:54:30 am »
Leo,

Does it unlock if you don't touch it? My GPSDO always looses lock if I turn it on the side or upside down. It is known that gravity affects frequency in the OCXOs.

Hi,

I just put it all together again, and it does lock again.
And no, mine does not unlock when put upside down.

However, I do see a 'jump'  in the offset when it's running normally. This does not change when put upside down.

See attached picture, is this normal?

Thanks, un saludo,

Leo
« Last Edit: December 10, 2018, 09:56:06 am by Satbeginner »
You need a scope to repair a scope, and you need many multimeters to repair another multimeter!
*Tek 2465B, Tek 2465B, Tek 485, Keithley 175A, Keithley 2000's, HP 3468B, HP 3457A, HP 34401A, PM 6671, PM 5716, Fluke 45, Fluke 75, Fluke 77, Fluke 79, AFX 9660BL, KPS 605D, etc. *
 

Offline imo

  • Super Contributor
  • ***
  • Posts: 1763
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #150 on: December 10, 2018, 04:25:29 pm »
You may see similar periodicity in Miti's results here. It may come from NEO7M.
 
The following users thanked this post: Satbeginner

Offline Miti

  • Frequent Contributor
  • **
  • Posts: 451
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #151 on: December 13, 2018, 01:51:14 am »
However, I do see a 'jump'  in the offset when it's running normally. This does not change when put upside down.

See attached picture, is this normal?


Yes, it is, and mine is locked for 38 days so it is rock stable, see my pictures. A big improvement was when I enabled temperature compensation.
That big spark at power up was by design!
 
The following users thanked this post: Satbeginner

Offline Satbeginner

  • Regular Contributor
  • *
  • Posts: 130
  • Country: es
  • Dutch, early retired, living in Spain
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #152 on: December 14, 2018, 11:51:31 am »
However, I do see a 'jump'  in the offset when it's running normally. This does not change when put upside down.

See attached picture, is this normal?


Yes, it is, and mine is locked for 38 days so it is rock stable, see my pictures. A big improvement was when I enabled temperature compensation.

Hi,

yes, I do see the same, and it stayed locked perfectly for days now, even without the temperature compensation
It looks like there is one bigger step up (still small though!), and two small steps down to compensate for that. :-)

I am wondering, maybe it's possible the add an extra to the software, maybe an auto-calibrate routine?

At the moment I am thinking like this:

To add a separate "autocal" routine that can be called either by an interrupt (a button) and/or an extra software command that does the following:

During the "autocal", stop running,  put a fixed "h1" value and read the offset, after that put a fixed "h65535" value and read the offset again,
and than do the math, to find the difference and use that to calculate the gain and save that instead of a manual gxx [ENTER] ?
Not sure how useful that would be.

Anyway, food for thought...

But first I am in the process of completing my box, I already added 3 channels of an 74HCT14 in parallel with three 150 Ohm resistors as buffer for both the 10MHz and 1-PPS output, so they are able to drive a 50 Ohm load.
I also want to use the rest of the HC390 to create extra divided frequency outputs, or even a second HC390, also buffered by more 74HCT14's, so I can use it as a scope timing calibrator.

To be continued, :-)

Un saludo,

Leo
You need a scope to repair a scope, and you need many multimeters to repair another multimeter!
*Tek 2465B, Tek 2465B, Tek 485, Keithley 175A, Keithley 2000's, HP 3468B, HP 3457A, HP 34401A, PM 6671, PM 5716, Fluke 45, Fluke 75, Fluke 77, Fluke 79, AFX 9660BL, KPS 605D, etc. *
 

Offline cdev

  • Super Contributor
  • ***
  • Posts: 5082
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #153 on: December 14, 2018, 01:35:40 pm »
@tvb has figured out an accurate, inexpensive way to do this that works well on all GPSDOs!
See the following.

http://www.leapsecond.com/pic/picdiv.htm

http://www.leapsecond.com/pic/picpet.htm

http://leapsecond.com/pic/picpet2.htm



Hi,

yes, I do see the same, and it stayed locked perfectly for days now, even without the temperature compensation
It looks like there is one bigger step up (still small though!), and two small steps down to compensate for that. :-)

I am wondering, maybe it's possible the add an extra to the software, maybe an auto-calibrate routine?

At the moment I am thinking like this:

To add a separate "autocal" routine that can be called either by an interrupt (a button) and/or an extra software command that does the following:

During the "autocal", stop running,  put a fixed "h1" value and read the offset, after that put a fixed "h65535" value and read the offset again,
and than do the math, to find the difference and use that to calculate the gain and save that instead of a manual gxx [ENTER] ?
Not sure how useful that would be.

Anyway, food for thought...

But first I am in the process of completing my box, I already added 3 channels of an 74HCT14 in parallel with three 150 Ohm resistors as buffer for both the 10MHz and 1-PPS output, so they are able to drive a 50 Ohm load.
I also want to use the rest of the HC390 to create extra divided frequency outputs, or even a second HC390, also buffered by more 74HCT14's, so I can use it as a scope timing calibrator.

To be continued, :-)

Un saludo,

Leo
"What the large print giveth, the small print taketh away."
 

Offline Miti

  • Frequent Contributor
  • **
  • Posts: 451
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #154 on: December 15, 2018, 05:03:29 pm »
Right when I said that my GPSDO is rock solid, it lost the lock after more than a month. Foggy morning, my GPS antenna is in my basement's window, I can only blame it on the GPS.
That big spark at power up was by design!
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1360
  • Country: dk
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #155 on: December 15, 2018, 06:06:22 pm »
@tvb has figured out an accurate, inexpensive way to do this that works well on all GPSDOs!
See the following.

http://www.leapsecond.com/pic/picdiv.htm

http://www.leapsecond.com/pic/picpet.htm

http://leapsecond.com/pic/picpet2.htm


Ulrich B did an AVR version of PPSDIV here (Bottom)
http://www.ulrich-bangert.de/html/downloads.html

Edit:
Seems like a Tiny84 has a full PortA (0..7) , meaning this one:
http://www.ulrich-bangert.de/PPSDivider.zip

Ought to work w.

Code: [Select]
#include <tn84def.inc>

The avr assembler2 runs fine in wine on linux

My avr assembler2 script
Code: [Select]
#!/bin/bash
wine ~/avr/AvrAssembler2/avrasm2.exe -I ~/avr/AvrAssembler2/Appnotes -I ~/avr/AvrAssembler2/include \
 -d$1.obj -m$1.map -l$1.lst -e$1.eep -vs -v2 -fI $1 $2 $3 $4 $5

Result
Quote
$ avrasm2 PPSDivider-t84.asm
AVRASM: AVR macro assembler 2.1.43 (build 48 May 30 2011 10:07:37)
Copyright (C) 1995-2011 ATMEL Corporation

PPSDivider-t84.asm(1): Including file '/../avr/AvrAssembler2/include\tn84def.inc'
PPSDivider-t84.asm(87): No EEPROM data, deleting PPSDivider-t84.asm.eep

Notice:
The register and instruction counts are symbol table hit counts,
and hence implicitly used resources are not counted, eg, the
'lpm' instruction without operands implicitly uses r0 and z,
none of which are counted.

x,y,z are separate entities in the symbol table and are
counted separately from r26..r31 here.

.dseg memory usage only counts static data declared with .byte

ATtiny84 register use summary:
r0 :   0 r1 :   0 r2 :   0 r3 :   0 r4 :   0 r5 :   0 r6 :   0 r7 :   0
r8 :  13 r9 :   5 r10:   5 r11:   5 r12:   5 r13:   5 r14:   5 r15:   5
r16:  18 r17:   4 r18:   0 r19:   0 r20:   0 r21:   0 r22:   0 r23:   0
r24:   0 r25:   0 r26:   0 r27:   0 r28:   0 r29:   0 r30:   0 r31:   0
x  :   0 y  :   0 z  :   0
Registers used: 10 out of 35 (28.6%)

ATtiny84 instruction use summary:
.lds  :   0 .sts  :   0 adc   :   0 add   :   0 adiw  :   0 and   :   0
andi  :   0 asr   :   0 bclr  :   0 bld   :   9 brbc  :   0 brbs  :   0
brcc  :   0 brcs  :   7 break :   0 breq  :   0 brge  :   0 brhc  :   0
brhs  :   0 brid  :   0 brie  :   0 brlo  :   0 brlt  :   0 brmi  :   0
brne  :  15 brpl  :   0 brsh  :   0 brtc  :   0 brts  :   0 brvc  :   0
brvs  :   0 bset  :   0 bst   :   0 cbi   :   0 cbr   :   0 clc   :   0
clh   :   0 cli   :   0 cln   :   0 clr   :  16 cls   :   0 clt   :   1
clv   :   0 clz   :   0 com   :   0 cp    :  14 cpc   :   0 cpi   :   0
cpse  :   0 dec   :   2 eor   :   0 icall :   0 ijmp  :   0 in    :   0
inc   :   7 ld    :   0 ldd   :   0 ldi   :   5 lds   :   0 lpm   :   0
lsl   :   0 lsr   :   0 mov   :   0 movw  :   0 neg   :   0 nop   :   1
or    :   0 ori   :   0 out   :   3 pop   :   0 push  :   0 rcall :   0
ret   :   0 reti  :   0 rjmp  :   1 rol   :   0 ror   :   0 sbc   :   0
sbci  :   0 sbi   :   0 sbic  :   0 sbis  :   0 sbiw  :   0 sbr   :   0
sbrc  :   0 sbrs  :   0 sec   :   0 seh   :   0 sei   :   0 sen   :   0
ser   :   0 ses   :   0 set   :   1 sev   :   0 sez   :   0 sleep :   0
spm   :   0 st    :   0 std   :   0 sts   :   0 sub   :   0 subi  :   0
swap  :   0 tst   :   0 wdr   :   0
Instructions used: 13 out of 105 (12.4%)

ATtiny84 memory use summary [bytes]:
Segment   Begin    End      Code   Data   Used    Size   Use%
---------------------------------------------------------------
[.cseg] 0x000000 0x0000a4    164      0    164    8192   2.0%
[.dseg] 0x000060 0x000060      0      0      0     512   0.0%
[.eseg] 0x000000 0x000000      0      0      0     512   0.0%

Assembly complete, 0 errors. 0 warnings


/Bingo

Edit: AVRasm2 - http://www.mikrocontroller.net/attachment/26295/AVR2.zip

AVRA, avrasm2 compatible - https://sourceforge.net/projects/avra/
            apt-get install avra


« Last Edit: December 18, 2018, 11:39:13 am by bingo600 »
 
The following users thanked this post: cdev

Offline cdev

  • Super Contributor
  • ***
  • Posts: 5082
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #156 on: December 15, 2018, 06:25:28 pm »
It should get better the longer you leave it on. See if you can move it outward so it has a better sky view. Also if you are using a patch antenna, try putting a larger ground plane underneath it in the center. (don't tilt the ground plane but be aware that if you are in the northern hemisphere most sats will be to the south and vice versa if you are in the Southern hemisphere more will be to the north) I often use a failed CD or DVD as a ground plane, that should be the minimum size you use. A bigger piece of metal is even better.

Right when I said that my GPSDO is rock solid, it lost the lock after more than a month. Foggy morning, my GPS antenna is in my basement's window, I can only blame it on the GPS.
"What the large print giveth, the small print taketh away."
 

Offline texaspyro

  • Super Contributor
  • ***
  • Posts: 1296
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #157 on: December 15, 2018, 08:25:41 pm »
Pizza pan to the rescue!
 

Offline metrologist

  • Super Contributor
  • ***
  • Posts: 1786
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #158 on: December 18, 2018, 07:42:35 pm »
I was going to ask why is the 1V ADC range used? It seems you could use a 280 ohm resistor after the diode and have less noise on the higher range? But then I see how non-linear the charge curve is and you only get to use ~80% of the higher range anyway.

My new build did not work and I was having a hard time triggering on the ADC signal due to the noise and low signal level. I was able to get a good capture when triggering on the 1pps instead and discovered I had miswired the phase detector reset pin!

Here is a timelab plot with TC=4. Now I have set TC=400 but I think I can go much higher.

I'll build two of these with different oscillators and GPS. Still need to add a temp sensor and determine if I want to replace the divider pot with a couple precision resistors. Then I'll pack the box with fiberglass insulation.

« Last Edit: December 18, 2018, 07:45:06 pm by metrologist »
 

Offline cdev

  • Super Contributor
  • ***
  • Posts: 5082
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #159 on: December 18, 2018, 10:37:39 pm »
Pizza pan to the rescue!

I'm ashamed to show what I use because it has this weird paint on it that is coming off that looks just horrible, but suffice it to say it was literally saved out of the garbage- its not perfectly flat, its an old pot lid with a shallow depression on the curvilinear top for its long ago lost handle just large enough for a typical GPS patch antenna. Unfortunately its made out of aluminum. So I have to figure out other ways to keep GPS antennas in place, or rely on gravity.

Its totally unscientific why I use it. I have no evidence that putting the gps in the depression would reduce multipath like a choke ring. It might even make it worse.

But it seems to work well as a ground plane.

"What the large print giveth, the small print taketh away."
 

Offline metrologist

  • Super Contributor
  • ***
  • Posts: 1786
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #160 on: December 18, 2018, 10:45:16 pm »
I use an old circular saw blade.
 

Offline metrologist

  • Super Contributor
  • ***
  • Posts: 1786
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #161 on: December 19, 2018, 03:45:54 pm »
I plot the self-reported ns, dac, and diff-ns for t=24h to t= 48h, right after I set tc=400.
 

Offline imo

  • Super Contributor
  • ***
  • Posts: 1763
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #162 on: December 19, 2018, 05:23:38 pm »
I was going to ask why is the 1V ADC range used?
Because there is 1.1V Vref inside the atmega328.
 

Offline metrologist

  • Super Contributor
  • ***
  • Posts: 1786
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #163 on: December 19, 2018, 05:58:07 pm »
Wouldn't it be better though if you could use the full 5V ADC range with a well regulated 5V supply? It seems the application is just for relative measurements where more resolution/less noise is a benefit.
 

Offline imo

  • Super Contributor
  • ***
  • Posts: 1763
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #164 on: December 19, 2018, 06:20:53 pm »
The default 1ns/1LSB resolution is given by the RC of the pulse integrator (1000ns/1V) and the ADC resolution (1000 levels off the 1024 used) at Vref=1.1V.

You may try to decrease the tau=RC five times and use 5V Vcc as the ADC_Vref.

PS: ..or, you may try with 100ns/5Volt and the internal 10bits ADC. That gives you 100ps/LSB. Not sure what else would be impacted in the sw.

Mind with lower C you will get larger drop on the C because the leakages and dynamic parasitic capacitancies (ie the schottky diode and the ADC input), thus the non-linearity will be much higher.
Also with 5V Vcc at the 4046 the theoretical Vmax at the C will be around 4.6V only.

PPS: it may help to add a fet-input opamp as the ADC buffer.. And a fet switch for the C discharge, of course :)
« Last Edit: December 19, 2018, 07:03:35 pm by imo »
 
The following users thanked this post: cdev

Offline metrologist

  • Super Contributor
  • ***
  • Posts: 1786
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #165 on: December 19, 2018, 07:07:44 pm »
Yeah, more would be needed. It looks ugly.
 

Offline imo

  • Super Contributor
  • ***
  • Posts: 1763
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #166 on: December 19, 2018, 08:52:11 pm »
This works fine :)
« Last Edit: December 19, 2018, 09:16:25 pm by imo »
 

Offline metrologist

  • Super Contributor
  • ***
  • Posts: 1786
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #167 on: December 19, 2018, 11:07:06 pm »
It looks beautiful, but wouldn't that overload the 4046? That's why I used a 250 ohm resistor.
 

Offline imo

  • Super Contributor
  • ***
  • Posts: 1763
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #168 on: December 19, 2018, 11:12:36 pm »
It will not work with 4046 (its phase_comparator_3 output is a voltage source).
You need a current source, feeding the diode. And the current source must be switched on/off by the 4046 (or an other faster phase comp). And all must be pretty fast.
The 100M is the input of a fet-opamp buffer put in front of the ADC.
You also need a switch for discharging the C after the ADC conversion.
« Last Edit: December 19, 2018, 11:32:15 pm by imo »
 

Offline metrologist

  • Super Contributor
  • ***
  • Posts: 1786
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #169 on: December 20, 2018, 03:12:41 pm »
Couldn't you just put an op-amp before the diode? I recall Lars acknowledging similar designs that used a current source here and with the full ADC range, and whether there was really any advantage. He seemed to have a similar tone about using a hardware DAC as well. I should review those designs that he referenced.

What I am seeing in my circuit now is a 10 ns oscillation on an approximate 50 seconds cycle,  and I'm trying to understand what it could mean. I would suspect PPS jitter, but the UCCM reference I'm using should be very good.
 

Offline imo

  • Super Contributor
  • ***
  • Posts: 1763
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #170 on: December 20, 2018, 09:17:06 pm »
Try to decrease the ocxo's gain.
 

Offline texaspyro

  • Super Contributor
  • ***
  • Posts: 1296
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #171 on: December 20, 2018, 09:25:44 pm »
One PID tuning technique is to set the D and I terms to 0.   Then crank up the P term until it starts oscillating.  Next increase D until it stops.   Finally, mess with I until your brain leaks out your nose.
 

Offline metrologist

  • Super Contributor
  • ***
  • Posts: 1786
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #172 on: December 21, 2018, 12:38:40 am »
My last plot shows the dac in red trace - it is not changing over periods of 30 mins or maybe more. The dac does track/correct longer term drifts. What could oscillate with such a long period (50s)? I am powering this from a linear supply into a 7805 regulator.
« Last Edit: December 21, 2018, 12:41:39 am by metrologist »
 

Offline Miti

  • Frequent Contributor
  • **
  • Posts: 451
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #173 on: December 21, 2018, 02:43:59 am »
My last plot shows the dac in red trace - it is not changing over periods of 30 mins or maybe more. The dac does track/correct longer term drifts. What could oscillate with such a long period (50s)? I am powering this from a linear supply into a 7805 regulator.

Assuming your blue trace is diff_ns, I see a similar behavior but with a different period and I think it is normal. The way the PPS is generated, if I understand correctly, from a clock that in case of Ublox is 48MHz, the CPU selects the best 48 millionth (+/- 1) or so edge to trigger the PPS. If your GPS's clock is so close to, let's say, 48MHz and the same (48th millionth) edge is the best for awhile, it will select that same edge, that drifts slowly however, to trigger the PPS pulse. Until one point when the 48th million and 1 is the best edge , and at that point you see the jump.
Or maybe your GPS has a VCXO and it keeps adjusting the clock.
That big spark at power up was by design!
 

Offline metrologist

  • Super Contributor
  • ***
  • Posts: 1786
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #174 on: December 21, 2018, 01:31:46 pm »
The blue trace is ns. The green is diff_ns.

I could suspect the GPS/PPS if its jitter was expected to be around 25ns. Someone had posted their Trimble UCCM GPSDO measurements were much better (2ns?). Which edge is more likely to be moving?
 

Offline imo

  • Super Contributor
  • ***
  • Posts: 1763
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #175 on: December 21, 2018, 03:01:50 pm »
I saw the oscillation in my design when the PI params were off (I doubt you can even use D). It is not only about PID params but about the sampling period "T" as well (it is related). With lower P/Is the oscillation period was longer. I spent a month with it. Tried PI, PII, PIID. After a lot of brain had leaked off my nose I switched to a simple "analog XOR PLL" :)
« Last Edit: December 21, 2018, 03:23:29 pm by imo »
 

Offline metrologist

  • Super Contributor
  • ***
  • Posts: 1786
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #176 on: December 21, 2018, 07:01:35 pm »
If the dac is not changing, then how can the (my) oscillation be related to the loop?

I will build a second unit to compare, but I'm not sure if I should build a copy and clock both with the same PPS signal or build with a different GPS and OCXO? If I build a copy and the oscillation is due to PPS jitter, then that would be mirrored and be in phase on both units. If it is a characteristic of the osc., then they will be similar but out of phase and amplitude, etc. If is a defect of the one osc., then the second may not oscillate. I'd prefer to build with different components, though.
 

Offline cdev

  • Super Contributor
  • ***
  • Posts: 5082
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #177 on: December 21, 2018, 08:03:46 pm »
All GPSs that don't attempt to reduce the TP jitter with sawtooth correction must I suspect show rate changes (a lot) within a range of (n) ns in each direction or more.

A UCCM GPSDO's PPS output is a tamed beast compared to a non-timing GPS's especially. Whether the PPS is coming at the right instant the second changes is a function of how accurately its adjusted, because the cable length and I am sure many other things (ionospheric conditions, whether its in stationary mode...and the position its got for its location is accurate- more?) also need to be taken into account.

With sawtooth error the period between peaks in the error changes, a lot, so does the shape of the sawtooth and which direction it slopes, in a recognizably characteristic way.
« Last Edit: December 21, 2018, 08:09:38 pm by cdev »
"What the large print giveth, the small print taketh away."
 

Offline jpb

  • Super Contributor
  • ***
  • Posts: 1621
  • Country: gb
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #178 on: December 21, 2018, 10:27:44 pm »
All GPSs that don't attempt to reduce the TP jitter with sawtooth correction must I suspect show rate changes (a lot) within a range of (n) ns in each direction or more.

A UCCM GPSDO's PPS output is a tamed beast compared to a non-timing GPS's especially. Whether the PPS is coming at the right instant the second changes is a function of how accurately its adjusted, because the cable length and I am sure many other things (ionospheric conditions, whether its in stationary mode...and the position its got for its location is accurate- more?) also need to be taken into account.

With sawtooth error the period between peaks in the error changes, a lot, so does the shape of the sawtooth and which direction it slopes, in a recognizably characteristic way.
My understanding is that over a long enough time period such correction doesn't matter, so how important it is depends on the loop time constant of the GPSDO. I don't have the reference to hand, but most plots of GPS 1PPS ADEV converge to roughly the same slope with averaging time.
 

Offline Satbeginner

  • Regular Contributor
  • *
  • Posts: 130
  • Country: es
  • Dutch, early retired, living in Spain
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #179 on: December 22, 2018, 09:52:16 am »
Hi all,

I just finished putting it all in a box.
It works fine, and with the box it is even a bit more stable, I think because of the OCXO temperature being more stable.

I used two 6-channel 74HC14 as buffer for the outputs, I used three parallel inputs for the 1pps, three for the 10MHz, three for the 5MHz and three for the 1MHz I got from the 390 at pin 6 because of the better 60/40 duty-cycle there.
Each output has a 150 Ohm series resistor, every time I combined the three outputs as one, giving it an appr. 50 Ohm output resistance.

Here it is:

https://photos.app.goo.gl/DimgdLnNpAfeRTiu6

Un saludo,

Leo
You need a scope to repair a scope, and you need many multimeters to repair another multimeter!
*Tek 2465B, Tek 2465B, Tek 485, Keithley 175A, Keithley 2000's, HP 3468B, HP 3457A, HP 34401A, PM 6671, PM 5716, Fluke 45, Fluke 75, Fluke 77, Fluke 79, AFX 9660BL, KPS 605D, etc. *
 

Offline Miti

  • Frequent Contributor
  • **
  • Posts: 451
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #180 on: December 22, 2018, 01:16:21 pm »
This is what I see on the TIC.

My GPS is set ti timing mode and I only allow maximum 2 satellites at a time. I see big jumps when it changes satellites.
« Last Edit: December 22, 2018, 01:18:10 pm by Miti »
That big spark at power up was by design!
 

Offline cdev

  • Super Contributor
  • ***
  • Posts: 5082
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #181 on: December 22, 2018, 01:23:51 pm »
1 is the classic sawtooth pattern, that is what I've seen again and again in the literature.

Guessing - 1 is the GPS jitter measured against a good OXCO or already made GPSDO or rubidium?

What is 2?
« Last Edit: December 22, 2018, 01:30:13 pm by cdev »
"What the large print giveth, the small print taketh away."
 

Offline metrologist

  • Super Contributor
  • ***
  • Posts: 1786
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #182 on: December 22, 2018, 02:47:36 pm »
cdev, 2 is a wider view, you can see the same jump in left side.
 

Offline cdev

  • Super Contributor
  • ***
  • Posts: 5082
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #183 on: December 22, 2018, 03:50:11 pm »
cdev, 2 is a wider view, you can see the same jump in left side.

And indeed, there it is!

All GPSs that don't attempt to reduce the TP jitter with sawtooth correction must I suspect show rate changes (a lot) within a range of (n) ns in each direction or more.

A UCCM GPSDO's PPS output is a tamed beast compared to a non-timing GPS's especially. Whether the PPS is coming at the right instant the second changes is a function of how accurately its adjusted, because the cable length and I am sure many other things (ionospheric conditions, whether its in stationary mode...and the position its got for its location is accurate- more?) also need to be taken into account.

With sawtooth error the period between peaks in the error changes, a lot, so does the shape of the sawtooth and which direction it slopes, in a recognizably characteristic way.
My understanding is that over a long enough time period such correction doesn't matter, so how important it is depends on the loop time constant of the GPSDO. I don't have the reference to hand, but most plots of GPS 1PPS ADEV converge to roughly the same slope with averaging time.

I think you're right as long as you are just looking for a frequency standard and don't need to know the (really!) 'exact' time which seems to be a technically daunting problem when you get into the nanosecond range so people shouldn't feel bad about that. It varies depending on things like your altitude too, because of relativity!
« Last Edit: December 22, 2018, 03:52:27 pm by cdev »
"What the large print giveth, the small print taketh away."
 

Offline edpalmer42

  • Super Contributor
  • ***
  • Posts: 1623
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #184 on: December 22, 2018, 04:40:42 pm »
This is what I see on the TIC.

My GPS is set ti timing mode and I only allow maximum 2 satellites at a time. I see big jumps when it changes satellites.

Why do you limit the number of satellites?  Typically, you want as many satellites as possible.  The receiver then averages them and rejects the outliers.  This gives a more stable result and minimizes any jumps when a satellite enters or leaves the constellation.

Ed
 
The following users thanked this post: Miti

Offline cdev

  • Super Contributor
  • ***
  • Posts: 5082
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #185 on: December 22, 2018, 04:49:55 pm »
What you likely want, Miti, is to set an appropriate elevation or SN mask for your antenna location.

Launch a program that lets you visualize the orbits and signal strengths at relative points in the sky and note where the satellites are strongest, minus the bottom few degrees of elevation near the horizon. Pick a number for elevation mask that captures the strong signals and leaves out the weak ones.

Or pick a setting that excludes the marginal signals by strength.

Make sure your antenna is placed in the best possible location.
"What the large print giveth, the small print taketh away."
 

Offline Miti

  • Frequent Contributor
  • **
  • Posts: 451
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #186 on: December 22, 2018, 07:21:17 pm »
What you likely want, Miti, is to set an appropriate elevation or SN mask for your antenna location.

Launch a program that lets you visualize the orbits and signal strengths at relative points in the sky and note where the satellites are strongest, minus the bottom few degrees of elevation near the horizon. Pick a number for elevation mask that captures the strong signals and leaves out the weak ones.

Or pick a setting that excludes the marginal signals by strength.

Make sure your antenna is placed in the best possible location.

My Min SV Elevation is set to 10 deg. and the Min C/NO is set to 20dbHz.

Why do you limit the number of satellites?  Typically, you want as many satellites as possible.  The receiver then averages them and rejects the outliers.  This gives a more stable result and minimizes any jumps when a satellite enters or leaves the constellation.

Ed

I quote from the Ublox document "Timing_AppNote_(GPS.G6-X-11007).pdf", section 1.2.2:

"Single satellite navigation can be useful under poor GPS reception conditions. Time information can be heavily degraded due to multipath effects. To avoid such degradation choose an antenna that primarily receives satellites with high elevation angles. Using the UBX-CFG-NAV5 message, low elevation angle satellites can be ignored. Furthermore the number of satellites can be reduced using the UBX-CFG-NAVX5 message."

Edit: Are you sure it averages the satellites? It's very hard to find any information regarding the Ublox timing mode other than what I mentioned before. It would make sense but I don't know where you found that?
« Last Edit: December 22, 2018, 07:33:15 pm by Miti »
That big spark at power up was by design!
 

Offline cdev

  • Super Contributor
  • ***
  • Posts: 5082
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #187 on: December 22, 2018, 08:59:09 pm »
Are you sure that your antenna setup doesn't have some problem? How long is the antenna feedline?

If everything checks out, You might want to try a different antenna with higher gain LNA?

But, it sounds like you know what you're doing there, and the behavior you're seeing might be what might be seen with a inadequate antenna or very long (or thin) feedline. Or maybe water or some other problem with the feedline. Of course if its indoors that wouldn't apply. I'm sorry to ask all these questions. To explain, I've spent a lot of time fooling around with antennas over the years but still when I got my own GPSDO at the beginning I made some of the classic mistakes. It seems like its human nature. That said I cant think of what would be causing that. Noise maybe- Noise, power supply noise?

Thats a shot in the dark. U-center has some settings you can use to measure how much noise is being picked up.

If you have a patch antenna, (not a QFH, some of the timing antennas - like my own, are QFHs) how is the ground plane under your antenna, is there a flat metal horizontal ground plane underneath the patch part?
« Last Edit: December 22, 2018, 09:04:38 pm by cdev »
"What the large print giveth, the small print taketh away."
 

Offline Miti

  • Frequent Contributor
  • **
  • Posts: 451
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #188 on: December 23, 2018, 12:08:49 am »
But, it sounds like you know what you're doing there...

Appearance may be deceiving  :-DD

cdev,

I don't have any major problem with my GPSDO, I was just showing metrologist what my TIC looks like. Lars seems to have done a very good job.
One minor issue is that with the number of satellites restricted to 2, I see some jumps (in the order of 10 to 40 ns, I think it depends if it is clear or cloudy) when it uses some satellites. Ed said that I should enable maximum number of satellites but I'm not sure about that. At least the only documentation that I found about the timing mode of Ublox modules contradicts that, if I read it correctly.
Anyway, my antenna is a small patch one, in the basement window, partially covered by a tree. :palm:
Still, I'm getting very decent levels, one sided though.
That big spark at power up was by design!
 

Offline cdev

  • Super Contributor
  • ***
  • Posts: 5082
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #189 on: December 23, 2018, 02:10:55 am »
If I were you I would try to use Lady heather or U-center to determine a good elevation mask, not restrict the # of SVs, and just work with that. Also try to get a better sky view. Here is an idea. Can you put your antenna inside some plastic object that protects it from lawnmowers in the middle of your lawn, on the ground. The ground plane is meant to be in a situation like that, there is much less of a reason to put the antenna up high with a patch antenna than say with VHF as the signals you want come from above not the horizon.

Arguably the best place is on a good ground plane. Can you - just for the sake of knowing, put it in some waterproof enclosure (double plastic bags would be good) and then put it on a flat piece of metal a bit out on your lawn. If you hadn't done it before that might be interesting. My GPSDO had markedly better performance (with the antenna there (in the middle of an open lawn) than anywhere indoors or under the eaves.
"What the large print giveth, the small print taketh away."
 

Offline Miti

  • Frequent Contributor
  • **
  • Posts: 451
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #190 on: December 23, 2018, 02:31:11 am »
I think Ed is right. I changed the maximum SV # to 25 but I kept the S/N and elevation restriction. That's after the red line. Looks much better, eh?

Edit: The graph is the TIC.
« Last Edit: December 23, 2018, 02:51:41 am by Miti »
That big spark at power up was by design!
 

Offline edpalmer42

  • Super Contributor
  • ***
  • Posts: 1623
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #191 on: December 23, 2018, 07:18:20 am »
What you likely want, Miti, is to set an appropriate elevation or SN mask for your antenna location.

Launch a program that lets you visualize the orbits and signal strengths at relative points in the sky and note where the satellites are strongest, minus the bottom few degrees of elevation near the horizon. Pick a number for elevation mask that captures the strong signals and leaves out the weak ones.

Or pick a setting that excludes the marginal signals by strength.

Make sure your antenna is placed in the best possible location.

My Min SV Elevation is set to 10 deg. and the Min C/NO is set to 20dbHz.

If Lady Heather supports your GPSDO, you can use the SAE command to see at what elevation the signal strength starts to drop off.  By setting the elevation mask slightly above this elevation, you'll reject a lot of marginal, multipath, and otherwise distorted signals.

Quote
Why do you limit the number of satellites?  Typically, you want as many satellites as possible.  The receiver then averages them and rejects the outliers.  This gives a more stable result and minimizes any jumps when a satellite enters or leaves the constellation.

Ed

I quote from the Ublox document "Timing_AppNote_(GPS.G6-X-11007).pdf", section 1.2.2:

"Single satellite navigation can be useful under poor GPS reception conditions. Time information can be heavily degraded due to multipath effects. To avoid such degradation choose an antenna that primarily receives satellites with high elevation angles. Using the UBX-CFG-NAV5 message, low elevation angle satellites can be ignored. Furthermore the number of satellites can be reduced using the UBX-CFG-NAVX5 message."

Boy, some awkward wording here.  'Navigation' for a timing receiver??  Anyway, yes, you can do single satellite timing once you've done a survey to figure out where you are.  But as soon as that satellite goes out of sight, you're screwed.  Single satellite operation is a very limited form of operation that is only useful under very specific circumstances.  The same comments would apply to running with a reduced number of satellites.  I don't know where that would make sense.

Quote
Edit: Are you sure it averages the satellites? It's very hard to find any information regarding the Ublox timing mode other than what I mentioned before. It would make sense but I don't know where you found that?

The magic acronym is RAIM (Receiver Autonomous Integrity Monitoring) - often called TRAIM for Timing Receiver....  Timing receivers have it, navigation ones don't.  Since the timing receiver doesn't have to recalculate position every second, it has lots of spare cycles to improve the quality of the timing outputs.  The inner workings might be different for every company, but basically, the receiver picks the best satellites and tosses the rest.  'Averaging' might not be the correct word mathematically, but that's the effect.  I'm not familiar with the M8T, but there might be a command to show you which satellites are used in the timing solution.  The answer could change from second to second or minute to minute.

The M8T data sheet says in section 1.8.4  Timing integrity and availability:

Code: [Select]
Fix redundancy (RAIM)
The receiver automatically and continually adjusts the significance of individual signal measurements in the
reported estimate of time according to its quality and consistency. This ensures that the integrity of the
reported time is protected from individual faulty signals or measurements so long as there are more signals
in use than the minimum required. The minimum number changes depending on the situation but
whenever it is exceeded “raim active” is set in message TIM-TP to indicate that this protection is active.

Doing a quick browse through the datasheet, I saw a section on the Survey-In process.  Although there isn't a lot of detail, it looks like it's a necessary step to achieve a stable output.

Ed
 

Offline Miti

  • Frequent Contributor
  • **
  • Posts: 451
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #192 on: December 23, 2018, 03:26:52 pm »
I did a Survey-In and the GPS is in Fixed mode. Unfortunately, after few days of Survey-In running, I couldn't get a position accuracy better than 16m, probably due to the position of antenna that only sees the west side of the sky.

Lady Heather does something weird to my GPS modules, it reduces the sensitivity dramatically. The signal level drops significantly and I have to do a restore to default to see them coming back to normal. It must send some funny messages.
That big spark at power up was by design!
 

Offline cdev

  • Super Contributor
  • ***
  • Posts: 5082
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #193 on: December 23, 2018, 03:29:25 pm »
You're not using the M8T sawtooth correction, right? (Since Lars' GPSDO doesn't utilize it.)

Previously you posted that you use the "UBX-CFG-NAV5" message - the implication seems to me to be that that message automatically sets the elevation mask in some way. Usually that wouldn't leave you with only a few satellites but if more than half of the sky was already blocked, sure, I could see you ending up with only a few.

The Skytraq/Navspark units are significantly more sensitive than the Ublox GPSs. maybe in your situation you would do better with one of them. They are so sensitive that for me, they work indoors without needing to be near a window at all.
« Last Edit: December 23, 2018, 04:08:11 pm by cdev »
"What the large print giveth, the small print taketh away."
 

Offline Miti

  • Frequent Contributor
  • **
  • Posts: 451
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #194 on: December 23, 2018, 07:39:12 pm »
I don't know how to use that correction. Can you point to a document that details that?

Previously you posted that you use the "UBX-CFG-NAV5" message - the implication seems to me to be that that message automatically sets the elevation mask in some way. Usually that wouldn't leave you with only a few satellites but if more than half of the sky was already blocked, sure, I could see you ending up with only a few.

I don't know what you mean by that. Take a look at the NAV5 configuration. You set the elevation, it doesn't set it automatically.
The number of satellite and the signal level is pretty good considering the antenna is in the window and I technically, visually, only see half of the sky. The U-Center seems to contradict that though.
Anyway, I'm not changing anything in my setup, it's good enough for what I need it for (a reasonably accurate and stable 10MHz reference), I'm just trying to understand how I can make the best out of it and understand more about the GPS gibberish documentation.
If you can point to a glossary of terms for GPS that would be very appreciated.
That big spark at power up was by design!
 

Offline Miti

  • Frequent Contributor
  • **
  • Posts: 451
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #195 on: December 23, 2018, 11:20:56 pm »
I'm worried about Lars!

I hope and pray he's OK and I wish him, and everybody on this forum, a Merry Christmas, full of hope, health and peace!
That big spark at power up was by design!
 
The following users thanked this post: cdev, 9aplus

Offline mycroft

  • Contributor
  • Posts: 44
  • Country: br
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #196 on: December 23, 2018, 11:24:49 pm »
His last post was one week ago at https://blog.liw.fi/.
 

Offline cdev

  • Super Contributor
  • ***
  • Posts: 5082
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #197 on: December 23, 2018, 11:30:58 pm »
Ublox has a book sized PDF document, their GPS compendium, do you have that?

Since you have a ublox GPS the chances of their using the same terminology is fairly good, often the same word or thing has different definitions depending on who is using it.

Its free.

To be honest with you Although I have one working ublox GPS and like their software, I'm far less familiar with it than I would like to be and have a bunch of other things that are a higher priority for me right now than that. That said, their software is quite good and the combination of it and their hardware is really educational. If you really want to dig around in their protocol there is another program called Comms Champion that speaks it - even the non-sanctioned parts of it.

I don't know how to use that correction. Can you point to a document that details that?

Previously you posted that you use the "UBX-CFG-NAV5" message - the implication seems to me to be that that message automatically sets the elevation mask in some way. Usually that wouldn't leave you with only a few satellites but if more than half of the sky was already blocked, sure, I could see you ending up with only a few.

I don't know what you mean by that. Take a look at the NAV5 configuration. You set the elevation, it doesn't set it automatically.
The number of satellite and the signal level is pretty good considering the antenna is in the window and I technically, visually, only see half of the sky. The U-Center seems to contradict that though.
Anyway, I'm not changing anything in my setup, it's good enough for what I need it for (a reasonably accurate and stable 10MHz reference), I'm just trying to understand how I can make the best out of it and understand more about the GPS gibberish documentation.
If you can point to a glossary of terms for GPS that would be very appreciated.
"What the large print giveth, the small print taketh away."
 

Offline Miti

  • Frequent Contributor
  • **
  • Posts: 451
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #198 on: December 23, 2018, 11:32:35 pm »
His last post was one week ago at https://blog.liw.fi/.

I don't think he is the same Lars. He is Lars Walenius, while the one in the link is Lars Wirzenius.
That big spark at power up was by design!
 
The following users thanked this post: cdev, Jacon

Offline Miti

  • Frequent Contributor
  • **
  • Posts: 451
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #199 on: December 23, 2018, 11:42:04 pm »
Ublox has a book sized PDF document, their GPS compendium, do you have that?

Since you have a ublox GPS the chances of their using the same terminology is fairly good, often the same word or thing has different definitions depending on who is using it.

Its free.

Thanks! I didn't know about this book. It is exactly what I needed.
That big spark at power up was by design!
 

Offline metrologist

  • Super Contributor
  • ***
  • Posts: 1786
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #200 on: December 29, 2018, 02:44:14 pm »
Thank you, Miti, for posting, and I am with your thoughts on Lars.

I've had some setbacks. First, my Jupiter GPS module fails to start. I played around for a day with it and at the end I reversed polarity the power and it got warm. I bought this GPS many years ago just to make a GPSDO. Then one of my UCCM GPSDO modules died. This is similar to the bg7tbl but by another. I'm not sure if just the 6V buck converter died or something on his interface board or the UCCM module. Another thread...

So, I dug out a Lassen GPS for the PPS. What's the best way to deal with the PPS here - I don't think there is anything in the gps to set? It keeps lock at TC=160. The sawtooth period started out around 3 seconds and seems to have increased to ~13 seconds. It's not supposed to swing that far, should be within 100ns. I'm also running a timelapse video of the two 10MHz signals on a scope, to see the wander and drift.

30X, 82mins:
« Last Edit: December 30, 2018, 12:26:50 pm by metrologist »
 

Offline Miti

  • Frequent Contributor
  • **
  • Posts: 451
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #201 on: December 31, 2018, 12:30:42 am »
Looking at your video, I doubt you have a lock there. I have a Ublox GPS set to output 10MHz and I connected both, the GPSDO and the GPS, to the oscilloscope. They are pretty much locked as you see in the picture for weeks. You can see the expected jitter of about 20 ns but the two signals don't drift more than +/- 10 ns from what you see in the picture and always come back into alignment. The drift is so slow, it takes minutes or tens of minutes to go 10ns left or right and to come back. They never drift one full period.
That big spark at power up was by design!
 

Offline edpalmer42

  • Super Contributor
  • ***
  • Posts: 1623
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #202 on: December 31, 2018, 01:55:26 am »
To me, it looks like it's locked but there's noise on the oscillator's EFC line.  The noise could be coming from the power supply or the PLL circuitry.  The frequency excursions are so small that you might not be able to see or measure the noise.

If it wasn't locked, I'd expect the frequency difference to be larger and the drift would be in one direction rather than the back-and-forth that occurs.  You can see the square wave tends to drift towards the right, but occasionally pulls back to the left to try and maintain the phase difference between the two.

Ed
 

Offline imo

  • Super Contributor
  • ***
  • Posts: 1763
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #203 on: December 31, 2018, 08:51:38 am »
Also doublecheck the atmega's Vcc decoupling. The noise at its 5V Vcc directly affects the EFC.
https://www.eevblog.com/forum/projects/lars-diy-gpsdo-with-arduino-and-1ns-resolution-tic/msg1933384/#msg1933384
« Last Edit: December 31, 2018, 08:54:27 am by imo »
 

Offline metrologist

  • Super Contributor
  • ***
  • Posts: 1786
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #204 on: December 31, 2018, 02:04:20 pm »
There may be EFC noise, but that is nothing we can see here. I am looking at the dac swings. I don't really know yet how the time constant is factored. I sort of expected the calculation to occur as some kind of average over the duration, but I see a new dac value every tic so I suspect a running average.

For fun, I just cranked the TC to 6000 and increased damping. The phase would then drift about 180 deg over an hour and the dac would cycle through 3 values as the sawtooth resets.
 

Offline pepermint

  • Newbie
  • Posts: 1
  • Country: pl
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #205 on: December 31, 2018, 04:44:04 pm »
Hello for a few days testing versions of mini gpsdo. Very fast stabilizes OCXO.
,

Thanks to Lars for a very good project.

I wish you all happy and prosperous New Year

best regards

73 Marek SP4ELF
 
The following users thanked this post: Satbeginner

Offline Miti

  • Frequent Contributor
  • **
  • Posts: 451
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #206 on: January 01, 2019, 12:25:24 am »
There may be EFC noise, but that is nothing we can see here. I am looking at the dac swings. I don't really know yet how the time constant is factored. I sort of expected the calculation to occur as some kind of average over the duration, but I see a new dac value every tic so I suspect a running average.

For fun, I just cranked the TC to 6000 and increased damping. The phase would then drift about 180 deg over an hour and the dac would cycle through 3 values as the sawtooth resets.

Metrologist,

If you see a different DAC every second, you're not locked. Once it locks, it is stable over longer or shorter periods of time, depending on the TC and the stability of your OCXO. Take a look at mine below. Can you post a screen shot?
That big spark at power up was by design!
 

Offline metrologist

  • Super Contributor
  • ***
  • Posts: 1786
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #207 on: January 01, 2019, 03:07:58 pm »
Miti, the red trace in the earlier plot shows the dac setting. I'm just playing around with this very lousy GPS. The sawtooth correction is over 200ns. I can get lock with lower TC, but the frequency wanders all around following that PPS - you can see it bouncing in the video. It would be better to average more tics and I was trying with very long TC to accomplish that, but then no lock. I need to spend some time with the code and maybe make some modifications.

« Last Edit: January 01, 2019, 03:14:37 pm by metrologist »
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1360
  • Country: dk
 

Offline jpb

  • Super Contributor
  • ***
  • Posts: 1621
  • Country: gb
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #209 on: January 03, 2019, 04:51:20 pm »
Sad news  :'(  :'(
https://www.eevblog.com/forum/metrology/farewell-to-our-friend-lars/

/Bingo
Yes, very sad. Lars was so helpful even when he was very unwell and undergoing treatment he still took the time to give detailed responses to technical questions.
 
The following users thanked this post: cdev

Offline cdev

  • Super Contributor
  • ***
  • Posts: 5082
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #210 on: January 04, 2019, 12:49:47 am »
I think the biggest favor we could do for Lars is learn from his design and postings and refine his GPSDO/TIC design while keeping it affordable to all.

It would be great to see more of the principles of accurate measurement incorporated into the body of knowledge that technically literate people learn to be so.

I know things like measuring where lightning strikes by time of arrival using GPS timing, seeing how all the pieces fit together to make some amazing accomplishment happen would make a lot of kids eyes light up.

The really cynical discussion going on in another thread has been making me think just how much we all need that for our sanity. It really is important not just to have dreams, but to actually realize them.

Knowledge and the scientific process is a magical thing and a principle that not only makes life interesting, it also will carry somebody through a lot of hard times.
"What the large print giveth, the small print taketh away."
 

Offline Squiddaddy

  • Regular Contributor
  • *
  • Posts: 78
  • Country: us
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #211 on: January 04, 2019, 01:51:12 am »
I had recently gathered up the parts to start building his gpsdo. I will make the effort to complete it.
RIP, and thanks for sharing your knowledge.
 
The following users thanked this post: Marco1971

Offline PT_Dreamer

  • Contributor
  • Posts: 34
  • Country: pt
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #212 on: January 07, 2019, 12:05:14 am »
Can anyone help me please?

I have been trying to tune my GPSDO, but I'm having some issues.

I started by limiting the OCXO frequency span with some resistors to the point where with "h1" I get an average of 57 for diff_ns and with "h65535" an average of -83. I think this makes the VCO range 140ppb so I set the gain to 465 (≈65536/140).
With this gain and default time constant I get a lock with no issues.
I then tried to tune the time constant. For that I set the time constant to 4 and ran timelab for frequency difference as DAC *2.142E-12 .
This is what I got for MDEV:
 

According to the documentation I thought that the TC should be where the graph inflects from descent to crescent, so it should be about 1000 on the graph above.
Issue is that I can't get a log with TC's bigger than 300. What am I doing wrong?

Also about the linearization parameters I have read the documentation again and again but I just don't get it, I'm supposed to change the TIC offset to 1000 and then?

Any help? Thanks!

P.S.-Just read that Lars passed away, my condolences to the family and friends.
 

Offline metrologist

  • Super Contributor
  • ***
  • Posts: 1786
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #213 on: January 07, 2019, 04:10:46 pm »
Which GPS are you using and do you know the PPS jitter? Also, can you post some of your log data when locked at TC=300?
 

Offline Miti

  • Frequent Contributor
  • **
  • Posts: 451
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #214 on: January 07, 2019, 08:52:13 pm »
Leave the offset at 500. Try going from low to high with the TC. Set it to 200 and let it lock. After few hours go to 300 and so on. Do you have temperature sensors installed? Is the temperature compensation enabled?  Post a screen shot after you send "f2". Keep in mind that higher the TC, longer the lock time is. For TC=500 for example, lock time is more than 41 min from the moment TIC is less than 100. The way you calculate the lock time is TC*5 in seconds.
That big spark at power up was by design!
 

Offline PT_Dreamer

  • Contributor
  • Posts: 34
  • Country: pt
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #215 on: January 07, 2019, 10:56:29 pm »
Which GPS are you using and do you know the PPS jitter? Also, can you post some of your log data when locked at TC=300?
Hi,
I'm using a NEO6Q bases board designed by a project I was part of in the past. Have a 7M arriving on the slow boat from China. No idea about the 1pps jitter, I can try looking at it with the scope.
Since posting I realized I had TempCoeff set to 4 (I'm not using a temp sensor), must have happened when setting TC to 4. After setting it to zero I think things improved a bit. I can get a lock with TC=450 and it maintains the lock. If I then change it to 500 the lock is maintained for a few hours but then breaks.
I attach one of this experiments, I start with TC=450 and get a lock, then at time 18581 I change TC to 500, the lock breaks at time 35507  (about 5 hours later) and recovers at  time 38021 (so after about TCx5). Then the lock is lost again at time 40389, a bit after I change the TC back to 450 and never loose lock again.

Leave the offset at 500. Try going from low to high with the TC. Set it to 200 and let it lock. After few hours go to 300 and so on. Do you have temperature sensors installed? Is the temperature compensation enabled?  Post a screen shot after you send "f2". Keep in mind that higher the TC, longer the lock time is. For TC=500 for example, lock time is more than 41 min from the moment TIC is less than 100. The way you calculate the lock time is TC*5 in seconds.
No temperature sensors, reading trough the documentation I thought I wasn't supposed to use one when using an ocxo.

f2 taken from the attached doc:
Code: [Select]
Gain    465 Damping 3.00 TimeConst 500 FilterDiv 2 TIC_Offset 500
TempRef 280 TempCoeff 0 TICmin  12.0 TICmax  1012 Square comp 0.100
Warm up time 300 LockPPScounter 9582 MissedPPS 1 TimeSinceMissedPPS  10552
ID_Number  0 Restarts  40 Total hours 288

So even if things are better I'm still far from the ideal TC=1000 which I thought was what the previous MDEV I posted indicated, right?
Also I'm still lost when it comes to setting the linearization parameters.

Thank you both for your help!

José

P.S- File was too big to attach here so I saved it to google drive
https://drive.google.com/open?id=0B8279AP3EkuyNnl0aWhWdFJsQ1lpdzJGdmczZ3BfeG1tczg4
 

Offline Miti

  • Frequent Contributor
  • **
  • Posts: 451
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #216 on: January 08, 2019, 04:29:03 am »
According to Lars, your TC should be indeed 1000 but is seems extremely good to me. What OCXO do you use? Is the GPSDO enclosed or flapping in the breeze? A high TC makes it very slow to keep up with the temperature changes. That could be the reason why it goes in and out of lock.
I use temperature sensors in my GPSDO with OCXO and it makes a big difference. My GPSDO is enclosed and it stays locked with TC=500, that is my optimum TC, see page 4 for my MDEV.
« Last Edit: January 08, 2019, 04:33:40 am by Miti »
That big spark at power up was by design!
 

Offline metrologist

  • Super Contributor
  • ***
  • Posts: 1786
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #217 on: January 08, 2019, 03:12:15 pm »
I was also going to ask which OCXO. The tune range is limited to 140; I checked the NEO6Q PPS spec is <60ns 99%. I suspected that with a high enough TC, the tune response is too slow to chase that PPS - that is why I was interested in seeing some of the log file. Your PPS looks mostly within its 30ns spec.

I noticed that both times before NoLock, the tic value continued to increase until just over 100ns where lock was lost. Miti may be on track with applying temp compensation as something was causing an upward drift that looks like it just overran the dac.

Did you enable tic's extra digit for timelab and did you remove linearization errors from the resulting plot?
 
The following users thanked this post: jhaab

Offline PT_Dreamer

  • Contributor
  • Posts: 34
  • Country: pt
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #218 on: January 09, 2019, 10:32:00 pm »
According to Lars, your TC should be indeed 1000 but is seems extremely good to me. What OCXO do you use? Is the GPSDO enclosed or flapping in the breeze? A high TC makes it very slow to keep up with the temperature changes. That could be the reason why it goes in and out of lock.
I use temperature sensors in my GPSDO with OCXO and it makes a big difference. My GPSDO is enclosed and it stays locked with TC=500, that is my optimum TC, see page 4 for my MDEV.

Hi,

I'm using an isotemp MOD:OCXO143-141 from ebay. The GPSDO is inside an enclosure but kind of ghetto style (I attached a photo of the setup).
Currently the only issue I see is that I have it very close to a window because with the present GPS module I need to place the antenna in the middle of the garden to get a steady signal and I was out of coax to make a bigger extension, and the nights have been very cold lately.
I have mounted an NTC now and I'm logging some data to tune the coeff.
Should I mount the NTC in contact with the OCXO, close to it, or in the middle of the enclosure?

I was also going to ask which OCXO. The tune range is limited to 140; I checked the NEO6Q PPS spec is <60ns 99%. I suspected that with a high enough TC, the tune response is too slow to chase that PPS - that is why I was interested in seeing some of the log file. Your PPS looks mostly within its 30ns spec.

I noticed that both times before NoLock, the tic value continued to increase until just over 100ns where lock was lost. Miti may be on track with applying temp compensation as something was causing an upward drift that looks like it just overran the dac.

Did you enable tic's extra digit for timelab and did you remove linearization errors from the resulting plot?
I didn't enable the extra digit, I thought it only affected the time error column which I didn't use with timelab (I used the DAC). How do I remove the linearization errors from the plot?

Thank you for the help!

José
 

Offline imo

  • Super Contributor
  • ***
  • Posts: 1763
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #219 on: January 09, 2019, 10:37:54 pm »
TimeLab->Edit->Subtract global linear...
 

Offline Miti

  • Frequent Contributor
  • **
  • Posts: 451
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #220 on: January 09, 2019, 11:49:53 pm »
I'm using an isotemp MOD:OCXO143-141 from ebay. The GPSDO is inside an enclosure but kind of ghetto style (I attached a photo of the setup).
Currently the only issue I see is that I have it very close to a window because with the present GPS module I need to place the antenna in the middle of the garden to get a steady signal and I was out of coax to make a bigger extension, and the nights have been very cold lately.
I have mounted an NTC now and I'm logging some data to tune the coeff.
Should I mount the NTC in contact with the OCXO, close to it, or in the middle of the enclosure?


I didn't play with that particular OCXO but my Bliley NV47A1282 can only go to TC=600. It has a hard time locking with TC=500 though, I normally lock it with TC=400 and after few hours I change it to TC=500 and is stays locked if I don't turn the box upside down. I didn't go above TC=500.
I use two LM35 sensors, the one in column 4 (that's used for compensation) is siliconed to the OCXO, the one in column 11 is just an indicator, somewhere in the middle of the enclosure.
There's a post above from Lars in response to my question on how to calculate the TempCoeff, take a look . The TempRef is the average raw reading from the sensor in your lab over about a day or so.
And close the enclosure. It's essential for high TC.
That big spark at power up was by design!
 

Offline texaspyro

  • Super Contributor
  • ***
  • Posts: 1296
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #221 on: January 09, 2019, 11:59:25 pm »
Try using an Oscilloquartz 8663 DOCXO.  I have found them to be virtually immune to room temperarure changes.  Also, once they settle in (may take a few weeks) they tend to have very low drift rates.
 

Offline Miti

  • Frequent Contributor
  • **
  • Posts: 451
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #222 on: January 10, 2019, 12:46:22 am »
Try using an Oscilloquartz 8663 DOCXO.  I have found them to be virtually immune to room temperarure changes.  Also, once they settle in (may take a few weeks) they tend to have very low drift rates.

I don't doubt it is an amazing OCXO but in this case I think it would complicate things. 12V supply, 0 - 10V VC. The schematic would need some upgrades.
« Last Edit: January 10, 2019, 12:50:56 am by Miti »
That big spark at power up was by design!
 

Offline texaspyro

  • Super Contributor
  • ***
  • Posts: 1296
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #223 on: January 10, 2019, 01:09:54 am »
12V in,  LM7805 for the electronics.   My 8663's tend to be on freq at around 4V in.   The 8663 does have a Vref output (around 7V).   You could switch a FET buffer powered by Vref driven by the Arduino PWM. 
 

Offline Miti

  • Frequent Contributor
  • **
  • Posts: 451
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #224 on: January 10, 2019, 02:01:06 am »
12V in,  LM7805 for the electronics.   My 8663's tend to be on freq at around 4V in.   The 8663 does have a Vref output (around 7V).   You could switch a FET buffer powered by Vref driven by the Arduino PWM.

In the datasheet, VRef is specified at RLoad>20KOhm, source resistance is 1KOhm, you'd need to buffer it for stability.
Look, I'm not saying it's not doable, don't get me wrong. All I'm saying is that it is not trivial, it would need some thinking and some testing... and that could be fun, I can't wait to see some results.
The result, however, may be pretty close to adding a temperature sensor to Isotemp or Bliley and finding the right TempCoeff.

Cheers
That big spark at power up was by design!
 

Offline metrologist

  • Super Contributor
  • ***
  • Posts: 1786
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #225 on: January 10, 2019, 07:48:45 pm »
I lost lock! Shortly after changing time constant from 180 to 240. Then there was an oscillation between lock and no lock. Every lock showed a steep downward trend until lock was lost. I guess this is just the OCXO out running the dac here. Something else might have changed too because I was having trouble getting lock again at time constant of 120. This is with the Condor GPS. I can't understand why the dac has gone so far to keep it in range.

green 100 = lock
red = tuning dac
blue = phase offset (ns)

Edit: It ran locked for 19 hours and then broke out into the same oscillation as shown here, so something seems to be happening. I set to hold mode to run for the day and I'll see what the oscillator does. I'm going to build a second one with slightly different layout and I'll use precision resistor divider on the efc rather than a trimpot.
« Last Edit: January 11, 2019, 05:10:23 pm by metrologist »
 

Offline Miti

  • Frequent Contributor
  • **
  • Posts: 451
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #226 on: January 12, 2019, 02:59:08 pm »
My GPSDO was loosing lock every time I connected or disconnected the FTDI serial cable to the PC. I tried one time to figure out where is that coming from but I didn't find an obvious reason. So instead of wasting more time chasing a ground loop or something else on a thing that otherwise works really well , I added a Bluetooth module. Now I can connect from anywhere in the house without disturbing the loop.
So far stable for at least 12 hours with TC=500.
 
That big spark at power up was by design!
 

Offline cdev

  • Super Contributor
  • ***
  • Posts: 5082
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #227 on: January 12, 2019, 03:03:37 pm »
Is there a full list of different OCXOs people have tried and their findings with them?

If not, there should be along with their typical costs on the used market.
"What the large print giveth, the small print taketh away."
 

Offline metrologist

  • Super Contributor
  • ***
  • Posts: 1786
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #228 on: January 15, 2019, 05:07:48 pm »
I have 6-1/2 days of data with this CTI xtal - all daily plots on same scale and range except day 1 and 4.
Below are the latest 6 days with day 0.5 starting on the bottom and with higher TC (240). You can see it losing lock regularly. It was a little colder and the dac range was a little higher out of view.
Day 2 is better with TC 180, yet still struggling over long time periods.
Day 3 started in hold mode to observe xtal, then lower TC settings were used (~60-120). I could have picked a lower dac value.
Days 4-6 show a pattern that correlates. The plot center is mid-afternoon when it will be the warmest. It has been raining the last couple days and it's warmer with more stable temperature.
The top plot is all 6-1/2 days.
It looks like temperature effects and I suspect it may be more a result from the other components than the xtal. I do not yet have a thermistor installed so should check into that.

For contrast, I have added an almost 2-day plot of the same circuit, but with a lassen GPS. The plot range is opened up at least 2x. The PPS spec is 25ns for the condor and 100ns for the lassen.

BLUE is the ns value - typically ±50ns, over 100ns loses lock soon
RED is the dac value - typically range from 31100 to 30900 when locked

I will emphasize that when I was using the Trimble UCCM PPS signal, which I suspect my unit generates from its OCXO, the ns and dac was much more stable, with dac changes happening over periods of 10's of minutes rather that every few seconds with the more jittery GPS's.
« Last Edit: January 16, 2019, 04:47:06 pm by metrologist »
 

Offline Miti

  • Frequent Contributor
  • **
  • Posts: 451
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #229 on: January 16, 2019, 04:55:58 am »
What is blue, what is red?
That big spark at power up was by design!
 

Offline metrologist

  • Super Contributor
  • ***
  • Posts: 1786
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #230 on: January 16, 2019, 05:05:39 pm »
I edited my post, Miti.

And, here is the same circuit with about half a day run in UCCM PPS and TC=400. It looks marvelous to me. It ran two days and lost lock only once (recovered after 5xTC). So, the only thing changed from the silky smooth of below and the noisy mess of above is the quality of the PPS. (you have to look at the ns scale of ±40ns vs ±150ns and dac range of 10 vs 200!)

I think software can improve that with some knowledge of the PPS characteristics. I read here that Lars does not use sawtooth correction, for example. I think it would be beneficial to average more samples before feeding the value to the loop calculation. I'm not good enough with the coding though...
« Last Edit: January 16, 2019, 05:07:56 pm by metrologist »
 

Offline Miti

  • Frequent Contributor
  • **
  • Posts: 451
  • Country: ca
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #231 on: January 17, 2019, 02:13:52 am »
I've attached mine with TC=600, about 9 hours, Excel cannot take more than 32000 values I think.
Bottom blue is TIC, red is DAC, top is the temperature. What a perfect mirror, DAC with the OCXO temperature.
That big spark at power up was by design!
 

Offline metrologist

  • Super Contributor
  • ***
  • Posts: 1786
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #232 on: January 17, 2019, 03:36:21 pm »
I think xlsx files can handle 1,048,576 rows. It really starts to get slow at half a million records though... I'm undecided on what to do, so I put the UCCM PPS back on it with TC=200. Yesterday I let it run without PPS and it stayed within 100mHz the entire day (worst 9,999,999.904Hz). I need to add tempco as it may do more for me than it did for Lars.
 

Offline metrologist

  • Super Contributor
  • ***
  • Posts: 1786
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #233 on: January 22, 2019, 12:23:47 am »
I went back to my breadboard and installed a picdiv 10M->1Hz to generate the PPS, so the OCXO generates the PPS as well. I expected this would show the noise of the circuit in ns. Here is a plot with TC=20, TC=4, hold mode, and TC=4. Red is dac and blue is ns. If that is noise, that is a lot more than I expected. Also, the jumps may be because I removed several missing PPS or 10M? lines...
« Last Edit: January 22, 2019, 12:25:27 am by metrologist »
 

Offline imo

  • Super Contributor
  • ***
  • Posts: 1763
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #234 on: January 22, 2019, 11:11:29 am »
Your noise is 50ns_pp/6.6=7.6ns_rms. That is not bad..

The Lars' design uses rather simple hw for the phase measurement. Its performance could be heavily influenced by the construction.

MCU is noisy, its internal ADC could be with +/-2 LSB noise with good wiring (+/-2ns), the integrator is not linear and the readout depends on capacitor quality (ie. DA).

Another ADC error source could be from a jitter coming from the none-uniform start of the ADC's conversion (S/H moment) after the integration stops.

Also there is none highZ ADC buffer thus the reading might be influenced by the ADC's input currents.

Also the schottky diode has rather high reverse current, in hundreds nA range (and Temp dependent).

And 4046 is also not an ideal phase comparator (dead time etc).

I've been using the TI's TDC7200 digital time interpolator in my design, which claims 55ps resolution with 35ps stddev (my start/stop pulses are coming from an FPGA) and I get 150ps_rms (that is 1ns_pp) when lucky with my wiring (breadboard style).

« Last Edit: January 22, 2019, 01:07:05 pm by imo »
 

Offline metrologist

  • Super Contributor
  • ***
  • Posts: 1786
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #235 on: January 22, 2019, 04:17:10 pm »
Thanks for the explanation (ESR, DF and Q are all aspects of the performance of a capacitor...DA? oh, that DA https://www.eevblog.com/forum/beginners/fake-polypropylene-capacitors-from-china/?topicseen). I can measure the critical caps, but they are old electrolytics and a very poor choice here. I wonder also if the loop could be oscillating due to the way I have the feedback, and also due to I'm using pre-made (longish) breadboard wires. I'm thinking of using a second OCXO to generate the PPS and compare.
« Last Edit: January 22, 2019, 04:22:29 pm by metrologist »
 

Offline imo

  • Super Contributor
  • ***
  • Posts: 1763
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #236 on: January 22, 2019, 04:28:47 pm »
DA with the capacitor in the "integrator" could be a critical parameter. You do not use an electrolytic capacitor there, I bet.
 

Offline cdev

  • Super Contributor
  • ***
  • Posts: 5082
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #237 on: January 22, 2019, 05:01:54 pm »
If you take a couple of photos of it - maybe some issue might be non-obvious but amenable to multiple minds working on the problem, and a process of elimination?

Breadboard wires vary as far as making a reliable connection. I wouldn't think they would be so reliable in many timing applications. maybe you could use redundant double breadboard wires where the connection is critical to the timing, the chance of a glitch might be much reduced if it took a simultaneous glitch on two separate wires at exactly the same time to equal a glitch for the GPSDO?

Thanks for the explanation (ESR, DF and Q are all aspects of the performance of a capacitor...DA? oh, that DA https://www.eevblog.com/forum/beginners/fake-polypropylene-capacitors-from-china/?topicseen). I can measure the critical caps, but they are old electrolytics and a very poor choice here. I wonder also if the loop could be oscillating due to the way I have the feedback, and also due to I'm using pre-made (longish) breadboard wires. I'm thinking of using a second OCXO to generate the PPS and compare.
« Last Edit: January 22, 2019, 05:13:20 pm by cdev »
"What the large print giveth, the small print taketh away."
 

Offline imo

  • Super Contributor
  • ***
  • Posts: 1763
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #238 on: January 22, 2019, 05:54:34 pm »
A simple "self test" would be to divide the 10kHz 10MHz (coming from the OCXO 100divider's output) to 1PPS (ie by PICDIV version doing /10000) and feed the gadget with those signals.
The ns readings should be all equal with no jitter (ideally).
You do not need an another OCXO for this experiment.
« Last Edit: January 22, 2019, 11:32:13 pm by imo »
 

Offline metrologist

  • Super Contributor
  • ***
  • Posts: 1786
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #239 on: January 22, 2019, 09:08:36 pm »
imo, how is that different than what I did? Except my OCXO does not have a divider, so I just use the picdiv to divide the 10M output.

I'm not sure if I am really troubleshooting a problem with this self fed loop other than there seems to be much more noise than I was expecting (~5ns pp). There are many good explanations for what I'm seeing, but...

... when I clocked this with UCCM PPS there seemed to be much less noise. That is why I wondered if there is a loop oscillation being driven by the feedback and some instigator.
 

Offline imo

  • Super Contributor
  • ***
  • Posts: 1763
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #240 on: January 22, 2019, 10:37:48 pm »
imo, how is that different than what I did? Except my OCXO does not have a divider, so I just use the picdiv to divide the 10M output.
Sure, it could be done that way too..
Try the self test and you will get a feel what comes from GPS and what from your board.
 

Offline metrologist

  • Super Contributor
  • ***
  • Posts: 1786
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #241 on: January 22, 2019, 11:13:07 pm »
Self test?
 

Offline imo

  • Super Contributor
  • ***
  • Posts: 1763
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #242 on: January 22, 2019, 11:30:13 pm »
The "self test" means you feed the 1PPS and 10MHz inputs of Lars' board from the same Oscillator source (it must may not be the OCXO, a simple canned osc is ok).

That way the phase diff of the edges (in "ns") should be constant and with smallest jitter (may be with none jitter).
 
If not, there is a problem with something on the board.

Another test: you may try to invert/invert/invert... (different taps) the 10MHz clock before entering the 390' dividers. That way you move the phase diff (in "ns") towards the upper end of the ADC. You should see different "ns" numbers for the specific taps, but always constant.

OSC-------------------------->INPUT 10MHz
        |
        ------->PICDIV--------> INPUT 1PPS


OSC-------->74HC04------->INPUT 10MHz
        |
        ------->PICDIV--------> INPUT 1PPS

PS: sorry I will fix my above post for clarity, the 10kHz I referred to was a wrong number.
« Last Edit: January 23, 2019, 08:59:07 am by imo »
 

Offline metrologist

  • Super Contributor
  • ***
  • Posts: 1786
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #243 on: January 23, 2019, 04:17:56 am »
I thought that is what I was basically doing, but I do not understand why the OCXO cannot be used?
 

Offline imo

  • Super Contributor
  • ***
  • Posts: 1763
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #244 on: January 23, 2019, 08:43:49 am »
What are your results with the test then?
 

Offline metrologist

  • Super Contributor
  • ***
  • Posts: 1786
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #245 on: January 23, 2019, 04:34:59 pm »
What are your results with the test then?

Reply #233? I tried another oscillator but it has an AC sine wave and that would not drive the picdiv directly. I put that aside for now and...

I added NTC to the circuit - except I have to do it funny because I had 100k NTC. I used two of them in parallel (5V -- NTCs - ADC2 - 1k1 -- GND). That seems to keep the voltage under 1.1V at high temperatures (100C). So I'll be operating in the lower/less linear area of the response curve. (I'm not seeing cheap 10k NTC - they are all dressed up for Arduino with flowers and butterflies and cost $10 a piece).
ADC2 bounces around 241 to 246 and did not move much at all overnight, but there was a clear rise in dac from turn-on.
I set a Tempcomp of -1. I was confused on the calculation and what's the purpose of the TempRef, and I do not know if it's compensating the correct direction.

I lined up the time scales in the plots as I had more temp data from turnon. I did not bother to plot efc dac and ns values during warmup and unlock. The glitches in the temp data result from me changing sensor types and display of dac, C or F values.

Now, if I compare my ns value driving with picdiv pps in reply 223 with my ns value driving with a (supposedly more jittery) GPS PPS, I get confused.