EEVblog Electronics Community Forum

Electronics => Projects, Designs, and Technical Stuff => Topic started by: lars on August 11, 2017, 09:18:19 pm

Title: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: lars 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
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: lars on August 11, 2017, 09:19:50 pm
Pages 8-18 of instruction
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: lars on August 11, 2017, 09:23:18 pm
Last pages 19-21

Lars
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Gyro 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: jpb 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: edpalmer42 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
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: jpb 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: jpb 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.)
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Gyro 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/ (https://www.pdfmerge.com/)

You can then manage the odd/even printing as you normally do.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: retrolefty 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

 
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Gyro 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.  ;)
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: pigrew 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: cdev 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..   
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: pigrew 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: texaspyro 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...   
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: metrologist 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 (http://www.unitechelectronics.com/MC4044P_PLL.pdf)
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Gyro 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: retrolefty 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.    :-+
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: metrologist 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: pigrew 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?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: metrologist 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?).
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: albert22 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 (http://n1.taur.dk/gpsdo2a.pdf)

Thanks for sharing all your data
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: metrologist 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: jpb 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: metrologist 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 (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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: lars 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 (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 (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
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: lars 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 (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
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: lars 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
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: lars 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 (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 (https://www.febo.com/pipermail/time-nuts/2017-November/107608.html)

Lars
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Qw3rtzuiop 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: lars 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
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: lars 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-tc/)   
http://www.leapsecond.com/pages/tbolt-8d/ (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
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Bryan 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
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: t1d 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
https://www.youtube.com/watch?v=lbns-FvpzK4 (https://www.youtube.com/watch?v=lbns-FvpzK4)
Also at his website.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: lars 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
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: texaspyro 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Bryan 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Bryan 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: texaspyro 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 (https://www.buerklin.com/en/gnss-module-und-gps-module/p/64s3196)

The GT-8736 is the module on a breakout board.   
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Bryan 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 (https://www.digikey.ca/products/en/rf-if-and-rfid/rf-receivers/870?k=furuno)
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: jpb 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 (https://www.cnssys.com/files/M12+UsersGuide.pdf)

Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: texaspyro 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 (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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Bryan 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: texaspyro 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti 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?".
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: lars 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
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: lars 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



 

Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: metrologist 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: 9aplus on October 03, 2018, 06:13:16 pm
Can someone draw&post here, full schematic of Lars GPSDO solution, please?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: metrologist 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: lars 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

Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: lars 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.


Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti 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 (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 (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?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: metrologist 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: 9aplus 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 (https://www.eevblog.com/forum/metrology/lady-heather-v6-beta-for-windows-exe/msg1434005/#msg1434005)
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: metrologist 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. :-+
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: texaspyro 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: metrologist on October 05, 2018, 12:38:26 am
Thanks! I didn't know LH could utilize and extra input.  :-+
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: texaspyro 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)

Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti 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?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: texaspyro 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: metrologist 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

Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: metrologist 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
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo 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..)??
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on October 16, 2018, 01:57:16 pm
Here's my Allan deviation after one day, t=100.
ADEV of what?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: metrologist 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)?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: lars 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

Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti on October 17, 2018, 01:15:37 am
Yes, it is indeed the DAC.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo 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  (https://www.eevblog.com/forum/metrology/how-to-test-a-diy-counter-with-gpsdo/)..
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: cdev 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?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: lars 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  (https://www.eevblog.com/forum/metrology/how-to-test-a-diy-counter-with-gpsdo/)..

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
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: lars 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
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti 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
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: metrologist 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?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti on October 18, 2018, 10:32:39 pm
The second column is TIC. There's a sudden jump from 6.9 to -88.8.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on October 19, 2018, 09:09:02 am
In the 3.png (the second column) you may see a repeating pattern 6 samples long..
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: lars 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: lars 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


Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti 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
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: metrologist 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: metrologist 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: lars 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
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: lars 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
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: lars 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
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: cdev 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?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: metrologist 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti 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?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: metrologist 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
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo 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.. :)
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: metrologist 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?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: metrologist 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: metrologist 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?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: lars 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











Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: lars 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

Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: lars 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


Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti 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
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo 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..

Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo 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.

Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: hamster_nz 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...
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: cdev 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...
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo 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..
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Bryan 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/ (https://www.eevblog.com/forum/projects/a-look-at-my-symmetricom-gpsdo-(ocxo-furuno-receiver)/975/)
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti 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?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti 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!
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: cdev 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.

Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: PT_Dreamer 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é
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo 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).

Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: texaspyro 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: PT_Dreamer 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!
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Satbeginner 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
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: cdev 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti 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?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: cdev 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.


Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: texaspyro 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: cdev 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: texaspyro 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.

Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: cdev 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: texaspyro 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: JTDolan 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...
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: cdev 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?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: metrologist 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti on December 07, 2018, 11:16:36 pm
Anybody heard anything from Lars lately? I hope he's OK.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: cdev 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 (http://lists.febo.com/pipermail/time-nuts_lists.febo.com/2018-September/094020.html)
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Satbeginner 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

Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo 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..
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Satbeginner 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
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Satbeginner 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
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on December 10, 2018, 04:25:29 pm
You may see similar periodicity in Miti's results here (https://www.eevblog.com/forum/projects/lars-diy-gpsdo-with-arduino-and-1ns-resolution-tic/msg1901951/#msg1901951). It may come from NEO7M.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Satbeginner 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
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: cdev 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/picdiv.htm)

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

http://leapsecond.com/pic/picpet2.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
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: bingo600 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/picdiv.htm)

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

http://leapsecond.com/pic/picpet2.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 (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 (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 (http://www.mikrocontroller.net/attachment/26295/AVR2.zip)

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


Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: cdev 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: texaspyro on December 15, 2018, 08:25:41 pm
Pizza pan to the rescue!
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: metrologist 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.

Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: cdev 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.

Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: metrologist on December 18, 2018, 10:45:16 pm
I use an old circular saw blade.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: metrologist 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: metrologist 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo 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 :)
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: metrologist on December 19, 2018, 07:07:44 pm
Yeah, more would be needed. It looks ugly.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on December 19, 2018, 08:52:11 pm
This works fine :)
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: metrologist 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: metrologist 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on December 20, 2018, 09:17:06 pm
Try to decrease the ocxo's gain.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: texaspyro 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: metrologist 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: metrologist 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?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo 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" :)
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: metrologist 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: cdev 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: jpb 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Satbeginner 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 (https://photos.app.goo.gl/DimgdLnNpAfeRTiu6)

Un saludo,

Leo
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: cdev 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?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: metrologist on December 22, 2018, 02:47:36 pm
cdev, 2 is a wider view, you can see the same jump in left side.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: cdev 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!
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: edpalmer42 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
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: cdev 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti 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?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: cdev 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?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: cdev 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: edpalmer42 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
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: cdev 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti 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!
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: mycroft on December 23, 2018, 11:24:49 pm
His last post was one week ago at https://blog.liw.fi/ (https://blog.liw.fi/).
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: cdev 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti on December 23, 2018, 11:32:35 pm
His last post was one week ago at https://blog.liw.fi/ (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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: metrologist 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:
https://www.youtube.com/watch?v=7PoQDyLP_Cw (https://www.youtube.com/watch?v=7PoQDyLP_Cw)
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: edpalmer42 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
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo 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 (https://www.eevblog.com/forum/projects/lars-diy-gpsdo-with-arduino-and-1ns-resolution-tic/msg1933384/#msg1933384)
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: metrologist 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: pepermint on December 31, 2018, 04:44:04 pm
Hello for a few days testing versions of mini gpsdo. Very fast stabilizes OCXO.
(http://www.jo72.pl/kkm/gpsdo/1546033515401.jpeg),(http://www.jo72.pl/kkm/gpsdo/1546033412675.jpeg)(http://www.jo72.pl/kkm/gpsdo/1546033412764.jpeg)

Thanks to Lars for a very good project.

I wish you all happy and prosperous New Year

best regards

73 Marek SP4ELF
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti 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?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: metrologist 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.

Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: bingo600 on January 03, 2019, 01:26:28 pm
Sad news  :'(  :'(
https://www.eevblog.com/forum/metrology/farewell-to-our-friend-lars/ (https://www.eevblog.com/forum/metrology/farewell-to-our-friend-lars/)

/Bingo
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: jpb on January 03, 2019, 04:51:20 pm
Sad news  :'(  :'(
https://www.eevblog.com/forum/metrology/farewell-to-our-friend-lars/ (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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: cdev 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Squiddaddy 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: PT_Dreamer 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:
 (https://imgur.com/zVVpETIb.png)

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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: metrologist 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?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: PT_Dreamer 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 (https://drive.google.com/open?id=0B8279AP3EkuyNnl0aWhWdFJsQ1lpdzJGdmczZ3BfeG1tczg4)
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: metrologist 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?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: PT_Dreamer 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é
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on January 09, 2019, 10:37:54 pm
TimeLab->Edit->Subtract global linear...
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: texaspyro 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: texaspyro 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. 
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti 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
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: metrologist 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti 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.
 
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: cdev 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: metrologist 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti on January 16, 2019, 04:55:58 am
What is blue, what is red?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: metrologist 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...
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: metrologist 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: metrologist 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...
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo 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).

Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: metrologist 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 (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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: cdev 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 (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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: metrologist 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: metrologist on January 22, 2019, 11:13:07 pm
Self test?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: metrologist 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?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on January 23, 2019, 08:43:49 am
What are your results with the test then?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: metrologist 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.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Remco on March 25, 2019, 08:08:45 pm
It has been quite quiet here last weeks . . .

Accidently I came across this forum in my search for a simple Arduino based
TIC GPSDO and read the full thread about three times to try to get 'sound and vision'
with the design/concept and experiences of others.

Today I built the circuit using a Bliley NV47A1282 (same as Miti) and with some fiddling
I got a lock earlier this afternoon. But it seems it's not a lOck but lUck ; -)

I suffer from (too much) 'Missing 10 MHz?' frames and seek some guidance.

From what I understood (from this thread and looking in the source code) this
'Missing 10 MHz?' coincides with a full ADC (1023), (meaning?) the pulse is too long (?)

I use R = 4.02k, C = 1 nF and decharge R = 6.6 MOhms (2 x 3.3 M in series)

To prevent myself burning precious time, should I lower the 4.02k value?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti on March 26, 2019, 01:53:20 am
I suffer from (too much) 'Missing 10 MHz?' frames and seek some guidance.

From what I understood (from this thread and looking in the source code) this
'Missing 10 MHz?' coincides with a full ADC (1023), (meaning?) the pulse is too long (?)

I use R = 4.02k, C = 1 nF and decharge R = 6.6 MOhms (2 x 3.3 M in series)

To prevent myself burning precious time, should I lower the 4.02k value?

Use the recommended parts and check your ground. I had the same problem and I had to redo my ground and to move the RC close to Arduino. Very close.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Remco on March 26, 2019, 12:03:48 pm
Thanks for the prompt reply Miti!

Indeed, my 'analog wire' apparently was too long (and therefore noisy?).

To make connections as short as possible I selected A7 as sample port,
soldered the components on the Arduino board (see picture below, I use a BAT86 diode)
and routed an extra GND wire from Arduino GND to HC4046 GND (pin8).

The result is flabbergastingly different in a positive sense!
Until this moment of writing it never missed a beat.

Edit some hours later: it still hasn't :)

In run mode the DAC value converged and clamped to 0 (zero), so I had to
to lower the minimal voltage at the VFC pin and used 100k parallel too.

Edit: changed the resistor to 51k1 (so that DAC value appears ~31000 when in lock)

Now with h1 and h65535 the difference in diff_ns was around 600, so my gain is 65536/600 = 110.

Edit:with 51k1 resistor h1 = 996 mV, h65535 = 2200 mV --> Δ diff_ns = 490 --> gain = 134, I took 128.

Letting it run, the contraption locked within 10 minutes  :)

Edit: in warm condition (with 51k1 parallel to VFC) within 130 seconds.


Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Theboel on March 28, 2019, 11:50:45 pm
Hi All,

I understand Lars as the designer of this GPSDO has pass away some times ago but I think some one can help me to understand something about this design.

using 1MHz and 1PPS as input for TIC how to calculated the TIC resolution ?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti on March 29, 2019, 01:23:15 am
That is explained by Lars very nicely in "What is Lars Arduino based GPSDO Controller page 1-7.pdf", check the first post.
I've also attached a very interesting document to read.

Miti
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Remco on March 29, 2019, 02:59:37 pm
Reading the patent 'diagonally' it seems to be (almost) the same principle
as in Lars' GPSDO?

BTW. I cleaned / simplified some of Lars' code and am now busy with an
algorithm to let the time constant (TC) converge to it's optimal (= maximal?)
value after a lock has been obtained (locking/starting with a lower TC).

Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: metrologist on March 30, 2019, 02:48:49 pm
I think there is a much earlier patent on the very concept.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti on March 30, 2019, 05:00:03 pm
BTW. I cleaned / simplified some of Lars' code and am now busy with an
algorithm to let the time constant (TC) converge to it's optimal (= maximal?)
value after a lock has been obtained (locking/starting with a lower TC).

Does it calculate the optimum TC or just "converges" to a max value that you determine and program into it?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Remco on March 31, 2019, 01:14:07 pm
From what I understand from Lars' philosophy is that the TC is a figure of merit
concerning the quality/stability of the system. In my words, the larger the TC
(where the system stays in lock) the better.

So what I now do, is start with a low TC and periodically (depending on the TC itself)
increase the TC (also depending on the TC itself and the stability of the system given this TC).
Now I use kind of exponential approach .. i.e. lower TC's will be increased less compared to large(r) TC's.

When the system starts to drift away 'too much' (i.e. TC seems too large) the TC
is lowered. The idea is to let the TC 'lock' (like a PLL) to its optimal (= maximal?) value
for a given system/setup and to figure out what 'too much' is.

Also plan to experiment with making the gain relative to the TC. Found out that while in lock
I can reach larger TC's by increasing the gain.
In the current run gain is fixed to 4x the 'h1-h65535' determined gain (which was 135, I took 128 so it's 512 now).

(Intermediate) results are that my system (not T-compensated) can reach TC 1024 (and
even higher, but I clamped it to 1024 cf Lars' comments), stays in
lock for several hours but then ... looses lock. So my challenge is to find a condition
to prevent lock loss.




Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Remco on March 31, 2019, 05:35:54 pm
I use temperature sensors in my GPSDO with OCXO and it makes a big difference.

Yep, just discovered the reason for this. A2 is floating and sampling A2 is almost the same as sampling noise ; -)

In the (current) sketch A2 readings are default taken into account to calculate the DAC value, as a result this
DAC value has intrinsic noise.

Solution for this issue:

1. Add temp compensation
2. Connect A2 to ground
3. Fixate A2 readings (which I did for the time being, LM35's have been ordered ; -)


Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Remco on April 02, 2019, 02:46:38 pm
When the system starts to drift away 'too much' (i.e. TC seems too large) the TC
is lowered. The idea is to let the TC 'lock' (like a PLL) to its optimal (= maximal?) value
for a given system/setup and to figure out what 'too much' is.

OK, after some experimenting with the following conditions:

- 'open contraption' (not in a casing yet & OCXO = Bliley)
- fixed ADC reading (and therefore ...)
- no temperature compensation

The GPSDO is ca. 15cm away from my computer mouse.
When I'm behind the computer, the TC varies around 250 +- 80
(depending on my coffee mug with fresh coffee ; -).

When away the TC varies around 500 +- 100.

It didn't loose lock (yet) and I think I found a criterion to
forecast/prevent an upcoming 'out of lock' situation.

Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Johnny B Good on April 04, 2019, 04:56:08 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.

 I realise this is just over four months late but I felt impelled to give that statement about sensitivity some context. I've already read the whole of this thread two or three weeks earlier and was reading it again to refresh my memory since it's been so revealing a discussion on the subject of DIYing a GPSDO. There are still several points I only have a vague grasp on but I'm hoping to learn more by osmosis.

 About two months back, I got a sudden and desperate urge to create an accurate 10MHz reference to substitute for the currently un-receivable WWV broadcasts I'd previously used nearly three decades ago as a calibration source so landed up buying a cheap u_Blox NEO M8N based Arduino/Rpi module which I could use immediately to provide a 10MHz calibration signal. As a substitute for the WWV 10MHz broadcasts, it's a vast improvement in spite of the jitter from dividing a 48MHz TCXO down to 10MHz (the least of the issues with disciplining an XO) and the varying ticks as it adjusts the PPS to stay synchronised to GPS (UTC) time by skipping/adding one full 20.8333ns clock period.

 Such a polluted 10MHz signal whilst unusable as an external oscillator reference for comms and test gear, more than adequately serves as a calibration reference by which to trim internal clock oscillators. In my naivety, I'd assumed that the 48MHz TCXO in the u-blox module was simply being continually adjusted to hold it exactly on frequency, only to eventually figure out the horrible truth of the matter by careful comparison with a cheap AWG driven by a 0.1ppm TCXO that could keep the drift down to one or two ppb per half hour or so (stable enough to observe what was actually happening to the PPS when programmed to a jitter free 8MHz), using the signal generator to trigger the 'scope to reveal the jumps in phase of the 8MHz PPS signal.

 Such corrective jumps can be heard as individual pulses on an HF radio tuned to the fundamental in NBFM mode and also on the third harmonic at 24MHz where these pulses are then three times the amplitude. Setting the PPS to 100KHz and listening to the 99th harmonic seems to produce a click amplitude similar to the 8MHz PPS signal as one might expect. However, the level of the click modulation disappears into the noise when listening to the 100KHz PPS frequency itself.

 Prior to that discovery, I'd had high hopes of being able to clean up the PPS signal using a 3N502 clock multiplier chip to multiply the 4MHz PPS to a nice clean, jitter free 10MHz. However, that random dropping/adding of a clock pulse to correct in a method that parodies the "Leap Second" UTC correction mechanism every 5th of a second to every ten seconds or longer, rather put paid to that scheme. The result being that I do now see the point of all this extra complexity of an add on VCOCXO with startling clarity.  :-[ The truth of the matter is that the starting point of any GPSDO should be the VCOCXO with the GPS module and associated paraphernalia as the "After market add-on".

 Anyhow, that explains my interest in this thread but to get back to the observations made regarding GPS receiver sensitivity, I feel I should add my own observations just to provide the wider context. Whilst the M8N may not have been an optimum choice for a GPSDO project, it does appear to compare well against the old and once well regarded Navman Jupiter T's 10KHz jitter performance (as best as I can make out from the data sheet at any rate).

 That 20.8333ns jitter will always be present regardless of whatever frequency the PPS line has been programmed to emit. The benefit of choosing a lower frequency is that this jitter represents a much smaller phase modulation (75 milli degrees at 10KHz  versus 75 degrees at 10MHz). Whether this is any help towards reducing the effect of this "Leap Cycle" correction on the final PLL control signal, I'm not at all sure. TBH, any benefit is most likely simply going to be down to the longer time constant required with such a large division ratio in the PLL (the resulting 7.5 microdegree phase shifts on the 1Hz PPS seem to be just as big a problem). In short, it seems to me that it's this 20.8333ns random jitter that mandates long time constants in the PLL control driving the Vfc pin of the VCOCXO to filter out the effect of such phase jumps on the VCOCXO's output.

 All that aside, whilst I was discovering the reason for the module's attached patch antenna proving to be a mere ornamental adornment[1], I discovered that, after the patch-ectomy (and removal of the microscopic LNA chip), the module could still retain lock on half a dozen or more satellites for several minutes after disconnecting the external active antenna (or the original patch antenna I'd now re-purposed with a 15cm flylead for use as a plug in passive test antenna)

 Quite frankly, the module didn't need the help of a LNA chip to use the attached patch antenna. It seemed to manage remarkably well from what it could pick up on the 18mm's worth of strip-line between the SMA socket and the RF in pin whilst sat on my work bench some 16 feet away from the window. I suspect it might be just sensitive enough to acquire satellite lock given clear unobstructed sight of the sky but since it's raining right now, that experiment will have to wait a while.

 The rain abated and I connected it up to a usb battery bank, after programming it to display a 5Hz 25% pulse to show the unlocked state with a 100KHz 50% for the locked state, and took it outside to get an unobstructed sky view. It did re-acquire enough satellites to get a lock after losing lock in the transition from 1st floor 'office'/'workshop' into the fresh air of the outside world.

 After losing lock for several minutes whilst in the back kitchen, I was able to re-acquire lock each time I took it back outside, confirming that it could reliably receive satellites sans antenna connection without the use of a boost from an external antenna to get it to lock onto the signals as appears to be the case when indoors. Such are the vagaries of the SDR  technology employed to detect such weak satellite signals that it should need such a strong hint of the signals it should remain locked onto in this case.

 I'd previously observed it maintaining lock after disconnecting the antenna for ten minutes and longer before finally losing the signals completely, never to show even a hint ever again, or at least for maybe half an hour or more for even so much as a fleeting glimmer of signal. I had a sneaking suspicion that it was so close to the edge that direct sky exposure might well prove sufficient to allow it to acquire the signals without an antenna connection so it was rather gratifying to see such a positive result.  :)

[1] This failure of the built in patch antenna, which by all accounts (and despite its less than ideal location on the backside of the module) should have produced workable signals, remained a mystery for several weeks before I finally discovered that it was merely held in place by a single solder connection and an adhesive pad, allowing me to remove it undamaged and with only minor damage to the through plated hole on the board used for the feed pin connection which will never ever be used ever again.

 Lifting the patch antenna had finally revealed the true cause of its failure to provide anything other than fleeting signals, namely, several signal carrying traces within the ground-plane the antenna had been sat on. Little wonder it had totally failed to produce any useful signals. I can only suppose that this had once worked with previous versions of these modules with ground-planes devoid of any such signal traces and the manufacturer had simply overlooked this change and through inertia carried on fitting an antenna that was now doomed to certain failure by being grossly overloaded with RFI from those circuit traces.

 Manufacturers can be such idiots at times. In this case, the antenna (and the LNA chip) had become a complete waste of BOMs as well as a source of frustration to the end user, many of whom would be making RMA applications. Others, like myself who were planning on using an external active antenna anyway, would save themselves (and the vendor) the trouble of RMAing the module, especially after discovering that a 3/4 wave 14cm piece of wire plugged into the SMA socket would serve as an effective substitute for a patch antenna despite the presence of the LNA attached halfway down the strip-line connecting the socket to the RF In pin of the u-blox module burdening the external antenna socket with an unwanted shunt impedance.

 Removal of the microscopic LNA chip improved the performance of that 3/4 wave antenna. Strapping the patch antenna directly to the RF in line after the LNA-ectomy via a 4mm wire link failed to produce any signals but, after the patch antenna had been recovered from the board and a short co-ax fly lead soldered onto it to allow it to be reconnected via the antenna socket, it was able to give noticeably stronger signals than even the makeshift 3/4 wave antenna had given.
It may have been a useless adornment as supplied but, successfully divorced from the module, that patch antenna has now become  a rather handy passive test antenna.

JBG

Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: jimharman on April 05, 2019, 03:01:14 am
I have built an Arduino-based GPSDO with hardware and software based on Lars's design and have been been very pleased with the results, but I lack the equipment needed to properly characterize its performance. Following some discussion on the Time-nuts list, Bert Kehren offered to test it using his setup, which uses a cesium standard as its reference. It is currently warming up in his lab and he will be starting a 24-hour test run tomorrow. Here is Bert's initial report and some photos, results to follow.

-----
Recently Lars GPSDO came up on time nuts. I was working with Lars but we focused on other subjects. Never got around to test one. So when Jim Harman mentioned it I contacted him off list and offered to test his unit. He send me a picture of his unit. Oh boy but a promises is a promises. Encouraged him to stabilize it for shipping. Got it in the mail today. See attached picture. Had it up and running in 5 minutes. 5 minutes later 1 E -10. 10 minutes later 3 E-11. After an hour up and down in the E-12 range like all the other ones.
Will let it stabilize for 48 hours and do a 24 hour plot like we have done on all our other GPSDO's to better understand frequency over time due to ionosphere. Mainly due to the delay of ublox F9.
Jim can go in detail about his work with Lars

Bert
------
The first photo shows the unit in its original cardboard box, the second as currently packaged in a sturdier plastic box, and the third is Bert's test setup, showing a frequency error of 1E-12.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Remco on April 05, 2019, 10:08:56 am
@jimharman  Very interesting and promising results. Do I see a 12bit MCP4725 I2C DAC ?

In other words, did you rewrite the code to use that DAC?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: jimharman on April 05, 2019, 12:57:42 pm
Yes, switching to the MCP4725 is one of the changes I made. I wanted to avoid the original design's sensitivity to the 5V supply voltage. My OCXO has a 4V reference output and I use that to power the DAC. I use a resistor network between the DAC and the VFC pin of the OCXO to shift the DC level and reduce the control range, effectively increasing the 12 bit resolution of the DAC. A change I am contemplating is to switch to a AD5680 18 bit DAC.

A schematic is attached. Recent changes, not reflected in this schematic, are a circuit to linearize the diode-R-C integrator and also output buffers for the 10 MHz and 1 pps.

Earlier comments in this thread have indicated that people are having trouble with DC offset at the A/D. Having a short, low impedance ground system is essential.

Also I found that the fast risetime of the 5 MHz input to the processor can cause a lot of ground bounce. Adding the 100 ohm resistor in series with that line (R2 in the schematic) was a big help in cleaning up the ground noise.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Remco on April 05, 2019, 02:31:25 pm
I remember having read in this thread somwehere that somebody else mentioned having issues
with the 5 MHz signal and solved it with a pullup (or pulldown) resistor.

I placed the resistor ('R2') and see if the contraption behaves different. Thanks for the hint.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on April 05, 2019, 05:08:46 pm
The R1=470ohm in above schematics is rather large for 10MHz, I would go with 50-100ohm as well.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: jimharman on April 05, 2019, 07:08:51 pm
I agree the 470 on the 10 MHz is big. The reason I chose that value is that the OCXO and the rest of the circuitry are on separate 5V supplies and there is a possibility that the OCXO might be powered and the rest of the system not. The 470 prevents drawing excessive current from the OCXO in this situation. It might be unnecessary, but the circuit works with it in place and better safe than sorry.

Performance especially temperature sensitivity might be a little better with a smaller resistor.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti on April 06, 2019, 03:11:07 am
This thread is alive again. My GPSDO is locked for almost three months with a TC =600. I compare it with a Ublox set to output 10 MHz and there's a tiny drift left and right between the two outputs but never one full period, as it is expected from a PLL. I'm in process of designing a proper pcb that:
* Has a Ublox Neo-M8T GNSS timing module
* Can accept multiple OCXO types, sine, square, 5V, 12V
* Can accept PPS from an external GNSS
* Can use the PWM DAC or I2C DAC AD5693 with integrated voltage reference
* Has an active and passive offset and gain control circuit
* Has an integrated distribution amplifier with probably 4x10MHz outputs

Would be nice to have a jitter free PPS output, I'm still thinking how to do that, probably divide it from the 1MHz ot 5MHz output and synchronize it to the mid point of the GNSS PPS.
I experimented a bit with AD5693 DAC and it seems to be very good.
I'm not convinced that 18bits DAC would be necessary, reducing the DAC range to use most of the 16bit swing should be enough.

The project goes slow as I'm pretty busy but I'm more than half way through with the schematic.
Suggestions are welcomed.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on April 06, 2019, 05:34:18 am
This thread is alive again. My GPSDO is locked for almost three months with a TC =600. I compare it with a Ublox set to output 10 MHz and there's a tiny drift left and right between the two outputs but never one full period, as it is expected from a PLL.
The 10MHz of Neo7 is broken, as discussed many times. The only "clean" output is with frequencies where f=48MHz/N, N is an integer.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti on April 06, 2019, 11:53:13 am
This thread is alive again. My GPSDO is locked for almost three months with a TC =600. I compare it with a Ublox set to output 10 MHz and there's a tiny drift left and right between the two outputs but never one full period, as it is expected from a PLL.
The 10MHz of Neo7 is broken, as discussed many times. The only "clean" output is with frequencies where f=48MHz/N, N is an integer.

I know that but broken or not, it is still 10MHz. Take a look.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Johnny B Good on April 06, 2019, 04:42:17 pm
This thread is alive again. My GPSDO is locked for almost three months with a TC =600. I compare it with a Ublox set to output 10 MHz and there's a tiny drift left and right between the two outputs but never one full period, as it is expected from a PLL.
The 10MHz of Neo7 is broken, as discussed many times. The only "clean" output is with frequencies where f=48MHz/N, N is an integer.

I know that but broken or not, it is still 10MHz. Take a look.

  It turns out that the jitter you see when dividing the 48MHz TCXO clock of a NEO M8x module down to 10MHz is simply the consequence of using a non-integer divisor and is inconsequential compared to the insurmountable issue of the "leap cycles" correction system used to keep the PPS synchronised to GPS or UTC time (a parody of the leap seconds corrections to maintain UTC). That jitter is the least of your problems when it comes to disciplining a VCOCXO with a GPS module.

 The NEO M8N can be programmed to output jitter free waveforms at 12, 8, 6, 3, 2, 1 MHz and successively lower frequencies by powers of two until you hit the limit at 15,625Hz (you can only program frequencies to the nearest whole number, fractions aren't allowed - the next lower frequency of 7,812.5Hz, therefore cannot be programmed).

 If you program a frequency of 16MHz (48/3) and trigger your 'scope from a reasonably stable 16 or 8 MHz signal, you get to see the ratio of the displayed PPS waveform alternate between 67% and 33% duty cycle each time a "leap cycle" correction is applied. This also occurs with divisors of 5, 7, 9, 11 (all odd divisor values in fact).

 If you have an HF reciever capable of monitoring these frequencies in NBFM mode, including odd harmonics, you can hear these 'leap cycle' corrections as regularish ticks[1], provided you choose a jitter free divisor. Monitoring the 10MHz or its third harmonic results in a background cacophony of chirps and beeps which seems to obscure this 'tick' noise. Monitoring the 8MHz will reveal this phase modulation which is (predictably) amplified when listening to the third harmonic by a factor of three.

 Since it's only the relatively long time constants used in the Vfc output from the PLL which filter these phase discontinuities out, the minor 'jitter noise' in the 10MHz PPS signal becomes of no consequence in the face of this much larger issue. The raw 10MHz on the PPS line, whilst perfectly fine as an alternative to the 10MHz WWV time and frequency standard broadcast for calibrating oscillators, is totally unusable as an external clock reference for radio and test gear, hence the need to use a separate XO, preferably a voltage tunable OCXO as the external 10MHz reference for such equipment.

 The GPS module is merely the after-market add-on that disciplines this high quality XO to keep it locked to an atomic clock reference, albeit with very slow phase variations from the primary atomic clock reference that disciplines the Caesium atomic clocks in the GPS and GLONAS satellites themselves.

 In my naivety, I thought I could get round the 10MHz jitter issue by simply choosing a 4MHz jitter free PPS I could multiply back up to 10MHz with an ultra low jitter 3N502 clock multiplier chip until I finally recognised the rather cack handed method used to to keep the PPS synchronised to GPS/UTC by skipping or adding a full 20.8333ns cycle of the 48MHz TCXO rather than, as I'd assumed, by phase locking that 48MHz clock frequency reference.

 In hindsight, this "'leap cycle' adjustment is simply a limit of the GPS methodology for keeping the PPS synchronised to GPS time sufficient to the basic navigation requirements (the 20.8333ns jumps in phase only account for a positional variation of some 20 feet of error which can be integrated over several seconds to reduce this error to a matter of just 2 or 3 metres in the final positional computations). Producing a low phase noise frequency reference was never in the original remit of the Navstar requirements other than as perhaps an optional external add-on disciplined oscillator. Optional because such additional complexity is surplus to the basic navigation function of the original Navstar (GPS) system.

 In short, stop getting all fixated on this 10MHz 'jitter issue', the 'leap cycle' corrections are the real problem. Solve that one and the 'jitter issue' simply vanishes into the noise.  :)

[1] The rate at which these 'ticks' occur, depends on how close to the exact 48MHz frequency the TCXO has managed to get (or not) and I have experienced tick rates varying from 4 or 5 ticks a second to ticks occurring once every 5 to 10 seconds and sometimes even longer.

JBG
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti on April 06, 2019, 07:13:30 pm
The raw 10MHz on the PPS line, whilst perfectly fine as an alternative to the 10MHz WWV time and frequency standard broadcast for calibrating oscillators, is totally unusable as an external clock reference for radio and test gear, hence the need to use a separate XO, preferably a voltage tunable OCXO as the external 10MHz reference for such equipment.

Well, I can tell you that it was way better that the original TCXO installed in my HP 5385A frequency counter, before I had the GPSDO.
It may even work in the HP 8594E Spectrum Analyzer as it feeds a 600MHz PLL. So as long as that PLL locks on the external jittery 10MHz reference, and assuming that it has a reasonably long TC, it should convert into a clean 600MHz. I'll do a test one day.
My point is that it depending on the application, the jitterey 10MHz that comes out of the Ublox module may be way better, long term, than a free running OCXO, XTAL, TCXO....
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Johnny B Good on April 06, 2019, 09:36:16 pm
The raw 10MHz on the PPS line, whilst perfectly fine as an alternative to the 10MHz WWV time and frequency standard broadcast for calibrating oscillators, is totally unusable as an external clock reference for radio and test gear, hence the need to use a separate XO, preferably a voltage tunable OCXO as the external 10MHz reference for such equipment.

Well, I can tell you that it was way better that the original TCXO installed in my HP 5385A frequency counter, before I had the GPSDO.
It may even work in the HP 8594E Spectrum Analyzer as it feeds a 600MHz PLL. So as long as that PLL locks on the external jittery 10MHz reference, and assuming that it has a reasonably long TC, it should convert into a clean 600MHz. I'll do a test one day.
My point is that it depending on the application, the jitterey 10MHz that comes out of the Ublox module may be way better, long term, than a free running OCXO, XTAL, TCXO....

 You're unlikely to have that last statement refuted here (qualified perhaps but not refuted).  :)

 I'd qualify it by saying that it's not a matter of "may" so much as "will definitively" (be way better that is!). Long term, the PPS is never going to be adrift from GPS (and, leap seconds allowing, UTC) by more than 50ns for the foreseeable future, barring any outages of service. Indeed, even in the event of a disruption, the PPS will be resynchronised automatically once the service is restored, including the actual time of any timepieces relying on the service since all the time data to reset any clock is part of the navigation data payload.

 Given a stable enough VCOCXO and an intelligent micro-controller algorithm which tracks the Vfc trend to provide the best possible hold over performance from the VCOCXO, the 'free running' OCXO may well be able to stay in phase over a several hours long outage successfully masking such outage effects on the reference frequency output from the GPSDO.

 As for my own requirements, I'd be quite happy if my own GPSDO (when I finally get hold of a suitable VCOCXO and other bits at the end of this month to build one) can manage such a trick over rather more modest time scales measured in minutes.  :)

  There'll be time enough to develop such hours long hold over performance afterwards once I've got a basic GPSDO good enough for use as an external 10MHz clock reference to drive my cheap FY6600 AWG and anything else that can utilise or be modified to utilise an external clock reference.

JBG
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: bingo600 on April 10, 2019, 07:15:24 pm
Would be nice to have a jitter free PPS output, I'm still thinking how to do that, probably divide it from the 1MHz ot 5MHz output and synchronize it to the mid point of the GNSS PPS.

Take it from the 10Mhz and use a

PicDiv
or
AVR
https://www.eevblog.com/forum/projects/lars-diy-gpsdo-with-arduino-and-1ns-resolution-tic/msg2042386/#msg2042386 (https://www.eevblog.com/forum/projects/lars-diy-gpsdo-with-arduino-and-1ns-resolution-tic/msg2042386/#msg2042386)

/Bingo
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti on April 11, 2019, 07:49:53 pm
Right but it has to be synchronized with the GPS PPS to have a real PPS.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: texaspyro on April 11, 2019, 09:09:23 pm

Take it from the 10Mhz and use a

PicDiv
or
AVR


No need for a PICDIV  since the Lars GPSDO is already dividing the 10 MHz down to 1 Hz. 
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti on April 12, 2019, 02:53:52 am

Take it from the 10Mhz and use a

PicDiv
or
AVR


No need for a PICDIV  since the Lars GPSDO is already dividing the 10 MHz down to 1 Hz.

Where does it do that? Am I missing something?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: texaspyro on April 12, 2019, 03:35:21 am
Where does it do that? Am I missing something?

Ooops,  I think that was in a modified version that I saw a schematic for...   |O
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti on September 20, 2019, 11:33:18 am
Hi,

I'm having some troubles with my Lars GPSDO. After more than 7 months (or so) when it stayed locked, it started loosing lock every few days. I caught some events that seem to be satellite related, unless the OCXO shifts phase all of a sudden. Please take a look. What do you think?
First I thought is power loss but it is connected to a UPS and it didn't loose a PPS for almost 9 months.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on September 20, 2019, 05:16:36 pm
External GPS antenna is dying?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti on September 23, 2019, 02:10:02 am
External GPS antenna is dying?

I don't have an external antenna, it is at the window. It didn't give me any troubles for 7 months.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: metrologist on September 23, 2019, 03:51:19 pm
It looks like you briefly lost gps lock, then are settled back into lock 12 hours later with a dac value ~30 points higher. How much does your dac vary in a day? I would plot dac variances over a long period to look for a trend.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: bingo600 on October 27, 2019, 03:18:20 pm
Just found this nice PCB
https://github.com/Qw3rtzuiop/Lars-GPSDO-PCB

The pict(s) are for the rev1 pcb , not the rev2.

I just ordered a few on JLCPCB

/Bingo
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Qw3rtzuiop on October 27, 2019, 05:30:15 pm
Hello bingo600,
im responsible for the crappy pcb design.
I use the rev. 2 happily but im not a timenut and cannot confirm that this design is perfect.
The rev. 1 was missing an output buffer. Even plugging in some cables changed the output signal that the GPSDO unlocks.
Adding an output buffer fixed that problem.
I still have 8 unpopulated rev 2 pcbs if anyone is interested (price: shipping costs from germany).
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: 9aplus on October 28, 2019, 05:45:18 pm
@Qw3rtzuiop
PM sent
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Jacon on October 28, 2019, 06:36:34 pm
@Qw3rtzuiop

PM sent yesterday
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Qw3rtzuiop on October 30, 2019, 11:01:07 am
I recieved all of your PMs.
When i looked up the prices I noticed that the German Post dont allow private customers to send goods via international mail. Since 2019 only paper is allowed :palm:
They are allowed to open and control the content. Instead I should use DHL (5-10€).

Im sorry but if youre outside Germany it is cheaper to buy them at JLCPCB/Elecrow/OshPark/Aisler.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Jacon on October 30, 2019, 02:57:13 pm
Aron,

It would be nonsense to produce another pieces, when you have ready & spare ones  :palm:
For me, that cost you mentioned is perfectly OK, just send 2 pcs in that package  :-+
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: 9aplus on October 30, 2019, 06:31:38 pm
Agree with Jacon
2 pcs for me too  :-+
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti on November 02, 2019, 02:28:28 am
It looks like you briefly lost gps lock, then are settled back into lock 12 hours later with a dac value ~30 points higher. How much does your dac vary in a day? I would plot dac variances over a long period to look for a trend.

Ok, I started monitoring the GPS. I think there's a flow in this design or in my implementation. Looks like my HC390 misses some pulses. I've attached a stripped down log of the GPS and one of the GPSDO. By my calculation the event happened around 0:58 UTC but around that time the GPS saw a healthy 11-12 GPS satellites and 9-10 Glonass. At no point around that time the lock was lost. The jump seems to be of about 500ns. I've also attached two more pictures with captures of lock loss, one of them again with a jump of about 500ns. Is like it looses half of the 1MHz pulse, like there's a 180 shift in phase at the 1MHz output.
In the gps.csv, the time is in GGA column 2 and the number of satellites in GSV column 4.
Do you have another idea?

This started happening randomly after 8 - 9 months with no issues.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on November 02, 2019, 11:18:13 am
Try to heat-up or cool-down the HC390..
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: metrologist on November 04, 2019, 08:55:56 pm
I started wondering what it would look like if any one of the four edges were missed? It would be interesting to see the signals on a scope when this phase jump happens, perhaps by using a mask test and halt on fail. I wonder if EMI/RFI could be involved or whether some buffering/filtering could help.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on November 05, 2019, 01:36:08 pm
Hi all,

I have build the GPSDO following the original schematic on perf board, although made some small changes. I'm using the Bliley NV47A1282. My version seems to have a finicky output because the slightest loading distorts the sine wave. After trying a couple of things I resorted to using another HCT4046 to create a square wave with an almost 50% duty cycle. I also used 100R in series between the HC390 and the Arduino Nano and another 100R in series with the HC390 10MHz input.

To create a mid-point for the DAC range at the mid-point of the Bliley frequency range, I used the 1PPS signal of my (genuine) NEO-M8T and the free running Bliley output on my scope, and adjusted it with a trimmer to get a steady, non moving drift, creating a manual lock. I then replaced the trimmer setting with a resistor in my case of 200K. The total DAC range now has a adjustment range of 7.9Hz. I verified this all with my counter.

I have noticed two problems.
The first problem is that using H1 to determine the gain does not work for me. The ns results drift linearly way out of range. Same with h65353. Setting the DAC value at mid-point creates a repeating but steady range of numbers, as expected. To calculate the gain, I used the delta of the Bliley in Hz, which is 7.9 Hz, or 790ppB resulting in a gain of 83, if my math is correct. :-//

The second problem is that with the standard lowest offset of 200, I can't get a lock, and if so, only for very brief periods.  The ns value is too far out of range,  beyond -100.  I could cheat by set a higher lockPPSlimit in the code, but then a Lock is reported while there is too much jitter.

I modified the code to allow me to set the offset as low as 10. At an offset of 100, I got a lock, but still with too much drift. When I changed the gain from 83 to 830, the resulting lock has been running for 24 hrs without a glitch and with minimal jitter, I think. I have steadily increased the damping and I'm now running at a damping level of 10. I'm not sure if the damping counteracts the higher gain that I needed to set, but even at a damping factor of 0.5, everything seemed to work fine.  See the attached scope capture of the 5MHz signal and the signal at the anode of the Schottkey Diode.

Can anybody enlighten me on these two issues?

Tks, Paul
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on November 05, 2019, 02:34:24 pm
Miti,

I don't think your problem is related to the GPS. The HC390 is not connected to it, only to the oscillator. The missing pulse must be found in that chain.
While monitoring my system for hours, while attached to a scope, I also noticed missing pulses or strangely distorted ones.
They can be observed or found easier if you can use the persistence setting of your scope, as I do. I doubt it is the HC390.
Below you can see such a strange behavior. Note that the small wiggle on the 5MHz caused a serious glitch or missing pulse on the anode side of the diode.
It probably caused the irregular entries in the trace.

I use a Bliley NV47A, but have two other types on order because I don't really trust mine yet, also because it has a very weak output driving capability.

Good hunting,

Paul
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on November 05, 2019, 03:39:02 pm
..I then replaced the trimmer setting with a resistor in my case of 200K. The total DAC range now has a adjustment range of 7.9Hz. I verified this all with my counter.
How did you wire that 200k resistor, plz?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on November 06, 2019, 01:57:41 pm
Hi Imo,

The 200K resistor is between the VC of the Bliley and ground.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on November 06, 2019, 11:57:08 pm
See the attached scope capture of the 5MHz signal and the signal at the anode of the Schottkey Diode.

Where the 5MHz signal is coming from? It should be 1MHz, afaik.
1MHz signal is 1us period.

Lars assumed the 1PPS rising edge sets the RS FFlop (aka phase comparator III) high, the RC starts charging via the schottky.

The upcoming edge of the "1us" pulse from HC390 then resets the RSFF to low, the RC stops charging and you get a voltage at the 1nF capacitor. The voltage is measured with the ADC afterwards.

The RC is set such the midpoint of the 1us period (500ns) is in middle of the 1.1V range of the atmega's ADC, that is about 0.5V.

Any phase diff between the 1PPS edge and the "1us" edge will create a different voltage, while 500ns diff is 0.5V.
The control loop via the MCU/DAC then sets the OCXO's freq such the phase difference between the 1PPS edge and "1us" edge is always as close as possible to 500ns (that means 0.5V at the ADC's input).

One problem I see is the simple RS FFlop. It is level sensitive, not edge sensitive. The phase comparator II is edge sensitive,
its output (pin1) inverted could be a better solution, imho.

With the current phase comparator III you may use a 74HC00 instead. My guts feeling is with such a simple RS FFlop the phase may revert suddenly and instead of, say, +15ns phase diff it will show -485ns next step (that is 500ns difference, the half of the 1us period).

Needs to be analysed somehow by experts, imho..


Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti on November 07, 2019, 02:33:23 am
Hi all,

I have build the GPSDO following the original schematic on perf board, although made some small changes. I'm using the Bliley NV47A1282. My version seems to have a finicky output because the slightest loading distorts the sine wave. After trying a couple of things I resorted to using another HCT4046 to create a square wave with an almost 50% duty cycle. I also used 100R in series between the HC390 and the Arduino Nano and another 100R in series with the HC390 10MHz input.

To create a mid-point for the DAC range at the mid-point of the Bliley frequency range, I used the 1PPS signal of my (genuine) NEO-M8T and the free running Bliley output on my scope, and adjusted it with a trimmer to get a steady, non moving drift, creating a manual lock. I then replaced the trimmer setting with a resistor in my case of 200K. The total DAC range now has a adjustment range of 7.9Hz. I verified this all with my counter.

I have noticed two problems.
The first problem is that using H1 to determine the gain does not work for me. The ns results drift linearly way out of range. Same with h65353. Setting the DAC value at mid-point creates a repeating but steady range of numbers, as expected. To calculate the gain, I used the delta of the Bliley in Hz, which is 7.9 Hz, or 790ppB resulting in a gain of 83, if my math is correct. :-//

The second problem is that with the standard lowest offset of 200, I can't get a lock, and if so, only for very brief periods.  The ns value is too far out of range,  beyond -100.  I could cheat by set a higher lockPPSlimit in the code, but then a Lock is reported while there is too much jitter.

I modified the code to allow me to set the offset as low as 10. At an offset of 100, I got a lock, but still with too much drift. When I changed the gain from 83 to 830, the resulting lock has been running for 24 hrs without a glitch and with minimal jitter, I think. I have steadily increased the damping and I'm now running at a damping level of 10. I'm not sure if the damping counteracts the higher gain that I needed to set, but even at a damping factor of 0.5, everything seemed to work fine.  See the attached scope capture of the 5MHz signal and the signal at the anode of the Schottkey Diode.

Can anybody enlighten me on these two issues?

Tks, Paul

Yes, I have the same issue with the sine wave. That's why I did what you did but the output was still distorted. So in the end I added a resistor divider, something similar to Brooks Shera but different resistors, I don't remember the exact values, see attached, and I think that's the weak point that misses some pulses.

I also saw the other issue with H1, H65535, TIC_Offset. Don't bother changing the code. Measure your voltage at the VC pin of the OCXO with H1 and H65535. and scope the A0 pin. I bet it doesn't stay at 0V in between pulses. You need shorter and thicker ground wires. Here are the parameters that I'm using now.

EEPROM content:
restarts = 18
totalTime3h = 3159
temperature_Sensor_Type =  11
ID_Number = 0
TICmin = 120
TICmax = 1012
x2 = 100
TIC_Offset = 500
filterDiv = 2
warmUpTime = 300
damping = 300
tempRef = 417
tempCoeff = 200
dacValueOut = 22679
gain = 122
timeConst = 500
k = 111

Edit: See some screenshots in Reply #49.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on November 07, 2019, 09:37:22 am
imo,

Thanks for the explanation.
I should point out that my circuit works well, even with a TC of 500 over 24 hours. I have not gone beyond that yet.
I understand the working of the hardware, and verified the working of it, but still have problems with the presented results from the software though.

For my scope screenshot, I simply used the 5Mhz signal (output of the HC390 going to D5 of the Nano) as a reference for the diff_ns signal at the anode of the diode. I could have used the 10Mhz, or the 1MHz of course, to see the drift and jitter. I don't think that makes a difference?

After realizing :palm: that I should use the diff_ns values for the gain calculation, and not the ns values, I was able to get a decent gain value. I simply used Excel to let it calculate the average of the diff_ns values out of about two pages of the report. H1 produced +240 and H65K -166, resulting in a gain of 161.
Why this is significantly different from using the "real" frequency values for H1 & H65K of the OCXO itself (gain is 83) is one of the puzzles I have.

I appreciate the time and effort you guys put in to help others!  :clap:

Paul
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on November 07, 2019, 10:19:19 am
Miti,

Thank you for the elaborate answers. As with imo, I applaud you for your help in this forum!  :clap:

I'm still struggling to understand what the software tells me, because in essence, my hardware seems to work very well.

Attached is a screen dump of both sides of the diode. As you can see, the ground level for the ADC has no issues. I took several precautions. As you know, the pulse height is compromised due to the X10 probe loading. The signal is a bit noisy probably because of my rather long probe ground lead and even more the fact that I use proto-board without a ground plane.

BTW, just for fun & learning, I also measured at what part of the pulse the ADC reads it, by adding a port output to the code that creates a pulse around that operation. The rising edge is pretty linear, but the discharge is not, and here is where the ADC measurement takes place. Does not matter much I think.

What I'm still struggling with is the relationship of what I'm seeing on the scope in terms of the width of the delta pulse signal (anode of diode), and what gets reported by the code.
If I understand the explanation from Lars, the filtX10 number includes the offset. If I take that number and subtract the offset, I get very close to what I see on the scope.

However, I still don't quite get the diff_ns reports in relation to filtX10 and also the ns numbers. They don't seem to jive with each other although Lars went through great pains in the code to get everything converted to ns. Maybe it's the damping? Mine is currently at 3 now. I need to play with that setting more.

I will certainly look at your settings and try them, and see if there are any glaring differences.

Tks,
Paul

Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on November 08, 2019, 02:28:14 pm
The Bliley NV47A1282 where I already suspected a flaky output amplifier, just died on me. No signal out anymore.  |O
These used Blileys have a long but very sad history with me now. The first one that arrived was DOA, never had an output. A replacement never arrived, and the third one died after a few weeks. >:(
With 4-6 weeks shipping time for each one, I've given up. Be aware...
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Satbeginner on November 08, 2019, 02:59:16 pm
The Bliley NV47A1282 where I already suspected a flaky output amplifier, just died on me. No signal out anymore.  |O
These used Blileys have a long but very sad history with me now. The first one that arrived was DOA, never had an output. A replacement never arrived, and the third one died after a few weeks. >:(
With 4-6 weeks shipping time for each one, I've given up. Be aware...

For what its worth: I have a (used and aged) Bliley running for almost two years now with no problems.....

Just my two cents,

Un saludo,

Leo
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: metrologist on November 08, 2019, 05:48:01 pm
BTW, just for fun & learning, I also measured at what part of the pulse the ADC reads it, by adding a port output to the code that creates a pulse around that operation. The rising edge is pretty linear, but the discharge is not, and here is where the ADC measurement takes place. Does not matter much I think.

Thanks for your presentations. Does the ADC sample at the shown pulse falling edge? I'd expect the discharge to follow a classic decay curve.

I was never able to get mine to remain locked much above TC 120 and only a few days around TC 240 ( I always needed a better GPS though). It's been a while since I had it on so getting inspired to connect it back up and remember what I was doing.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on November 12, 2019, 11:50:06 am
Hi metrologist (and others),

Here are the results of my learning experience with the ADC measurement of the TIC signal.

In the scope picture ending with 3514, on the bottom trace (in yellow) you can see the TIC pulse measured on the anode of the Schottkey diode, coming from the HC4046. The blue trace is measured on the A0 ADC input from the Arduino nano. The voltage is quickly rising until the end of the pulse and then starts to decay again. The pulse width can be anywhere between a few ns up to the maximum of 1us. The voltage at the ADC input is therefore a reflection of the pulse width. Note that due to the loading of my 10x (10Meg) probe, the 10Mohm resistor (R2) has the probe impedance of 10Mohm in parallel so the 10M becomes approx. 5Mohm, resulting in halving the discharge rate of C1, the 1nF capacitor.

In the text of Lars's document, he mentions that "As the 1PPS gives an interrupt to the processor the ADC will measure the voltage almost immediately after the charge is ended." While true in essence, the reality is that the Arduino is not that quick.

In the picture ending with 4342, the yellow trace shows the TIC signal again from the anode side of the diode. The blue trace shows the period of the ADC measurement. I made this possible by adding "probes" to the ISR code:

ISR (TIMER1_CAPT_vect)
{
  timer1CounterValue = ICR1;  // read the captured timer1 200ns counter value
  digitalWrite(Trigger,1); // Trigger high
  TIC_Value = analogRead(A0);  // ns value
  digitalWrite(Trigger,0); // Trigger low
  PPS_ReadFlag = true;
}

Two things are important to know. The Arduino has a bit of a complex hardware interrupt system. The final entry into the ISR is not very stable in terms of timing. Second, the ADC read takes-up a lot of processor time. The blue trace shows the time of this cycle, plus the time of the output port changes, they also take-up some processor time.

I don't know where in this period exactly the signal is sampled. (You could find out and measure this by using a precise ramp and compare the ADC reported  voltage alongside the ramp voltage)

The last picture (1344) shows both signals again but now in more detail so you can see that the sampling takes place quite some time into the discharge cycle of C1. Note that I had to use a scope probe, but even so, "immediately", is probably not what you expected.

Does it matter for the PI loop?
Not really, as long as everything is relative to each other.

Another take-away is that some designs went through extra hardware to create a constant current source to have a better charging linearity. This shows that this is a rather futile action. Time and effort would be better spent on the discharge cycle.

One idea that I have would be to eliminate the 10Mohm discharge resistor, and use a port from the Arduino to take care of the discharge cycle. I have not tried this yet, but my plan would be to use a digital port and set that as an input. This is a very high impedance state. Just after the ADC has sampled the pulse, which should now stay much flatter because there is virtually no loading, only leakage. I would then change the port to output, drive it low to discharge the capacitor and then turn the port back into an input again. All within the ISR. I could not find any reliable information on how hi-Z the digital inputs really are, but if you don't use pull-ups, it should be many times higher than 10Mohm, maybe well into the 100Mohms.

Anybody care to comment or elaborate?
Tks, Paul

 

Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on November 12, 2019, 11:58:33 am
I'd say the actual shape of the discharge curve is not really an important factor, as long as it's a constant between measurements and the sampling point doesn't jitter too much. What you're interested in is not the actual measurement but the difference between the measurements, which represents the drift.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on November 12, 2019, 01:34:08 pm
Hi thinkfat,

That’s what I was saying, I think.

There is however a jitter factor due to the fact that the Arduino has no “real” interrupt, and I don’t know how much that varies. I will try to see if I can measure that, and how much of a factor that really is, because that could potentially be a factor for the PI loop. Although nice to know, there’s little you can do about it with this processor architecture.

BTW, I’m not implying that there’s something wrong anywhere with Lars’s design, far from it, I ’m just exploring, learning and trying to explain.

MfG,
Paul
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on November 12, 2019, 03:14:25 pm
Hi thinkfat,

That’s what I was saying, I think.

There is however a jitter factor due to the fact that the Arduino has no “real” interrupt, and I don’t know how much that varies. I will try to see if I can measure that, and how much of a factor that really is, because that could potentially be a factor for the PI loop. Although nice to know, there’s little you can do about it with this processor architecture.

BTW, I’m not implying that there’s something wrong anywhere with Lars’s design, far from it, I ’m just exploring, learning and trying to explain.

MfG,
Paul

If the jitter has a Gauss distribution, it will be averaged out, so it's not really a factor. I'd be more concerned about temperature drift of the 1nF cap and the two resistors. That's a systematic error you'd need to actively compensate. A 10Meg resistor isn't a really practical value, you're getting into the range of the input resistance of the ADC there. But again, as long as it's an invariant between the measurements it's not a factor. Regarding the dimensioning - you need a sufficient discharge current, you need to bleed the storage capacitor sufficiently so that the next pulse can charge it up again.

So in other words, I do agree with your proposed change. Get rid of the impractical 10M resistor and instead use an I/O pin to drain the stored charge. You can put a resistor in series to limit the discharge current but it should be OK, I think. This way, you can probably achieve a less steep discharge curve which will help with the inevitable jitter of the sampling point. But temperature compensation is probably the more important measure to be taken.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: metrologist on November 12, 2019, 03:46:34 pm
When I thought of testing the system stability, I'd thought it would be good to use a more stable PPS, such as from a divided 10M OCXO or even from the same OCXO being tuned.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on November 12, 2019, 07:19:24 pm
The -2mV/C TC of the diode is much higher than TC influence of the 3k9 resistor (say 50ppm) and the 1nF capacitor (Lars had recommended C0G/NP0 one afaik). Use the TDK one as Kleinstein and AlexN recommended here:
https://www.eevblog.com/forum/metrology/diy-high-resolution-multi-slope-converter/msg2763326/#msg2763326 (https://www.eevblog.com/forum/metrology/diy-high-resolution-multi-slope-converter/msg2763326/#msg2763326)
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on November 12, 2019, 09:02:13 pm
I was thinking about going for a PPS capacitor, like https://www.mouser.de/ProductDetail/667-ECH-U1H681GX5 (https://www.mouser.de/ProductDetail/667-ECH-U1H681GX5)
But there's no temperature coefficient for capacity or leakage specified... That puts me off a bit. I may go with the TDK C0G/NP0 instead.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: sundance on November 13, 2019, 08:00:09 am
@Dbldutch:
Quote
There is however a jitter factor due to the fact that the Arduino has no “real” interrupt
Just out of curiosity: Is this verdict based on the fact that there is no constant delay from receiving an interrupt request to actually start the ISR, because the current instruction is finished before the IRQ is acknowleged (and different instructions have different execution times)?
Or am I missing something else?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on November 13, 2019, 09:05:31 am
When I thought of testing the system stability, I'd thought it would be good to use a more stable PPS, such as from a divided 10M OCXO or even from the same OCXO being tuned.

I'm probably going to try using another GPSDO I own for testing. The 10MHz output should be reasonably stable and the 1PPS output would be locked to it, sounds like a good testbed.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on November 13, 2019, 12:00:19 pm
I spent some time measuring the interrupt latency from the 1PPS signal together with the "probes" in the ISR. (see my post above)
It seems there is a source of jitter that does matter in the PI loop and the overall stability.

I have triggered the scope directly on the 1PPS pulse and acquired the ISR "probe" that signals the start of the ADC read cycle.
As you can see, there is no Gaussian distribution and the jitter is up to about 200ns. We have already seen that the discharge curve of the 1nF capacitor is not linear, so the resulting voltage, that drives the DA convertor and therefore the VC of the oscillator will show this too.
How much depends on the amount and effect of the software filtering.

To eliminate this source of jitter, we have to change the discharge method by the 10Mohm resistor, which is also a significant source of Johnson noise.

I will try to change the hardware and software now with my proposed solution and make some more measurements. Unfortunately, I don't have a FET probe, so the discharge effect of the x10 probing stays until I have found another way of probing C1. I have some ideas...

Stay tuned,

Paul
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on November 13, 2019, 01:51:28 pm
Well, here's a surprise...

I removed the 10Mohm resistor and made a connection to port D10 with a 1K SMD resistor to C1.
I made the changes in the ISR to force the voltage on C1 to ground right after the ADC statement and made a few measurements.
No dice. It turns out that the voltage on C1 is already at ground level by the time my contraption is activated.

I suspect that there is much more leakage (must be the ADC?) than anticipated.
I added the raw ADC value to the display logging to see the result with and without my x10 probe, nada, no major change.

I added a 1% mica capacitor of 1nF in parallel, no major improvement. You can't go much higher because the rise time will become too slow.

So even after disconnecting the port connection to C1, and no probing from my scope it still worked. Go figure.  :-//
Below is the ISR period including my port manipulation which is activated at the very end of the pulse.

I still get a lock and everything seems to work well...

Can somebody please verify this in his or her circuit?

Tks,

Paul

Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on November 13, 2019, 01:52:17 pm
So how much time does it take from end of charging the 1nF to actual ADC sample and hold (plus minus the 200ns jitter)??

PS: The leakage via the 1N57xx schottky could be 10nA, via the ADC pin's clamping diode say 5nA..
You may improve that by replacing the schottky by the BAV199 and put a jfet/mosfet opamp in front of the ADC. But the input clamping diodes at the opamp's input will still leak..

PPS: in 10us 137us it drops 10mV, it discharges to 1% in 18ms (with 500ns input pulse)
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on November 13, 2019, 02:50:01 pm
imo,

Have a look again at the screenshot in an earlier post with the number ending in 4342.
That has the "probes" surrounding the ADC read instruction.

The ADC conversion time is specified to take between 13-260us in the ATmega328P AVR datasheet.

Also the entry into the ISR and the departure take-up a lot of time as well.
I will work on that next, but before we start to speculate I would like to get clarification that what I'm seeing is the way it is, and not a  :palm: pilot error from me.

Enjoy!
Paul
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on November 13, 2019, 03:42:29 pm
With 200kHz ADC clock the S/H is done 7.5us after the start of the conversion and ADC is completed in 67.5us.
Provided the ISR takes 1.5us, the S/H is done in 9us. The 1nF voltage drop I see in the simulation is something like 1.1mV in 9usecs..
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on November 13, 2019, 04:16:05 pm
With 200kHz ADC clock the S/H is done 7.5us after the start of the conversion and ADC is completed in 67.5us.
Provided the ISR takes 1.5us, the S/H is done in 9us. The 1nF voltage drop I see in the simulation is something like 1.1mV in 9usecs..

That should not be a huge problem, right? The ADC is 10bit resolution, I guess using the internal reference of 1.1V. 1 LSB = 1mV. The ADC is spec'd for +/- 2LSB absolute accuracy, so 1.1mV should still be in the noise. So, you would not loose TIC resolution there.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on November 13, 2019, 04:52:42 pm
Your ADC noise would be much higher provided your wiring and decoupling is not perfect.
4LSB p-p is a good result already, imho.
Also the 1PPS is not jitter free.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on November 13, 2019, 05:16:34 pm
You could poll the pin connected to the 1Mhz signal to start the ADC conversion, instead of using an interrupt. That should eliminate one source of jitter. Or, connect the comparator output before the diode to another pin and poll that for the falling edge.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on November 13, 2019, 05:27:51 pm
When looking at the oscope picture 4342 above - the actual ADC starts around 8us after the falling edge at the anode, the S&H is done at around 21us, the ADC finishes after ~114us (it looks like the ADC clock is ~120kHz).

What is the issue - the voltage at 1nF drops to almost 35% of the voltage @10us(!) for 1us input pulse - picture 3514 (with 5Mohm resistor = 10Meg || 10meg_probe). At 21us it would be 15%.

Doublecheck whether your oscope probe is set to 10x (10Meg).
Doublecheck the values of 3k9, 1nF, 10Meg in your wiring.

It seems like your 10Meg resistor is 10k in reality (with 10k the simulation shows drop to 38% @10us).

PS:
with 10Meg in the simulation the voltage drops 2.5mV in 21usecs (990ns input pulse).
with   1Meg in the simulation the voltage drops  20mV in 21usecs (990ns input pulse).
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on November 14, 2019, 09:15:40 pm
I'm wondering if a dual-slope converter could be an alternative approach... Basically, you'd charge a capacitor with the pulse from the phase discriminator through a resistor, then discharge it through the same resistor and measure the time the voltage stays above a certain threshold... This should double the resolution against just counting out the length of the pulse, no?

Don't mind me, I'm just thinking aloud...
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on November 14, 2019, 10:09:19 pm
Another thought - you may put there the TDC7200 (~50ps resolution), no need to mess with analog, the arduino library is available..
http://www.ti.com/lit/ds/symlink/tdc7200.pdf (http://www.ti.com/lit/ds/symlink/tdc7200.pdf)

PS: the calibration clock for the 7200 could be the OCXO itself. You may measure the time between rising start and stop edges, thus you may remove the 4046 too.

So you would need the 7200, 74HCxxx divider such you get the time diff somewhere into the 7200's range, atmega328p, and the PWM DAC as it is today.

The time difference between the 1PPS rising edge and OCXO's edge (divided say to 0.5MHz = 2us period) could be set such the middle will be 1us and the regulation range will be +/- 500ns.

7200 will then return results in Mode 2 from 500ns to 1500ns (that is -500ns to +500ns diffs) with 55ps resolution, 28ps accuracy and 35ps standard dev (see DS).
Btw, 500ns with 55ps resolution is 9090 counts :)
With good pcb layout the standard dev could be close to 35ns, that is 200ps p-p noise, imho.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on November 15, 2019, 08:33:10 am
I have indeed seen that chip mentioned in another thread about GPSDOs and was looking at the datasheet.

If I'm not mistaken, there is a mode that measures the time between the start pulse and the next reference clock edge. That would be exactly the same input as in Lars' design, phase difference in the time domain, just fully digital and without the dependencies to leakage and temperature.

What I don't understand yet is if the start and stop pins can just be tied together to form a TIC. It's not entirely clear from the datasheet. I think the chip disables the start detector while waiting for the stop pulse, so that should be all good.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on November 15, 2019, 09:02:26 am
There is no need to wire the start and stop pins together. The start pin will be wired to, for example, 1PPS and the stop pin to the OCXO's 500kHz. There will be none 4046. 7200 will measure the "time between the rising edges of those two signals" - it returns the difference "stop_rising_edge-start_rising_edge". Thus the same as it is today with analog TIC.
The 7200's start and stop pins are both rising edge sensitive.

PS: the 7200 replaces 4046+schottky+3k9+1nF+10Meg+ADC. The ISR will read 7200 (via SPI interface), and returns a number between 500000 and 1500000 (for 500ns to 1500ns difference between the edges, where the "middle" is 1000ns). The returned numbers will be "noisy", of course (as it is today too).

The atmega's sw needs to be adjusted accordingly  - the control loop should be trying to set the OCXO's EFC voltage such the by 7200 returned number will be as close as possible to (500000+1500000)/2 = 1us, that will be the "exact 10MHz".

Why 500ns to 1500ns difference result? Today's system works such the analog TIC measures the difference with the result ranging 0ns-1000ns where the middle is 500ns. That 500ns (the middle) creates aprox 0.5V at the 1nF capacitor - that is in the middle of the ADC range. Current sw is chasing the middle, of course.

You have to adjust that because 7200 needs to be operated in certain range. Mode 1 is 12ns to 500ns for the "edges differences", while the Mode 2 starts at 250ns up. So let us take the Mode 2 and position the edge's difference as I suggested above.

You may think on a different differences range, sure. The 7200 is much more flexible in that regard, as there are not such limits as with the analog TIC used today.

PPS: I would also suggest to migrate the Vcc to 3.3V. Atmega328b works fine at 3.3V/16MHz. The 7200 is 3.3V.
You have to amplify the PWM DAC's amplitude to something like 1..7V to fit various OCXO's anyway.

EDIT: corrected the expected values the TDC7200 arduino library returns..
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on November 15, 2019, 10:50:44 am
Hi, thanks for all the valuable input. I'm not afraid to change the code, I'm going to use a different MCU anyway. Likely, STM32F030 in LQFP-32 or TSSOP-20 package, if I can fit all the interfaces. Currently, I'm looking at two serial ports, one debug, one to a GPS module, SPI for the TDC, maybe another I2C for an external DAC (if I can convince myself that it's better than a PWM DAC). That might not fit the small 20pin package.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on November 15, 2019, 11:03:05 am
Regarding the DAC - make yourself a calculation on the required DAC resolution.
Input is the OCXO's gain in Hz/Volt (for example 1.5Hz/V).
Do compare the DAC's EFC voltage step with the TIC resolution such it finetunes somehow.

PS: here you may see (very bottom picture) how the TDC7200 returns a measurement of 100ns time difference (x-axis is the sample number, y-axis the actual time interval in ps), all wired on a cheapo solderless breadboard :)
The standard deviation was ~150ps, 4x worse than with proper design.
Do not do it that way, use by TI recommended layout with good start/stop signal impedance matching instead..

https://www.eevblog.com/forum/metrology/how-to-test-a-diy-counter-with-gpsdo/msg1808444/#msg1808444 (https://www.eevblog.com/forum/metrology/how-to-test-a-diy-counter-with-gpsdo/msg1808444/#msg1808444)
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on November 15, 2019, 01:44:14 pm
Hi guys,

To try to solve the mystery with the too fast de-charging of the 1nF cap., I completely rebuild the circuit.
While de-soldering, there was nothing wrong, apart from some solder flux underneath the SMD components (R1, R2 and C1).
The values all measured correctly. I use the suggested 1N5711 as the Schottkey, it seems to be working fine.

My scope probe is a decent quality x10 one (TESTEC HF series), without a switch.

I replaced the COG 1nF SMD cap with a small radial high quality 1nF COG capacitor.

I made the measurements again with and without the 10Mohm resistor in the circuit. There is NO change on the waveform. This is plausible because the effect of the 10M and/or the 10x probe is dwarfed by whatever else is loading the circuit. Believe me, there is nothing else connected or otherwise attached to the circuit. It's no rocket science, and there really is no magic involved.  :phew:

Below is the "probed" ISR :

ISR (TIMER1_CAPT_vect)
{
  timer1CounterValue = ICR1;  // read the captured timer1 200ns counter value
  digitalWrite(probe, 1);     // create a signal to probe the ISR with a scope
  TIC_Value = analogRead(A0); // ns value
  digitalWrite(probe, 0);     // stop the probe
  PPS_ReadFlag = true;        // gives the decharge cycle some time as well
}

The bottom trace (yellow) on the attached picture shows the probes surrounding the ADC read cycle.
The top trace is the voltage across C1, without the 10Mohm resistor present, but of course with my 10x scope probe. It also should have an impedance of 10M. (look it up if you doubt that)

As you can see, the de-charge of the capacitor has finished way before the end of the ADC cycle.

However, the circuit as is, with or without the 10M (resistor or probe) works!

So as a next step, I changed the code to show the raw ADC readings in the second column of the report. Below is one drift cycle.

2370   56   -39   33691   93.9   ****      49   560   500   1   23934   56.6   1120   0   0   0      
2371   20   -70   33680   93.5   ****    -32   200   500   1   23934   56.8   1121   0   0   0      
2372   29   -63   33683   92.8   ****       8   290   500   1   23933   56.7   1122   0   0   0      
2373   8   -81   33676   93.2   ****    -18   80   500   1   23933   56.8   1123   0   0   0      
2374   10   -79   33676   92.9   ****       2   100   500   1   23932   56.9   1124   0   0   0      
2375   18   -72   33679   92.5   ****     7   180   500   1   23932   56.6   1125   0   0   0      
2376   3   -85   33674   91.3   ****    -13   30   500   1   23931   56.7   1126   0   0   0      
2377   3   -85   33674   90.4   ****       0   30   500   1   23931   56.9   1127   0   0   0      
2378   4   -84   33674   88.6   ****       1   40   500   1   23930   56.5   1128   0   0   0      
2379   0   -88   33673   88.5   ****      -3   0   500   1   23929   56.6   1129   0   0   0      
(Note that I did not have the two LM35 connected properly - I use "****" instead op UnLocked))

The values, ranging here from 0 to 56 are relative to what I see on my scope, so the actual ADC reading of the value must be at the very beginning of the cycle. Luckily, just before the capacitor is completely discharged.

When I dis-connect my scope probe, and the circuit is still without the 10Mohm resistor, the ADC values are almost exactly the same. As to be expected.

I would like to re-iterate that there is no strange connection anywhere on the circuit board that would explain the way too fast discharge.
By simple deduction, the only unexplained factor that remains is the loading or low impedance of the ADC input of the Arduino processor itself.

The specifications list 100M as the impedance, as you would expect from a CMOS device, but wait, there is a gotcha! I also found this:

During an actual sample, the input resistance is temporarily a lot lower as the sampling capacitor is charged up so it is recommended that whatever you connect to the A/D have an output impedance of 10k or less for best accuracy. This is to allow the A/D input capacitor on the sample and hold to charge up in the time allotted to it between switching the input multiplexer over and starting the conversion. As you may know the arduino analogRead() function is designed and assumes the source impedance of voltage to be read is 10K ohms of lower. The fact that the AVR adc has but a single sample and hold capacitor but multiple multiplexed analog input pins means that you have to deal with the problem that is trying to read a high impedance signal.

Remember that the same ADC s/h circuit is also used for the two temperature inputs (A1 and A2)

I think the 10K output impedance clarifies what I'm measuring pretty well, unless there is something else and I have it wrong.  :palm:
Is there one of you that can contribute or confirm this?

The big question however is: do we really care with all this if Lars's design works? (with or without the 10Meg)

Well, in my opinion only if you want to have a "real" 1:1 representation of the TIC value in relationship with the pulse width. (Yes I do care)

If so, the solution would be to add an op-amp as a non-inverting voltage follower between the C1 capacitor and the ADC input and also add my proposed circuit and code changes to dis-charge the capacitor under program control after an ADC measurement has finished.

Does this make sense?

Paul
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on November 15, 2019, 03:27:10 pm
The internal ADC S&H consists of 1k-100k serial resistor and 14pF capacitor (the cap is connected to Vcc/2).
The 14pF capacitor takes over a small chunk of charge off the 1nF capacitor, therefore the voltage drops a little bit.
The drop is tiny, however, like 14/1000.
The 10k "source resistance" is recommended such the 14pF charges up within 1.5 ADC clock cycle fully.
The fact the 1nF discharges so fast indicated an issue, imho.

The voltage at the 1nF drops to 50% BEFORE the actual conversion starts (your last oscope picture).
That tells me there is something of aprox 10k hardwired to the ADC input.

It could be your schottky is shorted or damaged. The 4046 output goes LOW after the pulse lenght measurment stops, and it could be the 1nF capacitor discharges itself immediately through the diode and 3k9 into the 4046 output which is at gnd level at that time..

I still strongly believe the blue voltage must stay at that initial 1V level during the entire 118us long ADC conversion.

PS: Below is a simulation with worst case scenario with the S&H (red) starting acting 10us after end of 4046 pulse measurement, S&H is 30us long, where it charges the internal 14pF via 1k.
The green is the 1V voltage at 1nF capacitor you should see, afaik.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on November 15, 2019, 04:14:32 pm
imo,

You are absolutely correct. It is the Schottkey diode. I concocted another prototype and that worked as it should.
The diode I have been using seemed OK, but is not.

I feel like a totally dumb ass for missing this obvious problem.  :palm:

The discharge now looks pretty linear within the ADC read cycle.
Blue trace is ADC window.

I'l hide in disgrace for a while... |O
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on November 15, 2019, 04:20:03 pm
Now it looks better, sure :)
But best you will see your yellow 1V voltage such noise free as it is my green voltage in my simulation above..  :P
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: metrologist on November 15, 2019, 06:30:53 pm
That seems like a lot of noise. But I'm glad that is sorted because I was about to dust mine off and take some measurements. I like all the ideas and further insights, though. So a worthy discussion. :-+
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on November 15, 2019, 07:32:49 pm
It might make sense but your measurements don't support this theory. The charge drained into the sampling capacitor should cause a downwards step in the voltage at the start of the sampling time. Before and after the curve should be nearly flat. There must be something else going on. For example, schottky diodes have a significant leakage current. Or the pin might have a pull down enabled.

Of course the circuit works, but it is not to spec. The leaked charge causes a significant loss of dynamic range, iow, the tic resolution is far from the claimed 1ns.

PS: It really takes a lot of time to write a reply on the phone. By the time I finished, three other people responded to the same issue  :palm:
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on November 15, 2019, 07:39:10 pm
The noise could be induced by the probe (gnd lead?), as the input of the ADC is an HighZ circuit (10Meg). You would need a fet probe or something like that. Doublecheck the wiring, grounding in a single point (star scheme), short wires, good decoupling (ceramic 100nF capacitors at each chip's Vcc and Gnd, etc.).
The next step is to return all that firmware coefficients back to normal values and test the stuff again..

PS: the voltage drop (as you can see in the above simulation with 1k internal resistor) is rather small, and could be less visible when the internal resistor is at the higher side of the spec (100k) and the drop slope will be slower. Also the 14pF capacitor is connected internally to Vcc/2, my simulation is "worst case" therefore the 14pF is wired to gnd and the "drop is higher". Moreover his voltage drop is covered by noise, which p-p is 30% of the ADC range :)
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on November 15, 2019, 08:14:21 pm
Of course the circuit works, but it is not to spec. The leaked charge causes a significant loss of dynamic range, iow, the tic resolution is far from the claimed 1ns.
Well, if I were a conservative diy maker I would claim 1ns rms..
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on November 16, 2019, 01:38:32 pm
Now that my circuit is finally working as intended, I continued to make the discharge modification.

On the scope shot with the number ending in 3248, you can see the normal operation.
The blue trace is the "probed" ISR surrounding the ADC read cycle.
You can see that the capacitor slowly discharges during the sampling period. This means that due to the almost 200 ns jitter caused by the interrupt latency, there will be differences in the value read by the ADC. Not much, but we're dealing with ppb sensitivity, and I simply assume that every bit helps. Obviously, the discharge is higher than normal because I used a x10 scope probe to see the voltage level.

I modified the ISR a bit further with my proposed solution, and by using a digital port to discharge the capacitor at a planned point, while keeping the voltage level flat during the sampling period. Flat meaning that there will still be some discharge due to leakage and loading but this is as far as we can go with this solution. I used a free port, D10 and connected that through a 1K resistor directly to A0. The 10M resistor is removed from the circuit.

The code changes are as follows:

At the very beginning of the code, I added this:

// add a decharge for C1 after the ADC read cycle
const int decharge = 10; // Decharge pin for C1. Port is toggled between hi-0Z input and output driven low
const int probe = 12; // create a probing signal within the ISR

In setup(), I added this:

  pinMode(decharge,INPUT); // setup the port that will decharge C1
  pinMode(probe,OUTPUT);   // setup the port to allow a probe inside de ISR

Here is the modified ISR:

// Timer1 capture interrupt routine - this runs at rising edge of 1PPS on D8

ISR (TIMER1_CAPT_vect)
{
  timer1CounterValue = ICR1;  // read the captured timer1 200ns counter value
  digitalWrite(probe, 1);     // create a signal to probe the scope
  TIC_Value = analogRead(A0); // ns value
  digitalWrite(probe, 0);     // stop the probe
  pinMode(decharge,OUTPUT);   // change port from hi-Z to output
  digitalWrite(decharge, 0);  // force it to ground to decharge C1
  PPS_ReadFlag = true;        // gives the decharge cycle some time as well
  pinMode(decharge,INPUT);    // revert the port back to hi-Z

}

The "probes" are not there forever, when you're done, you can comment them out.

The next scope shot, ending with 4047, shows the C1 voltage level with the blue trace, and the probe around the ADC cycle in yellow. (channels are reversed from the previous picture) The voltage level is now very flat throughout, even though I still have my x10 probe connected.

Right after the ADC cycle ended, the voltage is forced to ground getting the hardware prepared for the next cycle. The timing works out very well, the discharge during one instruction and with 1K in series only takes a few micro seconds to complete. The 1K is only there because I don't like shortening capacitors, even though the stored energy in this case is minute.

My Isotemp replacement for the Bliley OCXO finally arrived, so I can start the full testing procedure again. Up until now, I had been using my modified FY6600 Waveform Generator as a replacement. You can set the frequency down in the micro Hz to make tuning by hand to the 1PPS possible.

Enjoy,

Paul




Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti on November 16, 2019, 01:57:32 pm
Take a look at the yellow trace right before charging the capacitor. It doesn’t start at zero. I think if you don’t hold it low until shortly before the pulse, it will recover a bit and you introduce more errors than you tried to correct.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on November 16, 2019, 05:48:21 pm
You have to discharge the 1nF via 1k for a bit longer than 1us.
Below the simulation - green is the 1nF voltage, blue is the 4046, red is the internal ADC's S&H and turquoise is your reset pulse 1us long.
I think based on the ISR source your pulse is even a bit shorter.
The green voltage will not go to zero based on the simulation.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on November 16, 2019, 05:55:49 pm
10us long reset via 1k will do.
Mind there could be some recharging of the 1nF through the reset pin (needs to be investigated)..
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on November 16, 2019, 08:37:13 pm
Miti, the yellow trace you refer to is the probe signal.
The blue trace is the 1nF cap voltage. The little marker at the very left side of this trace shows the ground level. I didn’t see a residual voltage, even with higher sensitivity settings.

Imo, I do take the simulation serious. Thanks for the effort.
Obviously, I can do two things. One is to lower the 1K to say 470 Ohm or even 100 Ohm or add a few dummy instructions in the ISR code, or do both. I’ll try that tomorrow and report back.

Thank you all for contributing to this nice project.
Sad that Lars is no longer with us to witness the continued activity of his brain child.

Paul
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on November 16, 2019, 08:49:41 pm
Fyi- the peak current via 100ohm resistor will be up to 9mA with 1V at 1nF. So I would rather use the 1k and longer reset pulse (10-20us). You are not in hurry, you can afford that delay, imho :)
PPS: ok, this is atmega :), handling the pins takes with digitalwrite() around 3us people say, the pinmode() maybe the same, so you are somewhere around 8-10us with your reset pulse..
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti on November 16, 2019, 11:25:40 pm
Aaah, my bad.  :palm:
Can’t you leave the pin as output until all the processing is done?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on November 17, 2019, 08:36:59 am
I took the easy way, and just added a small delay after the digitalWrite:

delayMicroseconds(10);

I know, you're not supposed to put delays inside ISR's, but in this case it's OK.

As a result, I see no visual change of any charge residuals on the scope, but better be safe than sorry.

Now back to adding my replacement (used) Isotemp 143-141 OCXO.
BTW, this one also has a flaw, there is no V-ref output.
Out of 4 tries, I'm still not very lucky with any of them. 
As it takes about 6 weeks each for delivery, buyer beware.

Enjoy!

Paul
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on November 17, 2019, 09:03:51 am
In simulation I see a residual voltage at the 1nF (before TIC measurement starts)
10Meg reset   4mV
1k       reset   9mV

Voltage drop from max voltage till end of S&H on the 1nF with 1k reset
100ns     2.3mV
500ns     8mV
900ns    13.2mV

And the TIC linearity with 1k reset (input pulse width vs. 1nF voltage at the end of S&H)
100ns   129.3mV
200ns   233.2mV
300ns   334.5mV
400ns   433.6mV
500ns   530.5mV
600ns   624.9mV
700ns   717.3mV
800ns   807.5mV
900ns   895.5mV
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on November 17, 2019, 09:21:21 am
In simulation I see a residual voltage at the 1nF (before TIC measurement starts)
10Meg reset   4mV
1k       reset   9mV

Not that it actually matters. As long as the voltage is well below the interesting center zone of around 500mV before the 1PPS pulse arrives, you're good. This is where the software should steer the loop towards anyway.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on November 17, 2019, 03:19:25 pm
imo,

Good job.
I can see a residual of a few mV in reality as well, but it is well hidden in the noise and is dwarfed by the voltage level of the pulse that is used to make the ADC measurement. I have not gone back to measure the condition with the 10M present with this sensitivity.

I concur with thinkfat that this tiny amount will not upset the PI loop much. As a minimum, it's very stable and repeatable, so we could even compensate the ADC value with this residual amount. That's easy to do, but does it make practical sense?

The original task was to remove random jitter effects caused by the interrupt latency in combination with the dis-charge caused by the 10M. I believe that has been fixed now.

BTW, my Isotemp based setup is working (with the above modification), and I got a lock within 10 minutes. Two hours later it's still locked and looking fine.


Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on November 17, 2019, 05:15:29 pm
The original task was to remove random jitter effects caused by the interrupt latency in combination with the dis-charge caused by the 10M. I believe that has been fixed now.
You had there something like 200ns p-p. Could you show how it is now?
Picture ending 4416.
The thermal noise of that reset 10Meg @20Hz BW (RC) and 25Celsius is 1.8uV rms (12uV p-p).
The ADC noise I would expect is something like 6LSB p-p, or 6mV p-p, or 6ns p-p.
The source of the 200ns jitter is the interrupt latency, it seems.
Also there is the NEO 1PPS jitter, easily up to 50ns p-p.

PS: the 1nF voltage difference for 500ns input pulse and S&H start jitter of 200ns p-p is 80uV.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on November 17, 2019, 07:30:32 pm
I've taken Miti's .csv file (replay #286), and calculated the standard deviation of the second column, for the situation when locked properly (1783 of data).
The standard deviation is 7.133ns, or 47.1ns p-p (6.6x).
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: bingo600 on November 17, 2019, 07:40:59 pm
Just found this nice PCB
https://github.com/Qw3rtzuiop/Lars-GPSDO-PCB

The pict(s) are for the rev1 pcb , not the rev2.

I just ordered a few on JLCPCB

/Bingo

I got my PCB's today ... Now what to use for 1nF cap ??
I don't think i have anything "good" , just some cermic
And maybe i got some Vima Red.

/Bingo
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on November 17, 2019, 08:26:40 pm
NP0/CG0 ceramic 1nF, people say the TDK are best (see above posts).
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: bingo600 on November 17, 2019, 08:45:42 pm
The

C2012C0G1H102J - is not available
Nor is this one : FA28C0G2E102JNU00

And i'll have to do a $50 order @Mouser to get free shipping  :(

Someone have a few ?

Or ... I have some "China" 1nF ceramic disk (The orange ones) , might try one of these for now

Edit: Got some NPO from here
https://www.ebay.com/itm/122455243378 (https://www.ebay.com/itm/122455243378)


/Bingo
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on November 17, 2019, 08:51:14 pm
For my own experiments I've now settled on using an actual DAC instead of PWM+filter, mainly for two reasons:

* using a DAC with embedded voltage reference will make the output less dependent on the supply voltage.
* The response of an integrated DAC is way faster than the PWM+filter. I've calculated that, using e.g. the STM32F030's timers to output a PWM, for 16bit resolution I'd end up with a PWM frequency of around 700 Hz and with a low-pass filter with a 0.1Hz cut-off frequency to reach <1mV ripple, while at the same time I'd see a settling time of close to 4 seconds. That's not going to be very responsive.

The structure is going to be similar to what has been suggested already, 10MHz into an HC390 which outputs 500kHz to a TDC7200, which also connects to the 1PPS output from the GPS and uses the 10MHz as reference clock. An STM32F030 to control everything, including an ADS5693R DAC. I decided to add an TLC2272 opamp as a buffer to the output of the DAC, I'll run it in 2.5V output mode and use the opamp to reach the voltage range of the VCO. Which will be, eventually, one of my LPRO-101 Rb standards. I've not yet decided if I'll add a NEO-M8T directly on the PCB or if I'm just going to provide a 1PPS input to the controller.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on November 17, 2019, 09:03:41 pm
Imo,
I’m currently running a first 24hrs test run for my new oscillator, and I need to activate the probes in the ISR again before I can run the ISR latency measurement again. I’ll do it tomorrow when I have the data collected.

You are obviously more adept and experienced with this, why do you think the latency could be different now? It is based on the 1PPS pulse and the start of the ISR. Nothing changed as far as I can tell. Even though we know that the 1PPS has jitter, that will not show up with this measurement, right?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on November 17, 2019, 09:13:17 pm
The 200ns p-p jitter comes mostly from ISR latency. It creates only 80uV p-p noise based on my calcs above. That is 50x smaller noise than the ADC noise I would estimate. So I would not be worried about.
The removal of 10Mohm helped to keep the voltage at the 1nF capacitor flat during S&H, that is an improvement.
The 1k reset with a pin will work, it induces some leakage and maybe noise but that needs to be measured somehow.
I think there is nothing to mess with at this stage, make the measurement, do log the data in a .csv file such you may analyze afterwards.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on November 17, 2019, 09:21:56 pm
.. I've calculated that, using e.g. the STM32F030's timers to output a PWM, for 16bit resolution I'd end up with a PWM frequency of around 700 Hz and with a low-pass filter with a 0.1Hz cut-off frequency to reach <1mV ripple, while at the same time I'd see a settling time of close to 4 seconds. That's not going to be very responsive.
The MCU based GPSDOs usually work such they set a new DAC voltage in some longer period, like 5minutes or 10minutes, etc. It is expected the OCXOs are stable enough not to be corrected each second.
The XOR analog ones work differently, they are correcting "continuously".

FYI - there was a good long discussion with a lot of experiments on PWM in the Metrology section - https://www.eevblog.com/forum/metrology/lm399-based-10-v-reference/msg2271156/#msg2271156 (https://www.eevblog.com/forum/metrology/lm399-based-10-v-reference/msg2271156/#msg2271156)
Btw there is the stm32F334 with 217ps PWM resolution :)


Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti on November 17, 2019, 11:25:28 pm
If anybody is interested, some time ago I tried a real DAC AD5693 instead of PWM and it seems to work well. I didn't try it in real GPSDO though only h1, h65535 and many in between. It should reduce the switching noise a bit.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on November 18, 2019, 02:33:12 pm
.. I've calculated that, using e.g. the STM32F030's timers to output a PWM, for 16bit resolution I'd end up with a PWM frequency of around 700 Hz and with a low-pass filter with a 0.1Hz cut-off frequency to reach <1mV ripple, while at the same time I'd see a settling time of close to 4 seconds. That's not going to be very responsive.
The MCU based GPSDOs usually work such they set a new DAC voltage in some longer period, like 5minutes or 10minutes, etc. It is expected the OCXOs are stable enough not to be corrected each second.
The XOR analog ones work differently, they are correcting "continuously".

Looking at Lady Heathers plots for DAC and Loop of the two GPSDOs I already have, the control loop adjusts the DAC every second (or every other second)...

Anyway, WIP schematics attached. I'm wondering about a few details, though:
* The layout guidelines for the TDC7200 suggest adding series resistors into the SPI lines. I've provided them, but I won't really need them if the layout is tight and the traces just a couple of millimeters, will I?
* Another recommendation is to have matched length START and STOP inputs. I think that's not relevant in my case, it will just skew the phase of the 10MHz against the 1PPS signal a little bit.
* I'm using a MC7805 for creating an 5V supply for the DAC and the Opamp (VDDA), with an added LC filter. Is that sensible?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: metrologist on November 18, 2019, 04:15:02 pm
 :palm: never mind about this.  Re: ISR discharge. Would it be better to set the pin open at start of the ISR and then leave it low on exit?

The MCU based GPSDOs usually work such they set a new DAC voltage in some longer period, like 5minutes or 10minutes, etc. It is expected the OCXOs are stable enough not to be corrected each second.

I don't know if the code addresses the PPS jitter but it seemed that one could leverage the relative stability of the OCXO to apply a correction. My GPS has a lot of short term jitter and it is cyclic, but it would seem long term timing would be accurate.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on November 18, 2019, 06:24:43 pm
1. The layout guidelines for the TDC7200 suggest adding series resistors into the SPI lines. I've provided them, but I won't really need them if the layout is tight and the traces just a couple of millimeters, will I?
2. Another recommendation is to have matched length START and STOP inputs. I think that's not relevant in my case, it will just skew the phase of the 10MHz against the 1PPS signal a little bit.
3. I'm using a MC7805 for creating an 5V supply for the DAC and the Opamp (VDDA), with an added LC filter. Is that sensible?
1. I would let the resistor's there. They limit EMI between those two chips as well (the 22ohm in 500kHz? - nope, the 22ohm should be put in all SPI lines).
2. do it as best as you can.. I would split the "10MHz" via 2xinverters into "10MHz for 390" and "10MHz for 7200".
3. LC filter is ok, even 100nH is rather on the lower side (1-10uH would be better, imho). Add 10-22uF MLCC into VDDA.
7805 - stability - the DAC has got its own 2.5V 2ppm/C Vref, afaik.
Critical are the R6/R7 - their TC. If you use 50ppm/C resistors the TC of the gain could be 100ppm/C easily.
Also doublecheck the TC of the TLC272 input offset (1.8uV/C).. I would create a VDDA1 for the opamp. And from opamp's output an RC low pass, like 100ohm and 10n.

7404 input 10MHz squarer (fed by 1-2Vpp sine) - that is also a critical component (jitter). Such a simple solution does not work well usually.
I would put an inverter into 1PPS as well, but not from the same package as the 10MHz ones (there are 5pin smd 74xx inverters/buffers available).
I would also add a capacitor at the input of the 7805. Also a serial diode into the 24V rail.
Provided your system will take 40mA @5V the power loss at the 7805 will be 0.8W with 24V..
You are missing one important component of the GPSDO - "Locked" LED  :)
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti on November 19, 2019, 01:40:44 am
May I have couple of suggestions?

* If you use inverters as buffers, you sine wave would be altered in case you use a sine wave OCXO, and I think a sine OCXO is preferable as it is more spectral clean. I would use high speed comparators.
* Some OCXOs need VC higher than 5V. It would be useful to the option to control the gain and offset of the VC above 5V. I've attached a schematic that I simulated some time ago. If R1/R2 and R7/R8 are trimmers, you can control the gain and offset of VC so your DAC will always work around 32768. And of course you should supply the opamps from 12V. Ignore the opamps that I selected, it was something fast.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on November 19, 2019, 11:00:14 am
1. The layout guidelines for the TDC7200 suggest adding series resistors into the SPI lines. I've provided them, but I won't really need them if the layout is tight and the traces just a couple of millimeters, will I?
2. Another recommendation is to have matched length START and STOP inputs. I think that's not relevant in my case, it will just skew the phase of the 10MHz against the 1PPS signal a little bit.
3. I'm using a MC7805 for creating an 5V supply for the DAC and the Opamp (VDDA), with an added LC filter. Is that sensible?
1. I would let the resistor's there. They limit EMI between those two chips as well (the 22ohm in 500kHz? - nope, the 22ohm should be put in all SPI lines).
2. do it as best as you can.. I would split the "10MHz" via 2xinverters into "10MHz for 390" and "10MHz for 7200".
3. LC filter is ok, even 100nH is rather on the lower side (1-10uH would be better, imho). Add 10-22uF MLCC into VDDA.
7805 - stability - the DAC has got its own 2.5V 2ppm/C Vref, afaik.
Critical are the R6/R7 - their TC. If you use 50ppm/C resistors the TC of the gain could be 100ppm/C easily.
Also doublecheck the TC of the TLC272 input offset (1.8uV/C).. I would create a VDDA1 for the opamp. And from opamp's output an RC low pass, like 100ohm and 10n.

7404 input 10MHz squarer (fed by 1-2Vpp sine) - that is also a critical component (jitter). Such a simple solution does not work well usually.
I would put an inverter into 1PPS as well, but not from the same package as the 10MHz ones (there are 5pin smd 74xx inverters/buffers available).
I would also add a capacitor at the input of the 7805. Also a serial diode into the 24V rail.
Provided your system will take 40mA @5V the power loss at the 7805 will be 0.8W with 24V..
You are missing one important component of the GPSDO - "Locked" LED  :)

I added the resistors in the start/stop signals because the sample layout from the datasheet has them, I guess I'll keep them as well, I can always replace them with a 0R bridge.

Regarding the input sine-to-square, I took that circuit from the LPRO-101 user guide. They use a 74AC04, however. There's also a variant with a 1:1 voltage divider at the input of the inverter and without the feedback resistor for self balancing, would that be better? The data they provide for phase noise seem ok, < -150dBc @100kHz, < -100dBc @1Hz. They describe a variant with a high-speed comparator as well (LT1016) but the phase noise is worse.

I'd rather not add an inverter in the 1PPS signal, the TDC manual says it's best to use the rising edge for both start and stop, also the 1PPS signal will anyway be quite jittery, so I'd rather take it as it is and not add another jitter source. The PLL in the MCU will have to deal with the original jitter anyway.

Regarding R6/R7 - I can use 25ppm or better there. Not a problem, resistors are cheap, even with 25ppm TC. 10ppm gets you into 0.5€ in single quantities, but they're readily available, too. I don't think I'll use trimmers here. They definitely have a worse TC than a precision SMD resistor. If I want to change voltage, I'd rather change resistors.

The opamp is actually a TLC2272A, but the offset voltage TC isn't any better, still in the 2µV/°C range.

Still, on the topic of temperature stability, wouldn't the control loop eventually correct the offset? Of course there will be a drift while the temperature changes, but if it happens slowly, the control loop will be able to keep up and stay in lock. It's important for the hold-over case of course, but then an active temperature compensation will be necessary anyway. The STM32 has a built-in temperature sensor, maybe it's good enough for that.

Regarding the power dissipation of the 7805 - I'm using a DPAK package and there will be ample copper for cooling. The variant I chose has a TC of -0.3mV/°C
However, I'm going to change that to a 12V type and rather provide separate point-of-load regulators for the digital and the analog parts, instead of trying to decouple the domains via an LC filter.

Single circuit inverters - there's indeed a lot of them available. But most of them have Schmitt trigger inputs, would that be a problem?

The 24V supply will be taken from another project of mine, I already have a small PCB for the LPRO with overvoltage and reverse polarity protection, I will reuse that circuit.

BTW, the LPRO-101 has a trimming range of around 3 ppb over 5V, or 0.006Hz/V. I don't think I'll be in trouble for this particular use case. But the design should be versatile enough to support a standard OCXO, too, with only BOM changes.

Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on November 19, 2019, 11:39:42 am
Schmitt triggers are ok. Except the squarer, it should stay 04.
I would try with the opamp first on a breadboard whether the opamp works as expected (input 0-2.5V, look at output).

PS: this is a squarer I've been using. Tune L1C1 for the input frequency. The LC is a parallel tank. Keep R1 and signal source impedance low.
It creates up to 6-7Vpp at the HC input. Will be limited by clamping diodes, so you will see almost a Vdd p-p square. HC14 should work too.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on November 19, 2019, 09:23:00 pm
Thinkfat,

My suggestion if I may, would be to move whatever is needed to square, buffer, drive and power the oscillator to a seperate board where the oscillator is on. This will allow you to test various oscillators while keeping the controller board universal.

I did the same with my prototypes and it allowed me to quickly change from a Bliley with sine wave output to an Isotemp with a square wave output. Also the circuit to drive the VC is most likely depending on the oscillator type, so it should go on that board too.

Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on November 20, 2019, 07:03:09 am
Imo,

I really appreciate your contributions and insights, although at times they can be a bit cryptic.

In a post just above you have this advice :” Schmitt triggers are ok. Except the squarer, it should stay 04.” Unfortunately, you don’t offer the reason or rationale.

When you discuss your own very interesting squarer design, you say “HC14 would work too.” As the HC14 is a Schmitt trigger, I’m a bit confused.
What is there against using a HC14 in a squarer in the first place?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on November 20, 2019, 07:10:02 am
Metrologist,
“ Re: ISR discharge. Would it be better to set the pin open at start of the ISR and then leave it low on exit?”
That won’t work because the ISR is activated after the TIC pulse is converted. I show that in a very early screenshot that shows when in time the ISR actually happens.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on November 20, 2019, 07:32:32 am
1. In a post just above you have this advice :” Schmitt triggers are ok. Except the squarer, it should stay 04.” Unfortunately, you don’t offer the reason or rationale.
..
2. When you discuss your own very interesting squarer design, you say “HC14 would work too.” As the HC14 is a Schmitt trigger, I’m a bit confused.
1. With the original squarer (7404) you put the 7404 into a linear mode (aka amplifier) by the resistor wired between output and input. It works with the standard 7404, it does not work well with Schmitt trigger (because of its hysteresis), however.

2. The wiring with an LC is using the LC as "an amplifier". The Q of the parallel LC tank amplifies and cleans up the input signal, so it works with 7414 as well.

You have to tune the L1C1 to the input frequency (ie 10MHz). L1C1 works as an amplifier and filter then - see below the amplitude of the signal at the 74HC input with 2 different C1 (25.2pF is closer).

PS: Below I added a "noise" to the input's 10MHz sine signal (a square wave ripple). You may see how the LC filter cleans the signal at the input of the 74HC up.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on November 20, 2019, 08:54:23 am
The output from a Rb-locked VCXO is usually not really noisy, however. In my case, I'm pretty sure I won't need a lot of cleanup before I feed the signal into a 7404.

Anyway I don't want to derail this thread any further. My own design is about as far from the "Lars DIY GPSDO" concept as it gets. I'll start a new thread on this board when I have the PCB done.

Thanks all for the valuable input!
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on November 20, 2019, 11:45:56 am
@thinkfat: do not forget to add an external flash (ie fram spi) for your calibration constants.
Also add serial resistors in TX/RX (both for NEO and PC uart), ie 100-220ohm.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on November 20, 2019, 03:11:13 pm
For the past couple of days I have been running tests on my new (used) Isotec 143-141 OCXO.
I already reported that this OCXO is partially broken, because it does not have a ref Voltage output.
The supplier gave me a full refund, so that's good.

I have been struggling with this OCXO however, and I want to share some of my observations.

The frequency out, with nothing attached to the VC input is just about spot on.
The adjustment range is pretty well centered at 1.9638V.
I have created a finer VC adjustment with a couple of resistors such that H1 will create a voltage of 1.773V and an avg of +186ns. H64K creates 2.152V and an avg of -200ns, resulting in a frequency delta of +/- 2Hz. The gain is calculated to be 170.

So far so good.
Attached are some Excel plots taken with a damping of 0.5 and a TC of 32. (Isotec.jpg)
The board with the OCXO is in a plastic container so no draft. The LM35 sensor is well pressed to the case, temperatures are stable.
Note the very regular swings in the ns and DAC values.
It seems to me that this OCXO is behaving weird and the PI does not get it under control. I do have a stable lock, but on my scope it looks jittery.

I have played with the damping factor, and when I progressively go to the maximum setting of 10.0, it's improving a lot, but far from stable. (Isotec d10.jpg)
As soon as I change the TC to a value of 100, I loose the lock right away.

What do you guys make of this specimen?


Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on November 20, 2019, 04:07:23 pm
FYI - I got the same with my OCXO in past (double ovenized Trimble thermo isolated) - and I changed to XOR analog one afterwards :) Either oscillation like in your picture, or large random walk. You also confirmed my above estimation of aprox. 50ns p-p noise.
I think it could be related to: a) too noisy OCXO (or its regulation loop), b) finetuning the PI regulator's coefficients, c) the period of the DAC corrections.

PS: one important measurement is to disconnect the EFC wire and measure the free OCXO walk against 1PPS.
PPS: d10 picture: your OCXO gain is aprox 10Hz/V. With 125 DAC units average drift (9.5mV) OCXO drifted 0.095Hz in 5000secs. That could be an initial drift after long power off. The loop compensated for it. An OCXO switched off for long time needs several weeks to settle, people say.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on November 21, 2019, 08:16:19 am
Here is the Isotec free running, with my hand-adjusted synchronization to the 1PPS.
The spikes are when the TIC counter overflows at the 0 and 1,000 ns points.

This is only about 1,000 samples, but overnight shows the same thing.

The OCXO itself does not seem to be the problem for the oscillation.

I have also attached the schematic I used for the Isotec with the broken VRef output.
Any suggestions for improvements?

Funny enough, with a damping of 10.0, I can now get up to a TC of 500 already without loosing my lock. (1,000 fails)
Maybe the extra powered-on time made the difference as imo already hinted at.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on November 21, 2019, 08:30:56 am
Short comment:
1. 78xx are the poorest performers in terms of TC and noise, it could be the fluctuations come from there (I would replace the 7808 with something better)
2. pot trimmer - I would avoid it, large TC of resistance and of wiper contact
3. resistors around the EFC input - should be low TC ones
4. LM35 - with longer wires put a "68-82ohm ser 10u MLCC" between its output and gnd (close to its pins).
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on November 21, 2019, 10:10:03 am
Free running picture - what is the 4usecs difference in 1000secs? I doubt it is the drift of your free running OCXO (aprox 4Hz in 1k secs)..
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on November 21, 2019, 10:19:01 am
According to control theory rules of thumb, if your regulator is oscillating, your gain is too high for the response time of the process. I part of a PI regulator can also cause oscillation, should be small against P.

If I understood Lars' PI regulator correctly, try with less gain and shorter TC? But I might be completely off, I'm far from being an expert. But TC much shorter than the settling time of your PWM filter doesn't make sense as well.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on November 21, 2019, 11:10:37 am
FYI - here is the Lars' PWM DAC simulation.
It settles in about 3.8secs from 0V to 1.35V.
The PWM freq is 480Hz (arduino lib). R4/5 are the ESRs.
The p-p ripple is about 10uV.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on November 21, 2019, 01:01:12 pm
There is no need to wire the start and stop pins together. The start pin will be wired to, for example, 1PPS and the stop pin to the OCXO's 500kHz. There will be none 4046. 7200 will measure the "time between the rising edges of those two signals" - it returns the difference "stop_rising_edge-start_rising_edge". Thus the same as it is today with analog TIC.
The 7200's start and stop pins are both rising edge sensitive.

I still have one question regarding the design you proposed - you've connected the 500KHz and the 1PPS signals to interrupt inputs of the MCU. I thought of only using the INTB output of the TDC to signal completion of a measurement to the MCU. That should be sufficient, no? Or did you have another reason to hook up those signals?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on November 21, 2019, 01:14:02 pm
I do not know. You are going to write your own fw so it depends. You may use the INTs based on the 1PPS and 500kHz edges as well for something. I think Lars' version is using that somehow (I do not use Lars' system).

PS: Lars is using the 5MHz for feeding the Timer1 (200ns clock) for some internal purposes - (ie. he captures the Timer1 value at the beginning of the 1PPS ISR, he uses "timer_us" variable for "timer1 value in microseconds offset from 1pps").

For compatibility reasons I would feed 5MHz to the TimerX input as well. You will see whether it is useful or not.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on November 21, 2019, 03:47:40 pm
imo,

I don't really understand what you mean with this "what is the 4usecs difference in 1000secs? I doubt it is the drift of your free running OCXO (aprox 4Hz in 1k secs).."

I have only shown one cycle, of many, many others during the long test.
Here is a bit larger section of the ns values during the free running oscillator run.
Does this clarify?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on November 21, 2019, 04:17:29 pm
That is what I'd expect with a free running oscillator with no correlation to the 1PPS signal. It's just a tiny frequency offset, you cannot make any conclusion on the OCXO drift from that. If the frequency is off, you'll see the two signals drifting in- and out of phase just as is shown there. You should be able to calculate the frequency offset from that data, too. It's like watching two almost-aligned signals on an oscilloscope in XY mode ;)
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on November 22, 2019, 09:39:53 am
I do not know. You are going to write your own fw so it depends. You may use the INTs based on the 1PPS and 500kHz edges as well for something. I think Lars' version is using that somehow (I do not use Lars' system).

PS: Lars is using the 5MHz for feeding the Timer1 (200ns clock) for some internal purposes - (ie. he captures the Timer1 value at the beginning of the 1PPS ISR, he uses "timer_us" variable for "timer1 value in microseconds offset from 1pps").

For compatibility reasons I would feed 5MHz to the TimerX input as well. You will see whether it is useful or not.

Lars used the 5MHz clock to extend the TIC range beyond the 1000ns the ADC is able to provide. However, the TDC7200 in Mode 2 can measure time intervals of up to 8ms. That should be plenty. No need to have a 5 MHz clock walking about on the PCB. I'm beginning to worry anyway if I can pull this off on a 2 layer PCB.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on November 22, 2019, 10:43:06 am
In theory you do not need the 1PPS and 500kHz interrupts, when using the 7200's INTB. In practice the signals could be useful ie. for detecting whether the NEO or the OCXO actually work (or are connected in properly).
Also clocking the STM32 off the OCXO's 10MHz could be an interesting option.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on November 22, 2019, 11:20:47 am
In theory you do not need the 1PPS and 500kHz interrupts, when using the 7200's INTB. In practice the signals could be useful ie. for detecting whether the NEO or the OCXO actually work (or are connected in properly).
Also clocking the STM32 off the OCXO's 10MHz could be an interesting option.

Yes, indeed, I've played with that idea, having a counter running clocked by (a multiple) of the OCXO clock and using the 1PPS as a capture event. But I think you don't need to clock the whole chip from the OCXO in that case, because the STM32 timers can do event counting as well. Also, you'd need to be very sure that the OCXO is connected before you switch from the internal RC oscillator to the external clock...
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on November 22, 2019, 11:35:03 am
The main reason for running the STM32 off the OCXO is its "synchronous operation" thus lowering interferences (beat frequencies), even not so critical with the 7200, but still, you want to chase picoseconds and uVolts :)
Afaik some HP high end counters used to use a dithering of their clocks to avoid that..
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on November 22, 2019, 04:01:38 pm
I took the time today to make two of the modifications imo suggested:
Quote
1. 78xx are the poorest performers in terms of TC and noise, it could be the fluctuations come from there (I would replace the 7808 with something better)
2. pot trimmer - I would avoid it, large TC of resistance and of wiper contact
3. resistors around the EFC input - should be low TC ones
4. LM35 - with longer wires put a "68-82ohm ser 10u MLCC" between its output and gnd (close to its pins).

Instead of using the 78L08 as the basis for the 4V OCXO reference voltage divider, I'm now using an LM4040 4.096V shunt. (fed through a 3K9 resistor from the 8V to get a 1mA current)
The result is so remarkable it is beyond belief! Gone are the oscillations and the instability. If your OCXO does not have a reference voltage out, make sure you use a real reference. I'll show some results later.

I also did 4, but there is little change however. I think I'm going to be using a filter in software later on. I don't think the current variations are going to help if I invoke the temperature compensation.

I'll do 2 and 3 if/when I go to a pcb layout. Right now I'm still playing and experimenting. Yesterday I got my CTI OC5SC25 OCXO, still fitted on the original pcb that was cut from the original. After de-soldering, a quick test showed it to be working, so I'll have another one that I can play with.

More later

Thank you very much for your insights imo!  :clap:

PS: it turned out that I was using a different setting for my measurement. The result with the reference is not that spectacular, but definitely a significant improvement.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on November 22, 2019, 05:10:27 pm
The basic problem of all PWM DACs is the stability and noise of the Vcc the drivers are powered from. That is usually the Vcc of the MCU.
I posted a solution in past afaik - the PWM's low pass driver could be created from those 5-6pin logic gates, while the gate is powered from a clean 5V.

An ideal component is for example the "Single-Bit Dual-Supply Bus Transceiver With Configurable Voltage Translation and 3-State Outputs" - https://www.ti.com/lit/ds/symlink/sn74lvc1t45.pdf (https://www.ti.com/lit/ds/symlink/sn74lvc1t45.pdf)
which is sot-23-6 package with 2 voltages - ie. you may drive it from an 1.8V MCU, and at the other side from 5V quality voltage regulator (the PWM filter side).
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on November 24, 2019, 01:41:52 pm
Hi all,

After I got my third OCXO, the CTI OC5SC25, I made some more measurements.
Because my other OCXO, the Isotemp 143-141 had a defective Vref output, I suspected the results a bit.
I didn't need to worry, the results are very close.

To accommodate the CTI, I tried to keep the same VC adjustment as I used with the Isotemp.  It turned out that the sweet spot for the CTI is at 2.62V, not quite in the middle of the 4V range, but it allowed me to use the same resistor network as with the Isotemp. The adjustment range is more than enough.

I adopted a different calibration method this time.
Instead of using my counter or DMM to set the midpoint by frequency or voltage, I simply started the program, set the DAC to midrange with h32767 and adjusted the VC trimmer such that diff_ns was around zero. I then switched to H1 and ran that for a minute. I copied the trace results to Excel and used that to calculate the average of diff_ns, and wrote that down. I then switched to H65535 and did the same. The results were +75 and -69, nicely centered, and that resulted in a gain of 455. The trimmer can be substituted by fixed resistors when this has been done, to remove some possible jitter temperature drift as was suggested by imo.

While playing around with different settings, I noticed an unexpected behavior that I want to share here.
I've learned that to get a feel for the whole system, it is best to start with a TC of 4, and the damping at minimum (at 0.5). This allows you to see the almost unfiltered results of the OCXO drift and the response by the program to stay locked.
In the picture below, that is shown by the first 650 samples. The excursions show that every second, the OCXO is nudged rather aggressively into shape.

If you now switch to a TC of 32, the default setting, the combination of the TC setting with the minimal damping is causing oscillations. This is the period from about 730 until 1200. This could be a "trap for young players", I certainly fell for it and I'm no longer young.

If you now add more damping, by setting it to 3.0, the oscillations are almost gone.

At about 1,540, I switched to a TC of 100. At about 2,000 I set the damping to 5.0. You can see the effects.

Note that with higher TC settings, the DAC output is progressively more filtered and so the excursions of the DAC output are limited in time and value. If you have an OCXO that drifts easily, it can get outside of the DAC compensation rate quickly, resulting in the system loosing the lock. The effect of filtering with a higher TC is much more aggressive than the damping factor.

I have also found that before you switch to a higher TC setting, you should have already the corresponding amount of "locked" time sampled by the system that the new setting demands, otherwise you'll loose the lock right away. I found it best to progressively increase the TC setting.

With both the Isotemp and the CTI, I have difficulty getting TC's above 500. With my now dead Bliley, I could get up to 1,000 easily. The Bliley has a much thicker casing then both the CTI and the Isotemp, maybe this is a factor because I have not yet activated the temperature compensation.

Enjoy!
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on November 24, 2019, 02:04:57 pm
I wanted to investigate the source and the amount of jitter that can be observed.
This measurement had been done before in an earlier post, but since I have more units, I could show additional information.

I have three different Ublox GPS modules.
I have a genuine NEO M8T, a fake NEO-6M and a fake NEO-M8N.
They are all on the same carrier. (I replaced one broken fake with the real M8T)

For the measurements, I used the NEO-M8T as the reference. Note that this unit is not completely set for the "timing" mode. Both GPS modules were connected to the same type powered antennas. The antenna cable going to the M8T is 4 feet longer. I usually have in excess of 10 satellites.

I triggered my scope from channel 1 connected to the NEO-M8T and monitored the other two separately.
The shot ending in 44 is the 6M and the other shot is the M8N.

The amount of jitter is about the same (about 50-60ns), and so is the position relative to the M8T.

From this it seems that it does not matter much which version you use, they all have the same 1PPS behavior.

While making these measurements, I noticed a missing or strange pulse every now and then on all three seperately.

Enjoy!




 
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on November 24, 2019, 02:20:40 pm
You may implement an "automatic adaptive setting" of the TC (time constant, should be higher than 4 secs, as 4 secs is the time constant of the pwm low pass filter) and the damping factor :)
Always start with safe values and slowly iterate to the optimal ones..

PS: is it possible to open the Bliley box (in fix the broken output)?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on November 24, 2019, 03:07:13 pm
Well, yes, that's about the expected outcome. If you have an unstable OCXO, you have to discipline harder or more frequently than a good OCXO, or it will drift out of lock. If your regulation is too slow (TC too high, damping to high), it will not be able to kick the OCXO back into phase.

You'll see this in the ADEV chart: At low tau (< TC) the Allen deviation is limited by the OCXO, at long tau (> TC) the Allen deviation is limited by the quality of the time signal from the GPS system. That is why using a TCVCXO or completely uncompensated VCO is rubbish. You'll end up having to use small TC's and high gain and of course the short term ADEV can never be better than the free-running stability of the oscillator.

Practical example: I have a 10-digit counter that can give me up to 1E-9 resolution with a 20 second gate time. It cannot average over multiple gate times. That means, ADEV with tau=20s must be better than 1E-9 or it'll be useless as a reference clock for this counter. A GPSDO with an unstable oscillator will not do, even though at longer observation intervals it will appear "stable".

I have also found that before you switch to a higher TC setting, you should have already the corresponding amount of "locked" time sampled by the system that the new setting demands, otherwise you'll loose the lock right away. I found it best to progressively increase the TC setting.

This is due to the integrative part of the regulator. You have to null it before switching TC, but that will give the DAC a pretty hefty kick. You can, however, try to use the integrator content as a switching criterion for higher TC. If I is around 0 for a longer time period (a couple of TC), you can safely switch.

The trimmer can be substituted by fixed resistors when this has been done, to remove some possible jitter as was suggested by imo.

The trimmer will cause a higher temperature drift, not jitter.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on November 25, 2019, 03:48:20 pm
In order to find the optimum TC, I used method number 2 from the description in Lars's document (page12).
I used a TC of 4 and a damping of 0.5, and plotted the live DAC values of the CTI OCXO in Timelab.

I don't understand the results I'm getting as I don't see the "intersect" where "a reasonable TC can be found".
I know it has to be below 500, because that setting causes the lock to be lost.

This is the first time I'm using Timelab, it can very well be a pilot error.

Any suggestions as to what the meaning of the plot is?

Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on November 25, 2019, 05:13:45 pm
Have you subtracted the linear drift? How the MADEV looks like?
Also you have it run for longer than 1 hour to get taus around 1000secs.
PS: you may log the data into the .csv file and then load into the Timelab.

When you convert the DAC values into "freq differences" by multiplying XXX x10^-12 (the figure 6) it is equivalent to measuring the OCXO frequency. So I do not understand why Lars suggested in the version 1 the "hold mode" (you do not make DAC corrections, free running OCXO, afaik) and the version 2 in "locked" one.

Maybe he forgot to mention you have to have the EFC wire disconnected?

With EFC wired you will see the picture as you have measured - as you are locked to GPS.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on November 25, 2019, 05:27:03 pm
In order to find the optimum TC, I used method number 2 from the description in Lars's document (page12).
I used a TC of 4 and a damping of 0.5, and plotted the live DAC values of the CTI OCXO in Timelab.

I don't understand the results I'm getting as I don't see the "intersect" where "a reasonable TC can be found".
I know it has to be below 500, because that setting causes the lock to be lost.

This is the first time I'm using Timelab, it can very well be a pilot error.

Any suggestions as to what the meaning of the plot is?

Well the first maximum is obviously your TC. Apart from that - no idea. Does Method 2 really call for a damping factor of 0.5? I'd leave it at the default.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: sundance on November 25, 2019, 05:29:56 pm
Quote
78xx are the poorest performers in terms of TC and noise
if voltage regulator noise is an issue here, maybe this is an interesting read/remedy:
http://www.wenzel.com/documents/finesse.html (http://www.wenzel.com/documents/finesse.html)
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on November 25, 2019, 05:44:34 pm
As you wrote above with TC=4 and damping 0.5 you got "almost unfiltered OCXO drift". That is good as it is equivalent to the version 1 (hold mode). By measuring the ADEV/MADEV you will see the unfiltered OCXO drift and 1PPS jitter, but it is still "locked" so the ADEV curve will not go upwards with larger taus (like with a free running OCXO), imho.


Your maximum below 10secs is the filter loop constant, then with taus>10secs it drops down - downward slope - Lars wrote it is the 1PPS jitter.

Quote
In the picture you see the downward slope from the PPS jitter. At some point the slope changes and the oscillator drift and noise is seen. At this “intersect” a reasonable TC is found. If the oscillator has a lot of drift the slope start to go upwards to early (remember that the I-term compensates for linear drift). One recommendation is to use the “subtract linear drift” in time lab.
[attach=1]

Let run it for longer time (ie 6-12hours) to see the "intersect with subsequent plateau" (if any :) ).
With 6 hours you will get up to 5000secs tau (at 1sec sampling period).

With your 1-2 hours long measurement the ADEV error in the 500-1000secs tau area is huge, it will decrease with much longer measurement (see below the "error bars" you may switch on), and the intersect becomes visible, hopefully.
[attach=2]

PS: the red curve above is for an OCXO which "jumps" - like loosing the lock - therefore the curve goes upwards with larger taus (typical for all "free running OCXOs").
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on November 26, 2019, 01:31:03 pm
I have started the test again, this time for 6hrs, and with a damping of 3.0. In earlier tests, I did use this damping factor, but it seemed to make no significant change.

As soon as the current test finishes, I’ll show the results, and I’ll field a few more questions,  but I already saw that my earlier tests were just a bit too short to register the change. They do now.

Thank you for the comments and suggestions so far.

Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on November 26, 2019, 01:50:29 pm
As has been reported earlier, the pwm stability is depending on the Vcc of the Arduino board. To address that, I want to use a better voltage regulator. Unfortunately, neither Mouser nor Digikey have the temperature stability in their selection criteria and my Google searches were fruitless.

Can any of you recommend a few types that fit the application, are easily and widely available and can be managed package wise by a hobbyist? SMD is not the problem, BGA’s and the likes are.

Thanks!
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Vgkid on November 26, 2019, 06:09:16 pm
What sort  of power draw are you looking at?
What about a current boosted voltage reference.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: bogdanbrudiu on November 27, 2019, 08:24:36 am
Hello, is this mini GPSDO PCB available for order or as gerber?

Hello for a few days testing versions of mini gpsdo. Very fast stabilizes OCXO.
(http://www.jo72.pl/kkm/gpsdo/1546033515401.jpeg),(http://www.jo72.pl/kkm/gpsdo/1546033412675.jpeg)(http://www.jo72.pl/kkm/gpsdo/1546033412764.jpeg)

Thanks to Lars for a very good project.

I wish you all happy and prosperous New Year

best regards

73 Marek SP4ELF
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on November 27, 2019, 11:41:45 am
Vgkid, your suggestion to look for a "current boosted voltage reference" got me on the right track. Thank you.

One of the first finds was the LT6658, a dual voltage reference. That looks like a great part to use for the Arduino supply and also for the OCXO reference voltage, or, If I decide to go to a "real" DAC, the reference for that. With 10ppm/C, that should work.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on November 27, 2019, 12:50:20 pm
Hmm, I would rather stabilize the output buffers as I indicated above in Reply #381. If not using those special voltage level buffers, you may use any 74HC logic in a non-inverting configuration and power the 74HC with your clean Vref. An example below.
[attach=1]
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on November 27, 2019, 04:03:16 pm
That is an interesting and simple approach as well imo.
I will certainly try that solution soon.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Satbeginner on November 27, 2019, 04:18:30 pm
Hmm, I would rather stabilize the output buffers as I indicated above in Reply #381. If not using those special voltage level buffers, you may use any 74HC logic in a non-inverting configuration and power the 74HC with your clean Vref. An example below.
[attach=1]

Hi all, I'm following this conversation with great interest!
Build the original Lars design about a year ago ( how time flies!) and consider upgrading my unit using the new suggestions being made here.

One question about powering the 74HCxx from Vref:

First we try to have the cleanest Vref possible, would using it for the 74HCxx not make it dirty again?

Just wondering,

Un saludo,

Leo
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on November 27, 2019, 04:32:07 pm
As promised, I would show the results of my earlier test, to find the optimum TC setting.
Below is the chart that has the earlier test with a TC of 4 and a damping of 0.5 and also the newer test with TC of 4 and a damping of 3.0
With the first test, I used the default setting for the duration, which is an hour.

I plotted the DAC values, that were converted into a frequency with the factor 2.2E-12 (my gain is 455) and I used the Frequency Difference setting.

When I did the test again for 6 hrs, it showed that I needed to do the earlier test just a little bit longer. Bummer!

I have included both the ADEV and the MDEV charts.
Both were adjusted with the "drift line" setting.

If I understand it all, the optimum TC should be at the start of the "flat line", in my case 800 with the MDEV chart. With the ADEV chart, it could even be higher at 1,000.

Earlier, I was not able to get up to that value, I would loose the lock already at 500.

I'm now running another test by which I very gradually increase the TC in smaller steps (t4, 32, 64, 150, 250 etc.) with several hours in-between to let the loop system settle.
I'll show those results later.


Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on November 27, 2019, 04:37:45 pm
First we try to have the cleanest Vref possible, would using it for the 74HCxx not make it dirty again?
You want to have the cleanest and most stable PWM DAC possible. Thus one possible approach is to detach the PWM drivers from the MCU (the major source of noise, imho) and feed them with an external clean voltage.
Vref in my picture above could be a separate one, not related to OCXO's Vref.

@dbldutch: happy to see it worked..
Intersect - I see it at 700secs with MADEV..  :)
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on November 28, 2019, 03:26:18 pm
UPDATED with finished chart

I was able to very gradually increase the TC value, and I'm now running at 700 seconds with a damping factor of 3.0 with a solid lock.
 
Below is the MDEV report that I started with 700s and a damping of 3.0. The filter is applied. Unfortunately, even 18hrs is not enough to bottom-out. Bummer. But, it looks like I'm on the right track.

What I still don't get is the hump in the beginning (from 0 to 11 seconds). I don't see that in any of the other charts people have made. Can somebody explain this?

In earlier tests, I was probably too fast switching from a TC level to the next, or took steps that were too large. From what I gathered, you need to have enough data fed to the PI controller so it is stable enough before you can take the next step.

Some of you have commented on automating this procedure. It would be nice if you could explain in detail what you have done. Most importantly are not only the TC step size going up, and on what condition(s), but also what to do when you loose the lock, or are moving towards loosing the lock. This would be a nice addition to the code Lars wrote.

PS the title in the graph says t4, but I forgot to update the text before I started a new one. The test was run with a TC of 700.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on November 28, 2019, 05:50:03 pm
I don't have a particular implementation in mind, but it seems natural to detect a stable lock by looking at the integrator state for a longer period of time. If you find it's staying close to 0 for many TC, it will not hurt to increase it. If its value increases continually it is an indication that the loop cannot keep the lock and a shorter TC should help.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on December 01, 2019, 09:05:49 pm
Because I have two broken Bliley OCXO’s, both without the 10MHz output, I contemplated opening them up and see if I could possibly fix them.

Not that I had high hopes of fixing them, but I was interested to find out what is in the little cans as well.

Luckily, I didn’t need to get destructive, it had been done before:

https://www.eevblog.com/forum/metrology/teardown-of-bliley-ocxo-module/25/ (https://www.eevblog.com/forum/metrology/teardown-of-bliley-ocxo-module/25/)

After seeing the complexity of the circuit and difficulty in opening the can, I’m pretty sure my efforts would be fruitless.
They will get a good and final resting place.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on December 04, 2019, 03:06:03 pm
I finally got the replacement for a Bliley OCXO that I ordered after I had 3 dead ones.
This is a NV47M1008, the M indicating it has a CMOS square wave output. Makes it easier for this application.

The circuit I published earlier has been modified and I implemented the suggestion from imo to separate the DAC PWM signals from the Arduino circuit with a pair of HC14's, to make it cleaner.

Because I don't have a better voltage reference in my stash that can drive a few mA, I used an LM4040 4.096V Zener shunt. At this moment I'm unsure if it's better to also power the VC circuit from this reference. Currently, because the Bliley has a 4V reference voltage, I'm using that. I can be convinced that it's better (temp co-efficiency) to have both circuits powered by the same reference voltage. BTW, I tried to use the Bliley V-ref to power the HC14 to no avail, as can be expected.

Here is the circuit I'm using for this OCXO. It can be easily changed for other types and brands.

With the current resistors for the DAC and VC offset, my gain is 231, a little on the low side. The ideal value should be around 500. After a few days of burn-in, I will raise the value of the 68K to 82K to reduce the frequency span, which is 3Hz at the moment.

Tests are running, I'll report them later.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: metrologist on December 04, 2019, 03:36:33 pm
Now the fun begins. I'm amazed that you guys achieve such high TC. It would work for a while but always lost lock within a week. Maybe the CTI OCXO is just too drifty (but is that what Miti uses?). I never got around to setting up some MTI OCXO's I had because they are 12V units and would tune 0-10V. A lot of interesting ideas to think about now...
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: bingo600 on December 04, 2019, 07:49:14 pm
implemented the suggestion from imo to separate the DAC PWM signals from the Arduino circuit with a pair of HC14's, to make it cleaner.

I see most timenuts uses HC04 AC04 as buffers , they say it's cleaner than than HC14.
Prob. the Schmitt that adds hysteresis.

Ie.
https://www.tapr.org/kits_tadd-3.html (https://www.tapr.org/kits_tadd-3.html)
http://www.tapr.org/~n8ur/TADD-3_Manual.pdf (http://www.tapr.org/~n8ur/TADD-3_Manual.pdf)

/Bingo
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on December 04, 2019, 08:09:25 pm
Experienced timenuts would advice you not to put logic gates, which work with different clock domains, into the same package.. It may come to "pulling", "beating", etc.  :)
I wished someone measured those effects..
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on December 06, 2019, 01:54:26 pm
I'm struggling with my 4th Bliley, a model NVA47M1008 OCXO with serial number 285 0603.

I see massive jumps making this specimen practically unfit for this application. I'm not showing this, but the system recovers eventually.
This happens every couple of hours.

I've seen others reporting oscillator jumps, Lars included, unfortunately, they did not provide much information.

Not sure if this is a typical case, please chime in if you know more.

Another Bliley hits the dust.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: metrologist on December 06, 2019, 06:00:33 pm
Would that be on the order of a phase inversion? I seem to recall something about A/B/C mode operation of the oscillators, but not that they would switch modes during operation. I've had some power up in 'B' mode, 10.7 or 10.9MHz.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Leo Bodnar on December 06, 2019, 10:44:58 pm
I'm struggling with my 4th Bliley, a model NVA47M1008 OCXO with serial number 285 0603.
I had massive injection locking problems with cheap Blileys.  They were 100MHz but internal design was similar to 10MHz.  Watch out.

I am curious as to why you are using internal Vref for the tuning voltage base?  You are loading already very simple internals of the OCXO. Vref is generated internally by nothing more than a cheap 4.0V LDO which is then followed by an emitter follower (or capacitance multiplier if you will) and designed to be used as a crutch for a tuning trimpot in cases when there is no electronics around the OCXO.  Tuning voltage is not ratiometric to Vref, so you just need a good stable low noise voltage - you probably already have it on your board elsewhere.

What I still don't get is the hump in the beginning (from 0 to 11 seconds). I don't see that in any of the other charts people have made. Can somebody explain this?
Do you have any running averaging going on in your data?  Averaging will artificially improve ADEV or MDEV for shorter tau and will look like a hump.
Cheers
Leo
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti on December 07, 2019, 03:00:30 am
I'm struggling with my 4th Bliley, a model NVA47M1008 OCXO with serial number 285 0603.

I see massive jumps making this specimen practically unfit for this application. I'm not showing this, but the system recovers eventually.
This happens every couple of hours.

I've seen others reporting oscillator jumps, Lars included, unfortunately, they did not provide much information.

Now that you mentioned , that may be the issue with my Lars GPSDO. Something “jumps” randomly and I didn’t figure out what is it. It may stay locked for months, then loose lock few times a week. Every time it shows a big jump in ns. Details in some posts not to far above. I’m using a Bliley NV... something from Ebay
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on December 07, 2019, 01:21:02 pm
Hi Leo,

Thank you for chiming in.

I used the Bliley Vref in the hope it would provide a better thermal "connection" to the frequency setting circuit because the Bliley Vref circuit is inside the ovenized enclosure.
With all the data we collected, it's probably better to not use the Vref output on any OCXO at all and use a separate Vref circuit that can power the complete DAC circuit.

I tried an LM4040 4.096V Zener to power the DAC with the HC14 circuit, but there is still too much jitter.

Maybe a bit overkill, but I'm now using a 5V reference, the REF02EZ and I switched to my CTI OCXO again.

I use the Lars program to collect the DAC data, so there is no extra filtering afaik. I have seen some small humps in other charts, but none as big as mine. I'm not sure that bigger is better.  ;)
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on December 07, 2019, 03:39:28 pm
Could it be a bug in the software?Some integer overflow not handled correctly?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on December 08, 2019, 08:49:41 am
After switching back to my CTI OC5SC25 OCXO, I ran a new measurement with the modified PWM DAC setup to determine the optimum TC value.
This test setup is explained in Lars's document as option 2 on page 12. I used a TC of 4 and a damping of 3.0.

The results are astonishingly different.  :-//

Please help me to explain this vast difference.

Not very scientific, but this has changed between the two test setups:
1. The first test ran with live data, the second is an import from Excel made from the Arduino serial monitor.
2. With the first version I used a current boost circuit to reduce the temperature of the 7805 voltage regulator. With the second setup, I only use a 7805 regulator. (see the circuit diagram in the post just above)
3. For the second setup, the PWM/DAC circuit was moved from the Arduino board to the OCXO board and I added 100nF caps in parallel to the 4.7uF Tantalum caps. The PWM/DAC outputs (D3 and D11) are now connected through 20cm Dupont patch cables. In the previous version, these cables connected the output of the DAC circuit to the oscillator board. All connections between the two boards are made with these cables.
4. The second version uses the 74HC14 per imo's suggestion to reduce DAC noise from the Arduino supply.
5. For the second version, a REF02 5V precision voltage reference was added to supply the complete PWM/DAC circuit.
6. The gain for the first setup was 455 with an f delta of 1.4Hz, the gain for the second setup is 303 with an f delta of 1.1Hz.
7. Note that both setups already had the 10MOhm removal modification implemented. See my earlier posts.
8. The dip in the OSXO temp in the beginning is the dropping of the ambient office temperature for the night.
9. The OCXO board is covered during the tests by a plastic container to reduce draft effects.

My questions:
1. The mysterious (for me) hump in the old setup is gone. Why?
1. Are the hardware changes plausible cause for these results?
2. Where do the wriggles/oscillation come from in the new setup?
3. Why are the ADEV and MDEV charts so different for the new setup? (both have the drift line filter applied)

Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on December 08, 2019, 09:15:33 am
Your MADEV's sigma at tau=1000secs is now 1000x lower than in previous measurement.. That's suspicious..  :)

The oscillation - it could be you now operate in a sigma region where more finetuning is required.

I would boost the REF02's output current with a PNP and 220ohm resistor. It should not have any impact on noise and stability of the REF02's output. Add a 10uF tantalum (parallel 100n) at the output. For example:
[attach=1]
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on December 08, 2019, 09:26:00 am
If you're talking about the hump at tau = 4s, that would be the effect of your control loop TC combined with the settling time of the PWM DAC.
If it's missing in the second setup, the settling time of the PWM DAC must have dramatically changed. It's now completely masking your loop TC.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on December 08, 2019, 10:01:06 am
I would also calculate the rms values of your above measurements (ns, DAC, ns-diff) - good for comparing the configurations. In your excel:
=STDEV.P(C:C)
where the ie. C is the column with your data.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on December 08, 2019, 11:12:45 am
I do not see a significant change in the PWM DAC settling time with the HC14 buffer - about 2.5 seconds in dbldutch's wiring.

My improvement N3.: I would wire a choke (10uH-100uH) in series with the EFC (at the OCXO's EFC input), best made of a small toroid. It will dampen 10+MHz leakage off the OCXO into the DAC.

Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on December 08, 2019, 12:26:42 pm
Quote
1. The first test ran with live data, the second is an import from Excel made from the Arduino serial monitor.
Doublecheck your TimeLab settings. It could be you made a typo in the "Numeric Field" multiplier setting..
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on December 08, 2019, 03:09:33 pm
Hi all, thank you for the inputs. Interesting puzzle eh?

Here are some answers:

@thinkfat:
The most significant change has been the move of the PWM/DAC circuit to the OCXO board. Previously, I "transported" the very sensitive output with two un-shielded 20 cm wires to the OCXO board. Now the digital outputs are send across the wire and the whole (sensitive) circuit is close to the OCXO. That might explain the hump removal?

@imo
The standard deviations are :
ns 6.946
DAC 373.856
OCXO temp 0.226
diff_ns 9.552
filtx10 44.760

I have attached the Timelab settings for both measurements. The only obvious difference is in the Numeric Field. This value is calculated according to Lars's document on page 12 as 1E-9/gain. I already listed my gains. (Using e12 or E12 makes no difference)
I don't see a glaringly obvious explanation.

According to my reading of the datasheet, the REF02 should be able to deliver 10mA, and that should be more than adequate. I will try your suggestion.
I'm not sure I have a choke that I can use. I'm not very experienced with them, so I will have to research and learn and see if I have something in my stash that I can use or modify.

If (big IF) the modifications are indeed the cause of the major changes, my next step would be to try a "real" DAC with a reference, built in or not, like many of you suggested or already use.

I'm now running a test with a TC of 500 and damping at 3.0 and the prelim. results are strange as well.

Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on December 08, 2019, 03:39:39 pm
I think the MADEV values below 1e-12 at tau=1000 are pretty unrealistic numbers, unless your OCXO is a fake and it is rubidium or cesium inside .. :)
The new PWM DAC cannot introduce such a huge difference, imho.
There is an issue somewhere..

The 5V/10mA could be ok for driving a 10k pot trimmer, but you have got there 4x HC14 inverters, which pull some current when in transition 0/1/0.

PS: the bottom "peaks" of the madev are spaced in 60secs period, it seems..

PPS: could you post your raw data from the last measurements, plz?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on December 08, 2019, 04:21:10 pm
@imo,

Here is the zipped Excel file with the latest numbers of entries of the current test with TC 500 and damping at 3.0.


Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on December 08, 2019, 05:58:49 pm
What I see off your data:
1. raw DAC data, 20.3 units RMS
2. madev with DAC*3.3e-12, freq difference, all trends subtracted
3. freq diff
4. setting
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on December 08, 2019, 07:14:40 pm
You have imported 3rd data column off the file, that are the "seconds" of the time information. Therefore the peaks with 60seconds period in your MADEV.
You have to import the 6th data column off your file.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Leo Bodnar on December 08, 2019, 10:40:28 pm
What do these ADEV and MDEV charts actually measure?
To measure stability of an oscillator you compare it against another uncorrelated oscillator.
To get to true 10-13 level, both of these uncorrelated sources should be at (actually, slightly below) that level.

Now, ADEV/MDEV are just statistical tools - like SD - and can be applied to any sequence of numbers.
But if sources are correlated then the results are not trustworthy or meaningful.
In extreme case, measuring a clock against itself will result in zero ADEV and MDEV.

Cheers
Leo
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on December 09, 2019, 08:29:23 am
What do these ADEV and MDEV charts actually measure?
It is a method suggested by Lars - "Finding optimum time constant and setting linearization parameters" - see his .pdf guides at the beginning of this thread.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on December 09, 2019, 08:51:34 am
Well imo thank you for clearing this up!

This column or numeric field selection in TimeLab is mighty confusing for new players, like me.

If you look at figure 6 on page 18 of the Lars document, you can see that he used Numeric Field # 3 when he collected live serial data. That is also what I used when I collected live serial data. When I switched to importing the data from a CSV file, it all went to hell because in this mode, TimeLab treats the Numeric Field information differently and I continued to use field number 3, and that was my trap. Or is it a TimeLab ambush?  ;)

When you're dealing with the Arduino Serial Monitor, the columns are very well defined.
When you import them into Excel, the individual columns are put into individual cells.
When you export the Excel file to a CSV file, the individual cells are separated by either a "," or ";" depending on your country setting I believe.
All intuitive, universally understood and simple and Timelab in the live collection mode works the same way.

The following is my understanding of what I did wrong in the importing mode and gathered with your help.
First of all, I assumed the correct field based on the live mode and also CSV fields and never looked at the explanation that is in the attached file. My bad.

When you import the CSV file (=data from ASCII file) into TimeLab, it does not understand the CSV format.
It puts everything beginning with a + - . or [0-9] into a field. The field separation can be any other character.

In my case, I imported this into Timelab:

11:26:16.279 -> 72470;6;32905;51,9;Locked;-18;1848;500;250;
Using the Arduino/Excel/CSV format, the DAC value is in the third field. and that is what I used all along with all my import measurements.  :palm:

If I now understand it correctly, TimeLab creates the following numeric fields from my CVS file:

1: 11:26:16.279
discarded "->"
2: 72470
3: ;
4: 6
5: ;
6: 32905  <== the one we need
7: ;
8: 51,9  (note that this notation is due to my country setting. It can also be a period "." as the decimal separator)
9: ;
Discarded "Locked"
10: ;
Etc.

EDIT Nope, still got it wrong, see imo's explanation below.

Is my understanding (and explanation for other young players) correct?

Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on December 09, 2019, 08:59:19 am
What do these ADEV and MDEV charts actually measure?
To measure stability of an oscillator you compare it against another uncorrelated oscillator.
To get to true 10-13 level, both of these uncorrelated sources should be at (actually, slightly below) that level.

Now, ADEV/MDEV are just statistical tools - like SD - and can be applied to any sequence of numbers.
But if sources are correlated then the results are not trustworthy or meaningful.
In extreme case, measuring a clock against itself will result in zero ADEV and MDEV.

Cheers
Leo

The reference is in a way the 1PPS signal from the GPS, through the control loop of the GPSDO software. The DAC output values come from the control loop and are a representation of the phase difference between the 1PPS pulses and the oscillator output zero crossings. Provided the control loop works (especially the smoothing of the jittery 1PPS signal out of the GPS receivers), the calculated ADEV and MADEV are actually somewhat meaningful, but a numbers in the 10-13 range are very likely a scaling error when calculating the frequency from the DAC output.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on December 09, 2019, 09:00:12 am
The TimeLab considers only numbers starting "+", "-", ".", "0/1/2/../9" and ignores any other strings in between (PS: numbers incl. floating point, like "-123.456e78", ".123E-45").
TimeLab user manual:
http://www.miles.io/PhaseStation_53100A_user_manual.pdf (http://www.miles.io/PhaseStation_53100A_user_manual.pdf)

Quote
11:26:16.279 -> 72470;6;32905;51,9;Locked;-18;1848;500;250;

The numeric fields in your above case are therefore:

1: 11
2: 26
3: 16.279                    <------ your wrong field (seconds)
4: 72470
5: 6
6: 32905                     <== DAC: the one we need
7: 51
8: 9 
9: -18
10: 1848
11: 500
12: 250
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on December 09, 2019, 11:12:09 am
Here is an example of MADEV (all trends subtracted) of 100000 random DAC integer values (32100+/-1) with 3.3e-12 multiplier (1sec sampling, 10MHz, freq diff):

min: 32099
max: 32101
std: 0.816
aver: 32100.00032
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on December 12, 2019, 08:28:50 am
Thank you all for the inputs and suggestions.
Now that I learned what I did wrong, I can start to compare various conditions.
I implemented the two additional suggestions from imo , and added the current booster to the reference and the 33uH inductor in series with the Vcontrol input.
This is now my hardware version 3.

Below are some preliminary results that I'm collecting.
The TC500 run was without the above modifications, my version 2. During this run, I noticed three periods without a lock. With an improved enclosure of the OCXO circuit, I hope to prevent that. The processor board and the GPS module is still in free air.

The next two runs were with version 3 and a TC4 to find the optimum TC, and after that a run with TC32 to see the effects.
Currently I'm running with TC200.

I'm still trying to profile this CTI OCXO and at the same time burning it in. The Bliley and Isotemp OCXO's are also burning in at the same time, just connected to a 5V supply.
From other postings, I understand that it may take weeks if not months for these OCXO's to stabilize again after their to be expected rough handling during removal of circuit boards and the rough handling during the transport.

My goal with these postings is to show other non-time-nutters that want to implement this simple and elegant design from Lars what the potential pitfalls are and what to expect.

Something is wrong with my setup or with the OCXO, because the adev/mdev charts show curves with higher TC’s that are progressively worse than with a TC of 4.

Please chime in if you see something worthy of sharing.



Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on December 12, 2019, 05:39:45 pm
Could you post the raw data for "CTI tc4 a3.0 V3" plz?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on December 12, 2019, 08:31:06 pm
Hi imo, here it is.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on December 12, 2019, 09:21:47 pm
Interestingly the MADEV's DAC sigma at tau=1000secs with my above stddev=0.816 (2 LSBp-p) is the same as in yours data with sttdev=375 (3341 LSBp-p).  ::)
PS: your file is not .csv as you are using semicolon..
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on December 13, 2019, 04:19:03 am
@ imo, isn’t that to be expected with a TC of 4 and minimal damping?

PS Technically, you are correct. As I explained in my post #427, the CSV separator depends on your country setting, and has to do with the decimal separator. In my part of the world, the decimal separator is the comma “,” so that can’t be used as the CSV separator, which is why Excel uses the semicolon “;” instead. You should however be able to import the file with Excel as CSV, regardless of your country setting.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dr pepper on December 13, 2019, 09:12:18 pm
I have built a couple of freq standards, using terrestial signals, but I fancy something a little more accurate.
Looking at Lar's project this looks like my kind of thing, esp the hardware simplicity.
Any pointers on this project before I start.
I built a circuit using a Dds chip Si5351 using Gps to discipline it, however I cannot get the thing better than 1e-9 or so, so an ocxo I think is the next step (I did ovenize the Si5151 module).
I put togther a webserver using an Esp8266 for this, some parameters are shown on gauges, and others on a google chart over a period of a few days, might interface this to it as well.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on December 16, 2019, 08:40:39 am
While still tweaking, fiddling and learning, I have made another run to show the performance (I think) of the system as a whole.

With a damping of 3.0, I switched the system to the hold mode (h0) and tracked the result.
As to be expected, with the DAC output fixed, the frequency from the OCXO should drift away from the 1PPS reference. I was running with a TC of 4, so when I hit the h0 command, the DAC output level was not at the optimum lock level, which drives the level of the ramp. I don't think that matters much for this measurement.

From my understanding, even though the OCXO should be steady as per the specifications (+/- 0.5PPB/day), we still have the "system" jitter to account for, so there will be no pure straight line.

It's interesting to see the results though.
My steady "system" jitter is about +/- 20 nsec as you can see in the diff_ns report. I have no idea if this is good, bad or average.
However, I still experience anomalies in this report that I assume are coming from the GPS module's (NEO M8T) 1PPS signal. Although I always have about 10+ satellites with a lock above the 20dB level. Maybe it has to do with the fact that I don't have a clear view of the whole sky and satellite coverage is switching too much. My powered 28dB active antenna is outside on the window sill, almost at the corner of the third level of a 4 level apartment building facing East. The Sky View picture shows this.

So far, I've only been tracking the output from the code through the Arduino IDE serial monitor. Unfortunately, that ties-up my laptop (with limited USB ports), and there is limited storage before the output overflows. I'm now using a vintage Model B Raspberry Pi to monitor this output, and continuously log that into daily rotating logs. I will now also start to add the logging of the NEO-M8T as well to see if I can correlate anything to the diff_ns wiggles.

[UPDATE]
While playing with the recorded messages in u-center, it didn't take long to see major glitches. I looked in the corresponding Arduino log, but did not see a corresponding problem. I’m pretty sure this is the cause for the glitches I see on the scope, probing the output of the 4046. I have a picture of that several posts up.
Note that most satellites are gone over a period of a few clicks!

Any suggestions?
 



Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on December 16, 2019, 08:49:47 am
Just a sidenote: If you have a RaspberyPi connected to your GPSDO, you can run LadyHeather on it. The 6.14 beta version (and I believe earlier versions, too) support the "Lars GPSDO" to some extent. I think, however, that it only connects to the GPSDO command console and not to the GPS receiver at the same time so it may not be as useful.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on December 16, 2019, 09:31:09 am
Quote
My steady "system" jitter is about +/- 20 nsec as you can see in the diff_ns report.

The NEOs 1PPS jitter is 40-50ns p-p, thus I would say it is "normal". Also TIC jitters as well.

To make a "self test" you may create 1PPS off your 10MHz OCXO and feed it to the 1PPS input (there are 8pin PIC dividers binaries for this purpose available). That may show you the performance of your "TIC system".

http://leapsecond.com/pic/picdiv-list.htm (http://leapsecond.com/pic/picdiv-list.htm)
http://leapsecond.com/pic/picdiv.htm (http://leapsecond.com/pic/picdiv.htm)

Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on December 16, 2019, 11:25:14 am
@thinkfat Yes I know, but I would like to start to log both sources with a precise time so I can reconcile them.
u-blox center is my preferred way of dealing with the NEO's. I also want to be able to program the NEO, and the Lars system on the fly.

@imo I have a DIY programmable counter that uses 390 dividers. It will take some soldering to create an external 10MHz input, instead of the internal XO that I currently use. This was my plan all along, I may expedite that now.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dr pepper on December 17, 2019, 08:47:28 am
Ok, as I mentioned I did play with this the weekend.
After fiddling with gain & time period I got the thing to lock with my ebay 10 mc ocxo.
Now on to the fine tuning, I have a couple of 63mc ocxo's, I want to get this to work with one of those, so I'll change the required variables in the code.
I notice the code stores the 5mc reference frequency /100-1, ie 49999, that being the case I'll see if I can retune my ocxo to a suitable value, and come up with a replacement constant.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on December 21, 2019, 10:45:52 am
Today I rigged-up my setup to measure the overall jitter of the TIC portion of the GPSDO system.
I ordered the PD10 PIC divider from Leapsecond, but have not received a reply or confirmation from Tom yet.

Not wanting to wait, I took the 10MHz output from the CTI XO and connected that to my home build programmable frequency divider that uses 74LS390 decade counters.
Set to a 1PPS output, the signal of that instrument was fed into the system by taking out the GPS module and feeding it into the 1PPS input.

My scope was triggered on the 1PPS output from the frequency divider, and I used the second channel to measure the pulse at the output of the 4046 at the anode of the diode.

I was pleasantly surprised with the average jitter of only a few 100 ps, but also a bit unhappy about the random anomalies.

Overall, the jitter contribution of that part of the circuit is below 1ns. My assumption is that this is mostly coming from the HC4046.

Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on December 21, 2019, 01:55:31 pm
For the past 4 days (390,570 seconds), I have been logging the serial output with my RPi.
The GPSDO setup was with a damping factor of 3.0 and a TC of 200.

Below are some of the results in Excel that clearly show the effect of the ambient temperature on the system.
Both circuit boards are in plastic containers (of the Chinese food kind), with slits for the wires, so no draft.

You can clearly see when my room temperature goes up in the morning, and down for the night.
The last bit was recorded when we were not home, and the heating stayed at the night temperature. That portion of the graph is pretty flat.

I'm still seeing unexpected Allan Deviation graphs, so I continue to have difficulty fully trusting my setup or my pilot skills.
The following ADev and MDev charts are very different from what you would expect and see in most other cases, although Miti in post #72 has this too.
The graph goes up over time to a lesser precision instead of down to a higher one.
Lars has this advice "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." However, I have no explanation for this. Do you?

The last graph shows the frequency differences (FD) and that seems to show that the system is working reasonably well.
The highest spike shows a frequency of 10,000,000.004 MHz, and the lowest 9.999.999,997 MHz, limiting the results to the E-10 range.

As these deviations seem to come from the temperature effects, my next task is to see if I can reduce that with the compensation factor.


Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on December 21, 2019, 02:16:18 pm
A day has 86400 seconds. You have a big hump at around 40000 seconds, right? So, there's a disturbance twice a day, which would match with your heating starting in the morning and shutting down for the night.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on December 21, 2019, 05:34:37 pm
Your DAC data show your peak-peak during the most quiet period is 3E-10.
That is +/- 1.5mHz @10MHz. Pretty good result, imho.

MADEV - fyi Lars explained in his Reply #76 Miti's ADEV (in response #72) similar to yours..
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on December 22, 2019, 02:57:38 pm
I found this document from William J. Riley about frequency stability analysis techniques. See e.g. pages 47ff. for discussion of environmental effects (e.g. cyclic temperature changes).

https://drive.google.com/open?id=18Jwq-yZ_-3jfLXzhpwFXJr-n2OQAFen-
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Leo Bodnar on December 22, 2019, 07:06:50 pm
If you are looking to identify regular periodic interference, especially, narrowband disturbance like mains hum or leaks of internal signals it is much better to use regular spectral analysis.

ADEV can be confusing since it smears interfering process all over the time scale with a dip at offending frequency and its fractions. It makes sense: if you take readings at exact intervals of disturbance period (e.g. every morning) then your accuracy is not affected.  Same at multiples of disturbance period (e.g. every Monday morning, etc.)  Think of ADEV as a chart of "how predictable my time would be if I were to take readings at this tau?"  It's nice to look at when it's low but not very useful in tracking down localised problems when it's not.

MDEV is even "worse" due to its higher averaging nature - its periodic dips are gentler so harder to identify.

Why not just use spectral analysis - like you would do on the other side of 1 second?

Leo

P.S. Bill Riley has retired but is still publishing good work. He made his Stable32 software available for free.  It does a lot of analysis in both frequency and time domains and statistical series analysis all in one place.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on December 22, 2019, 09:26:31 pm
Anyway, this plot is just ADEV/MADEV derived from DAC output. This is not necessarily the actual frequency, especially with the temperature effects on the OCXO. When you've worked out the temperature compensation, it'll become more meaningful.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Jacon on December 22, 2019, 09:45:16 pm
---- He made his Stable32 software available for free....
Link for download is active on IEEE site, but download process stops with error after approx 10% received
(regardless of browser used)...  :--
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Leo Bodnar on December 23, 2019, 08:23:09 am
http://www.leobodnar.com/files/162Stable32.exe (http://www.leobodnar.com/files/162Stable32.exe)

Bill has same dl problems and said that Stable32 Version 1.62 is the property of the IEEE UFFC.  However, since it is freely available to all, he does not see any problem making available a downloadable copy. It should be also available on his website at http://www.wriley.com/162Stable32.exe (http://www.wriley.com/162Stable32.exe)

Link for download is active on IEEE site, but download process stops with error after approx 10% received (regardless of browser used)...
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on December 23, 2019, 10:13:54 am
Hi all,

I ran another test again, this time with a TC of 500, and I also added the temp correction.

Here is how I figured out the two factors, following the example Lars has given in an earlier post.
To calculate the tempRef factor, I used the average OCXO oven temp. My sensor is pressed to the CTI case by elastic bands. It reads an average temperature of 50.8 degrees C, so I entered a factor of 508.
To calculate the tempCoeff factor, I used the 10 ADC steps per degree C. With a temperature drop of 0.5 degree C, this means -5 ADC steps.
When the OCXO temperature drops 0.5 degrees C, my DAC changes 100 steps. The temp factor is then 100DAC/-5ADC = -20 The tempCoeff factor is then -20 * 100 and inverted becomes 2,000.

Below are the results from TimeLab. There is a long period of minimal DAC changes that are a mixture of the TC factor of 500 and the temperature corrections. My overall precision improved a bit compared to the graph with a TC of 200 just above in an earlier post.

From the Excel data you can clearly see the period of very good stability as well. It turns out that the instability comes from the heating system changes.
At 22:00 hours the heating system goes to night-time and the heater in my office turns on at 9:00 o'çlock.

I have a system by which I can set and monitor the individual radiators in rooms, and I also monitor the central heating system itself. The last graphs show the heating activity in my office, and below it you can see the heating system activity itself. I track the water temperature going out and back in. The instability during the daytime is caused by me entering the room and doing work within a feet of the GPSDO, and also the effects of the heater turning on and off. The heater activity is represented by the black lines in the heater graphs.

The net-net of all this is that the GPSDO at this level of precision is far more sensitive to ambient temperature changes than I anticipated, and using the sensor connected to the OCXO may not be the best method to correct this.

I will now add another sensor on the processor board and start to use that for the compensation factors.


Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on December 23, 2019, 10:36:06 am
Putting the stuff into a paper box is not enough, imho. Make a box from ~3-4cm thick polystyrene and put there the OCXO and all the electronics (including Neo and voltage regulators, the OCXO's heater will stabilize the temperature inside the box). I bet you get a stability as within 40k-80k secs in your graph above, or better.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on December 25, 2019, 08:11:19 am
Haha imo, Chineese food in a paperbox is typical for the US, we get it in plastic boxes that are great to store food in for the freezer. ;D

I do take your point though. Right now, my controller board and the OCXO board are in separate flimsy plastic containers. The controller board does not benefit from the OCXO temperature, which is what I track and is very stable. I designed a PCB that will arrive later this week. It will fit into a metal enclosure and I can add insulation on the inside. The board features all the modifications we talked about, but can also be removed and can take all of my current OCXO’s and the 8663 Oscilloquartz that will arrive soon as well. I found enough parts under the Christmas tree to build up several boards so I can start to compare. How to do that will be a new topic I will need some help with defining so others can hopefully benefit as well.

I’m gradually becoming a (novice) time nutter...  :palm:
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on December 31, 2019, 09:22:40 am
My pcb's came in and I build-up the GPSDO with the CTI OCXO.
I'm running several tests and I'm now trying to tweak the temperature compensation.
My special insulation sheets are not in yet, so I use bubble-wrap to insulate the inside of the box for now.

First results look pretty good, better than by using the two protoboards.
I'm using an old front-panel, but I designed a replacement pcb that is on order.

I had to make a few changes to the circuit and the layout already because I goofed up twice, and otherwise made some enhancements after going through the first build-up.

When I'm done with the layout changes, I will publish the Gerbers.
Here are some first pictures.
The colored wires go to my Raspberry Pi monitor.

Update: I inadvertently did not update the tracefield in the TL screenshot. It was made with a TC of 500 and a damping of 3.0, I have updated the chart.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on December 31, 2019, 11:19:25 am
How to interpret the above MADEV with TC=4?
Pretty different to Lars' picture.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on December 31, 2019, 03:38:27 pm
Hi imo,

I goofed by not updating the Trace field in the TL chart. I corrected and updated the chart.
It was made with a TC of 500 and a damping of 3.0.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on December 31, 2019, 04:22:47 pm
Could you try with TC=4 too?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on January 01, 2020, 08:38:43 am
Hi imo, I started with that to do a first check and to determine the optimum TC.

This is made with a TC of 4, damping 3.0, gain 285, TL factor 3.5087E-12, no temp corrections.
The enclosure was still without the cover and front/back panels but everything was in a bubble bag together with the Raspi monitor.

See anything interesting?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on January 01, 2020, 09:26:38 am
Based on the picture your OCXO has some drift and/or jumps.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on January 01, 2020, 10:49:39 am
imo, that's not supported by the raw data but I agree that it looks a bit weird.

Granted, this run was the very first thing I did when I finished the pcb, so the temperature had not settled yet.
I'm running another test right now to figure out the temp compensation, but now that the GPSDO has settled in its new home, I will re-adjust the DAC setting, recalculate the gain, take out the temp correction entries and redo the TC4 measurement again.

After that I will switch to my second pcb with the IsoTemp OCXO and start that up.


Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on January 01, 2020, 01:07:05 pm
I've removed first 6k and last 8k points from the measurement (unstable temp).
For record:
DACp-p = 2900 (1.02e-8)
DACstd = 343   (1.2e-9)
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on January 01, 2020, 08:57:13 pm
Thanks imo,
It seems that every time I run a test, TL produces different curves I can't explain. I'm getting frustrated and annoyed.  |O
The updated chart shows that. Both IsoTemp plots were made under exactly the same conditions, one day apart. The green trace is the latest. Seems too big of a variance to me.

I'm afraid now that I'm hi-jacking this thread with my issues, but on the other hand, other newbies could potentially run into the same situation.
I considered starting a new thread, but this is so closely linked to the Lars GPSDO method of measuring the DAC results with TL that I decided against it. I hope I'm being excused.  :-// I apologize up front though.

I ran a new TC4 test for the CTI, properly warmed-up for a few days in the enclosure and during the night (no disturbances).
At the same time, I also ran a TC4 test for the IsoTemp, properly warmed-up for several hours, in a bubble-wrap bag and also during the night. (don't have another enclosure yet)

The TC4 tests are described on page 11-12 from Lars' documents, and I used the second method to find the optimum TC.
Below are the combined results.
It seems that after warming-up, the CTI results are a little worse compared to the first plot. You would think that it would be better.
Although I'm easily running the CTI with a TC of 500, the MDEV plot seems to indicate an optimum TC of about 200 for both. Two hundred seems to be pretty poor.

The MDEV plot seems to indicate that the TempTech OCXO (bottoms at 1.37E-11) is not as good compared to the CTI which bottoms at 7.05E-11.

However, from Lars' comments on page 12, the sharp upward trend after bottoming out for the CTI indicates that it has a lot of drift.

The frequency plot shows no serious frequency jumps, but this plot also seems to indicate that the IsoTemp has a lot more noise/jitter compared to the CTI, which is much more stable. This to me seems to contradict with Lars' comment about drift on the MDEV plot.

What does the wriggle in the curve of the IsoTemp show after 4.000 seconds? What does that mean?

So can you infer the better OCXO by using the TC4 measurement results and if so, which is the better OCXO and what TL plot determines that?



Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on January 06, 2020, 10:31:51 am
While running a test with the free running OCXO, I noticed a gotcha, but at the same time an interesting feature.

When you select h0 to hold (freeze) the DAC value to be able to see the drift of the now free running OCXO itself, the DAC still gets updated if you activated the temperature and the tempCoeff settings. This temp compensation creates peaks in the diff_ns values and wriggles in the ns values everytime the DAC is forced to change to a new value. Because the temp values are not very stable, there is a period of these wriggles until the DAC changes to a stable value.
So, make sure you set the tempCoeff to zero before you start the test.

Another hint is to first select a lock with a reasonably high TIC value (100-250+) before you invoke the h0 test. This makes the drift line a little less drastic because the DAC value is then pretty close to the GPS synchronization.

The side effect of the "incomplete" DAC hold is that you can clearly see the effect of temperature changes on the DAC based on the tempRef and tempCoeff settings, which is otherwise not so easy to verify and check.

Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on January 07, 2020, 08:34:28 pm
Applying temperature corrections while in hold mode is actually a pretty important feature for "holdover". I'm very sure this is by design and not a forgotten corner case.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on January 08, 2020, 04:44:26 am
@thinkfat, I called it a gotcha, and not an oversight or bug for the same reason.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on June 08, 2020, 09:34:02 am
It's only fitting that after my last post from exactly 6 months ago it is followed-up by a new one today.

I'm still learning, experimenting, fiddling and adjusting with this project. I have three working units, and I'm trying 5 different OCXO's in them, with mixed results. Because the electronics and software are identical, I can really zoom in on the OCXO performance the two different UBLOX GPS modules I use.

While hunting for the cause of lost lock's, I noticed a strange phenomenon on two of my OCXO's, the Bliley and the IsoTemp ones. The third is my best, the Oscilloquartz 8663-XS.

I'm using the Bliley as an example here, but the IsoTemp reacts the same way.
The Bliley with model number NV47M1008 has a gain of 440 and I'm running it with a TC of 500. With that setting I'm loosing the lock every now and then, but that's not the point.

The first picture shows a typical run with the Bliley. I've only selected a smaller portion of the data to show the effect. It's pretty clear that I loose the lock because the ns value goes beyond +/- 100ns. The Lock shows this as a reference. Note the Ambient Temperature graph. There is a dip at exactly the time where the Lock is lost. I can't explain this drop in temperature. The ambient LM35 sensor is "lying" on top of the section with the diode and 1nF capacitor, because it is the most sensitive to temperature changes. My OCXO's are all isolated in a hard foam box, even from the PCB. The OCXO temperature is not really influenced by this.

The second graph zooms in on the data and shows the leading edge of loosing the Lock and it shows that the temperature starts to drop after the Lock is lost. The third graph shows the trailing edge and you can see here that the ambient temperature starts to rise after the Lock has been obtained again.

I know that my Trimble, Bliley and the IsoTemp are prone to sudden changes in frequency, which is why the loop cannot compensate fast enough. I've tried a lower damping factor (down to 1.5), to no avail. The reaction time of the loop is too slow at a TC of 500 for the Bliley, and at a TC of 200 for the IsoTemp, which I'm running with a gain of 617.

Can anybody shed some light on this dropping ambient temperature phenomenon?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on June 08, 2020, 04:28:32 pm
Two things:
- If you can log the power consumed by the Arduino board, try correlating that graph to the temperature log. How much power does the "Lock" LED consume? It goes off when you loose lock.
- Try with a larger "filterDiv" parameter, to speed up the loop response. At large TC, the TIC prefilter is maybe too aggressive.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on June 08, 2020, 07:43:34 pm
Thank you thinkfat for the suggestions.

I thought about the LED, but it has a 220R resistor in series for a maximum of 22 mA. I doubt it has that much effect on the temperature inside the enclosure, but I can easily unplug the LED from the circuit and see if it makes a difference.

At first I thought about the 12V wall-warts producing a higher voltage at times, I use identical ones for both units. The Oscilloquartz version uses a 15V one.
That possible cause has been eliminated by switching to a 12V battery cell with a carefully set charge level.

By filterDiv, you mean the prefilter set by the p command I assume, because Lars uses two different names for the same thing I think.
Right now it is set at the default value of 1 second. Possible settings are 2, 3 or 4 seconds. Making the loop response faster by using a longer prefilter seems counter intuitive, but I'll give it a try.

Stay tuned...
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on June 08, 2020, 08:08:11 pm
Thank you thinkfat for the suggestions.

I thought about the LED, but it has a 220R resistor in series for a maximum of 22 mA. I doubt it has that much effect on the temperature inside the enclosure, but I can easily unplug the LED from the circuit and see if it makes a difference.

At first I thought about the 12V wall-warts producing a higher voltage at times, I use identical ones for both units. The Oscilloquartz version uses a 15V one.
That possible cause has been eliminated by switching to a 12V battery cell with a carefully set charge level.

By filterDiv, you mean the prefilter set by the p command I assume, because Lars uses two different names for the same thing I think.
Right now it is set at the default value of 1 second. Possible settings are 2, 3 or 4 seconds. Making the loop response faster by using a longer prefilter seems counter intuitive, but I'll give it a try.

Stay tuned...

The prefilter length is computed as "timeConstant / filterDiv". At TC=500, a filterDiv=1 gives a prefilter time constant of 500. Try 30.

What ublox modules are you using? The "ns" log shows quite a lot of deviation, more than +/- 50ns. Even without sawtooth correction, it's should not be that much. With my own design, using a NEO-M8T, after Survey-In completes, I never get more than +/- 10ns of deviation when running TC=500.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on June 09, 2020, 11:18:10 am
Hi Thinkfat, thank you for the suggestions.

After going through Lars' notes, I realized that I misunderstood what the prefilter or filterDiv stood for.

A short sample of the normal rate for the "ns" log is posted below.
I don't think this is dramatic for a NEO-M8N. With an outdoor active puck antenna I always have in excess of 20 satellites of which 10-11 are above 20dBHz signal levels.

[attachimg=1]

The more or less wild gyrations of "ns" start with a higher TIC value. The Bliley has an "ideal" value in excess of 1.000. I have been using 500, which is not too ambitious, but I loose lock too often. At 500 I wanted to see what I could do by tweaking the hardware, mostly looking at the supply decoupling. Maybe the incorrect FilterDiv setting is the problem.  For some reason, all my three units had a filterDiv setting of 1.  :-//  I don't recall ever having changed them. In any case, I'm now running new tests with the filterDiv at 2, and the lock LED disconnected.


BTW, here is a short sample of my Oscilloquartz 8663-XS which uses a NEO-8MT in the fixed position mode. It shows what my hardware is capable of.

[attachimg=2]


Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: bingo600 on June 09, 2020, 06:53:46 pm
I really ought to get my Lars GPSDO's assembled  :phew:

Re Oscilloquartz
I'm just doing some  Oscilloquartz Star-4  GPSDO - Burn in logging w a FS2 counter 10s gatetime , and a Trimble Tbolt as ExtRef.

Turn on time 3 weeks , and the DOCXO is beginning to settle.

/Bingo
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on June 10, 2020, 08:24:18 am
I'm running another set of tests, after making some tweaks to the hardware, but also with the FilterDiv setting on 2 instead of 1.
Here are the results, just so you can see the difference between the two settings. This is from different runs, so the data is not the same but you can easily see that the DAC values much more closely follow the ns excursions, keeping the loop tighter.

This is the IsoTemp OCXO with a TC of 4, Damping 3.0 and FilterDiv 2.

[attachimg=1]
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on June 10, 2020, 07:45:27 pm
The LED for the Lock was disconnected, the dip is not as deep, but it's not the root cause for the temperature drop. I suspect that the Arduino activity during the lost lock is causing the on-board voltage regulator to drop temperature. That regulator is powering the LED too. This is not so easy to verify.

[attachimg=1]
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Johnny B Good on June 15, 2020, 11:33:39 am
I'm running another set of tests, after making some tweaks to the hardware, but also with the FilterDiv setting on 2 instead of 1.
Here are the results, just so you can see the difference between the two settings. This is from different runs, so the data is not the same but you can easily see that the DAC values much more closely follow the ns excursions, keeping the loop tighter.

This is the IsoTemp OCXO with a TC of 4, Damping 3.0 and FilterDiv 2.

[attachimg=1]

 Just one question: Is the X axis seconds or minutes?

JBG
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on June 15, 2020, 07:38:35 pm
Seconds, tracking the output of the "Lars" program.

I'm feeding the Arduino with a regulated 8V input, and I've isolated all other circuits from the 5V output of the Arduino. There is only a 100uF cap on that pin now. The Arduino drives the lock LED of course. My assumption is that the Arduino spends less time filtering when the lock is lost, and loss of activity together with the switched off LED causes the temperature drop. I have three units, all with different OCXO's, and all three show the same behavior. You can only witness this when the OCXO is thoroughly isolated from the rest of the circuit, otherwise that temperature dwarfs the ambient temperature excursions. I'm measuring the ambient temperature with an LM35 on top of the R1/C1/D1 components.

Go figure... :-//
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on June 15, 2020, 08:58:50 pm
have you already set up your temperature compensation?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on June 16, 2020, 02:07:56 pm
Hi Thinkfat,

No, I did not setup the temp corrections yet, as a matter of fact, I took them all out to help track down the much bigger issue that I have. I'll describe that in a separate post.
Besides, if you look at the data in my post #466 (top right hand graph), you see that there is not a great deal of DAC deviation caused by temperatures that is worth compensating.

Thank you for helping me out though.

 
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on June 20, 2020, 08:38:10 am
I promised to show one issue that I had with my setup. This is a typical "trap for young players".

For several months I suspected bad behavior from my OCXO's, but because I have 5, with only one behaving as expected, I just couldn't believe 4 out of 5 were bad. I suspected temperature issues and the PWM/DAC circuit, but could not prove anything with the equipment that I had.

I've just found the problem, but only after modifying my DIY micro-Volt meter by adding logging capabilities.

The symptom was that I saw strange out-of-lock events that I could not explain. If you look many posts back, you can see that I used a suggestion from imo to isolate the "DAC" output pins from the Arduino 5V rail. The Arduino does some strange things to the ambient temperatures as I've found out, so isolating that circuit from the very sensitive rest as much as possible is a good thing. I used 74HC14 gates between the Arduino "DAC" outputs and the PWM filter. The 74HC14 got it's own 5V supply, generated by a REF02 voltage reference. Following another suggestion from imo, (post # 415) I added a current booster circuit that used one transistor and a bias resistor. There are several versions of that circuit that I've found. Here is another one:

[attach=1]

I fed that circuit with the output of an LM7808. This regulator feeds all the other separate 5V supply rails. In hind-sight, that was a mistake, I should have used a higher voltage. According to the REF02 specification, 8V is the minimum. When you measure the output voltage, it is fine and stable, so I didn't suspect it. It did see some oscillation on the output with a scope, and I removed a 2.2uF tantalum cap directly on the output of the REF02 to get rid of it. Although this was according to the datasheet. I also changed the transistor to a 2N3906 because that gave me better regulation.

When I was finally able to use my modified micro-Volt meter on the VFC output, I noticed glitches that shouldn't be there.
Below is a plot to show what I mean. These glitches are not coming from the DAC.

When I tracked the output of the REF02, I noticed the glitches on the last picture below. (both pics have a horizontal scale of 1 second per data point)

My assumption is that the regulation of the REF02 is compromised when the voltage of the LM7808 drops below a critical level. (if you use a micro-Volt meter on the output, you'll be surprised how wobbly these 78XX regulators are) The 220 Ohm bias resistor is also in-line with the REF02 input, and that drops the voltage below a critical point, causing the REF02 to sometimes get out of regulation, and causing the glitches on the output.

The REF02 only powers 4 gates of the 74HC14 plus the PWM filter and bias setting resistors for the OCXO. I measured the load to be less than 4mA, while the RF02 can sink 10mA. The booster is not needed, so I took it out, eliminating these mysterious glitches that haunted me for months.

Having fixed that, I can now continue to see if I can further improve the results some more, because I'm still a long way from where I think I can get to.

Stay tuned...
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on June 24, 2020, 11:55:54 am
thinkfat,

In your forum post about your own development (DIY GPSDO project w/ STM32), you mention in post #192 that you should not use SBAS and should not use multiple constellations.

There is very little written about setting-up NEO's specifically with the Lars' system.
When I switch to only using GPS, I loose track (No PPS) for short periods of the sats several times a day as an example. Unfortunately, I only have access to an East facing windowsill on my 3rd floor apartment, so I need better coverage.

Can you give us the rational about using only one constellation? Is there a switch-over issue from one to the other in addition to what is in the u-blox M8 Receiver Description manual at paragraph 4.2.1?

Many thanks in advance
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on June 24, 2020, 02:25:05 pm
thinkfat,

In your forum post about your own development (DIY GPSDO project w/ STM32), you mention in post #192 that you should not use SBAS and should not use multiple constellations.

There is very little written about setting-up NEO's specifically with the Lars' system.
When I switch to only using GPS, I loose track (No PPS) for short periods of the sats several times a day as an example. Unfortunately, I only have access to an East facing windowsill on my 3rd floor apartment, so I need better coverage.

Can you give us the rational about using only one constellation? Is there a switch-over issue from one to the other in addition to what is in the u-blox M8 Receiver Description manual at paragraph 4.2.1?

Many thanks in advance

The documentation of the ublox m8t receiver recommends to not enable SBAS, because it will degrade the stability of the time pulse (see chapter 19.2) I have found that, too. SBAS is also primarily interesting for navigation, it has no benefit for timing.

The recommendation to only enable one major GNSS is from own experience - however, if you don't have sufficient sky view, this is a moot point. It is then more important to have satellite coverage, as obstructed sky view will degrade the timing precision anyway.

What I'm experimenting with right now is to enable SBAS only during survey-in under the assumption that the position average will converge quicker with the increased fix precision.

My current setup has GPS and Galileo enabled as major GNSS' permanently, with SBAS being switched in only during survey-in. My software handles that automatically.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on June 26, 2020, 11:09:58 am
I have finally found the root cause of the poor performance of my GPSDO's. It turns out that I have been looking in the wrong places.
To recall, I have 5 different OCXO's that all showed strange events that were difficult to explain, so I blamed it on the OCXO's. For several months they have been nursed back to an easy life after the most likely rough handling and transport. To no avail. The strange phenomena didn't go away, even though I was able to fix several smaller issues.

It turns out that my GPS modules, in combination with my geo position, the sky view and the place of the antenna, is the root cause. As I mentioned earlier, my puck antennas are located on a metal windowsill on the outside of my apartment. The window in the apartment building is East-facing, and there is another floor above me. This results in a very restricted eastern sky view.

I have three different GPS modules, a NEO-6M, a NEO-M8N and a NEO-M8T. The 6M and the M8N are confirmed Chinese fakes. As far as I can tell, the M8T is a genuine u-blox one. (also purchased from a french guy, probably the same one thinkfat got his from) The 6M has poor reception and is limited for my particular situation. The M8N seems to work fine, although it does not restart with the saved configuration. After a power-cycle, I have to put in the setup again.

Strangely enough, the M8T refuses to accept the activation of the Galileo sats. (I use the right NMEA version of 4.1) When I program the setting, it flips the activation check mark back to inactive. It does not show any min/max channels for Galileo either. Hmmm. Other than that, it seems to work fine. (it does not have the right firmware, see update below)

Here is a typical example of the best performance I could wring out of the GPSDO with the M8N and the Bliley NV47M1008 OCXO. These charts were made with a gain setting of 442, damping at 3.0, prefilter at 2, and a tc of 500.

[attach=1]

Note the swings in the "ns" chart between about +/- 50, compared to the rather good diff_ns chart. The sudden glitches that happened several times per day in the ns chart forced the GPSDO to loose lock. All of the OCXO's that I have and tried showed the same problem, so I have been hunting for these strange events.

For the last couple of days I have been switching the hunt to the GPS modules themselves because I was more and more convinced that the hardware performed as it should. While changing the NEO configurations with u-center, I noticed that the 6M would only see GPS sats. It looked like there were enough, always more than 3, so I set the minimum to 3, and the inclination to 20 degrees. Since then I lost lock with the sats every now and then. That put me on the right track.

I continued to change the settings on the M8N and the M8T and was eventually able to raise the tc to 1,000 while keeping a GPSDO lock.

I knew my M8T was better, so I took the 6M out of the GPSDO socket and mounted a BNC on the front panel with a connection to the now empty NEO socket. I fed the 1PPS output of the GPSDO with the M8T into the new BNC, in effect feeding that GPSDO with the reliable M8T 1PPS signal. Below is that result (Bliley tc 1000):

As you can imagine, I was elated with this result. I was finally convinced that my hardware is capable and working really well. Although I'm running with a gain of 442, I'm going to see if I can double that to get a better resolution for the DAC.

With this result it now turns out that my "reference" GPSDO with the M8T and the Oscilloquartz 8663-XS OCXO at a tc of 1,000 has some issues that I now need to hunt down. (Oscilloquartz tc 1000) It turns out not to be very stable. On my scope, the back-and-force drift between the Bliley and the Oscilloquartz 10MHz out wave-forms is very noticeable. I also still have issues with the M8N as well, so my conclusion for now is that in my particular case with my geo position and the limited sky view, the Chinese fakes have issues and are not good enough. Buyers beware!

[above edited for clarity & update:]
I have found that there is a huge difference with the Fixed Mode setting in TMODE2. Without the fixed mode, the readings are all over the place, and it shows on the TIC results as well. I ran a 24hr survey and used those results in the Fixed mode setting, and that improved the stability of the TIC dramatically.
 
My M8T does not have the required firmware and although I found it and tried, I can't load it due to communication errors with the device. Upgrading the fw for the M8T apparently is not without risks. In any case, that's why I don't have access to Galileo.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on June 29, 2020, 08:04:30 pm
I managed to get the firmware of my M8T upgraded to 3.01

It was not easy.
The firmware file is hard to find,  I found it here: https://www.eevblog.com/forum/metrology/u-blox-m8t-firmware-fw-3-01-tim-1-10/ (https://www.eevblog.com/forum/metrology/u-blox-m8t-firmware-fw-3-01-tim-1-10/)
The procedure to do the actual upgrade is not clear either.
I found a good howto description here: https://www.junipersys.com/data/support/Mesa-2-Ublox-GNSS-Firmware-Update.pdf (https://www.junipersys.com/data/support/Mesa-2-Ublox-GNSS-Firmware-Update.pdf)

Even then, there is one thing missing.
[attachimg=1]
In the field for the FIS file, you need to set the link to the flash file that came with your u-center installation. The flash.xml file is located in this directory.

Lastly, it does not take 30 seconds as is mentioned in the document, it took about 5 excruciatingly long minutes.

Don't forget to set the NMEA Version to 4.10 in the NMEA Protocol setup. (Version 4.11 did not stick, it reverted back to the old version)

I'm now acquiring the Galileo sats.

Enjoy!
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on June 30, 2020, 11:02:39 am
The effect of a GPS glitch on the GPSDO.

I've noticed the following event while tracking my M8N GPS module.
Here is what happened in the u-center dashboard.
[attach=1]

My M8N reception uses a minimum SV elevation of 15, a threshold of 4 SVs and a minimum of 20dBHz. Notice the fact that I have many satellites with more than adequate reception quality. This is with the stationary configuration setting, so I'm a little surprised to actually see this result, even though I only have an eastern sky view.

The M8N is in my Oscilloquartz GPSDO, and that shows an immediate loss of lock. The settings are gain of 987, tc at 500.

It shows that the GPSDO is very sensitive to the GPS module performance, even though there are many satellites in view.

My other GPSDO's with the Bliley and the CTI both driven by the 8MT in the stationary setting and with the timing mode in the fixed configuration do not show anything of a glitch at all.

Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on June 30, 2020, 11:51:15 am
Using the "TIME" mode is one major contributor to GPSDO stability. The other one is "sawtooth" correction. The first one can be achieved easily under the command of u-center. The latter will require major changes to the GPSDO control software.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on June 30, 2020, 07:19:33 pm
My Oscilloquartz based GPSDO is now slaved connected to the master NEO-M8T, and the results are pretty remarkable. The switchover happened at about 45.000 on the horizontal (seconds) scale.

This is with a TC of 500 and a gain of 987.
 
I think I have found my root cause...

[attach=1]
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on July 02, 2020, 08:09:46 am
My GPSDO with the Bliley NV47M1008 linked to the NEO-M8T has the best performance of the three GPSDO's I'm currently testing with my hardware. The results are almost too good to be true, I think...

This is with a tc of 1000, the rest default and no temperature compensation. My OCXO is in a foam box and has virtually no temperature influence I can determine. The drift of the OCXO is only in one direction, and even with a gain setting of 902, the DAC only needs minimum size steps to keep it in check.

Below are the MDEV and Frequency graphs from TimeLab.
I'm certainly no expert, but this is very impressive performance of the Bliley I think.
Maybe I got lucky... :-//

It also shows what the hardware is capable off, and it's probably worth considering adding the imo modifications that I described in detail many posts earlier. To quickly sum them up; use different regulators for all building blocks to isolate influences. Properly decouple all parts. Replace the 10M discharge resistor for C1 and do that by software control. Isolate the PWM/DAC outputs with gates that are powered with a reference supply to minimize the Arduino effects on the OCXO tuning. Put the OCXO itself in a foam box that also includes the bottom part. Extend the leads from the OCXO to go through the foam bottom which will further isolate the OCXO from the PCB.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on July 02, 2020, 08:36:35 am
So is my Bliley perfect?

No, well maybe. It has a weird behavior when warming-up.

After about a picture perfect 10 hours after turn on, I noticed this weird glitch. It briefly lost lock, but quickly got it back, but now with a DAC setting that is considerably lower than before. Since then, for a period of 38 hours and counting it has been extremely stable again as you can see in the previous post.

Interesting... it shows that nobody is perfect!

Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on July 02, 2020, 01:56:35 pm
How did you generate the ADEV graph, what input and reference? The results are suspiciously good, worth looking into the methodology of your measurement setup.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on July 03, 2020, 07:10:40 am
Hi thinkfat,

I was expecting comments like yours... This Bliley OCXO seems to be too good to be true.

OK peer review:
I collect the data from the Lars' report through a Raspberry Pi that puts it into daily logs, which I then import and concatenate together in Excel.
From that data I then make the graphs that I show on this blog. I also use the DAC data and feed that into TimeLab.

My gain for the Bliley is 902 so the import multiplier becomes 1.10865E-12. After I import the data, I use all three of the Substract options.
When I added another 24 hours of data to that from yesterday, I got the attached graph out of TimeLab. This shows why I personally still have have difficulty interpreting the ADEV and MDEV TimeLab results. The Frequency Difference in TL jives with what I graph out of my Excel data, so that is consistent.


Unfortunately, I can't post the Excel file because even zipped it is already 34MB and too large to post here.
I have extracted the DAC data and put that into a zipped file. This can be imported into TL.
I also put the Excel file without graphs and some deleted columns to save space on my github site here: (removed link)

Looking forward to hear if you can spot something...


Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on July 03, 2020, 07:26:06 am
Here is a picture of wonderboy and also an MDEV and Freq compare with the other two OCXO's I'm currently testing.

The other two mere mortals are an Oscilloquartz 8663-XS with a gain of 987  and a CTI OC5SVC25 with a gain of 554.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on July 03, 2020, 08:33:30 am
I was assuming already that you only had the DAC output log to feed into Timelab, so unfortunately, the graphs that you get tell you nothing (well, a little) about the actual output of the GPSDO, unless you can be dead sure that a specific DAC output always corresponds to a specific frequency. Of course this is not the case.

The MDEV and frequency graphs give some insight into the overall system behaviour, though.

First of all, the tau=1s MDEV is effectively defined by the smallest step the DAC does with the GPSDO in lock. It depends mostly on the "gain" and the DAC width (16 bit, in your case) and the time constant. If you run with a smaller time constant, the DAC output will change more frequently and the small-tau MDEV will be larger.

The MDEV graph, if you only have the DAC values, tells you mostly how much the GPSDO control loop "disturbs" the ouput of the OCXO, and if you knew the MDEV for the same OCXO running against a stable reference (very stable Rb or Cs standard), you could infer something about the actual performance. In fact, you could mark the datasheet values of your OCXO, if you have them, in the MDEV graph and connect them with lines to have a baseline for the expected performance, and wherever the DAC MDEV is above that line, it "degrades" the performance of the OCXO.

The datasheet I found for the NV47A OCXO series says it has a 1s stability of around 1e-10, which is OK but not exceptional, your DAC MDEV is around 1e-13, that means the GPSDO doesn't impact the OCXO and it will exhibit its natural performance. But of course it cannot do better, so the output of the GPSDO is not stable to 1e-13 :)

Now on the use of the "subtract" options in Timelab - I'm not very familiar with the software but I suspect that they will only hide information that is in the data. For example, if you remove all trends in the data, it will make the GPSDO "look very good" for large tau, but it will also hide the OCXO's long-term drift behavior, which is an interesting property to know.

Another remark on MDEV - I'm not sure but I think the DAC output is a frequency-time series and not a phase-time series, because changes denote a change in frequency and not a change in phase. That is something to keep in mind.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on July 03, 2020, 09:35:20 am
Hi thinkfat,

Thank you for the clarifications. I agree with you, wholeheartedly, but keep in mind that just about every TimeLab graph presented on this particular forum is a presentation of the DAC values, all by themselves. So that's what I did as well. Even Lars only shows the DAC values in his document, and never once in relation to his rubidium standard, which would give us a reference. To compare results between various posted graphs, we all need to use the same data, and since Lars recommended (figure 7) to subtract the driftline in TL, so did I and many others.

It has been my understanding all along that because the 1PPS pulse coming from the GPS satellites drives the control loop, adjusting the OCXO to this standard. Therefore, all ns and DAC excursions are in relation to the stability of the atomic clocks in the satellites, which is why looking at the DAC values can be construed as showing the difference to an "absolute standard". I may not express this well, but that is my understanding. Please correct me if I'm wrong.

I already mentioned that I have difficulty interpreting what the TL graphs present, and prefer to look at the stability of the OCXO using Excel and looking at the TIC ns difference, stability/drift and the DAC stability and drift. If you collect temperature data as well, you can see those effects as well. Having said that, in absence of a ppb counter or an "absolute reference", all you can do is a relative compare between devices, which is why I collected data from a couple of OCXO's.

As a minimum, my data shows that the Bliley is a lot more stable than the Oscilloquartz, and that one is a lot better than the CTI.

Or is there another way?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on July 03, 2020, 10:07:58 am
As a minimum, my data shows that the Bliley is a lot more stable than the Oscilloquartz, and that one is a lot better than the CTI.

I'm not so sure about that. You'd have to run them all with the M8T GPS, with the exact same TC and filter settings (except gain of course), in the same stable environment, to make the graphs comparable.

BTW the only references to Timelab in this particular thread that I found are for finding the optimum TC. This is point where the GPS becomes "better" than the OCXO, i.e. where you start to see the drift behavior of the OCXO. If you think about it, to achieve the best performance you need to "slow down" the control loop to the point where it is just fast enough to compensate the long-term drift of the OCXO. This is the best possible case, have the GPSDO output be the free-running OCXO up to the point where the GPS is more stable.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on July 03, 2020, 10:52:05 am
They are all connected to the same M8T in the same hardware design and running with a TC of 1.000 except the CTI which used a TC of 500. I just switched it to 1.000, but I'm not too happy with it so I'm in the process of switching the CTI to my Trimble 65256 again. The reason is that OCXO's with a solid and thick case have virtually no hindrance from ambient temperature changes, if you put them into an isolation box all by themselves.
Both the CTI and the IsoTemp I tried have flimsy housings and suffer greatly from ambient temperature changes.

If you look in the original pdf from Lars, it shows the TL graphs that I referred to.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on July 03, 2020, 11:05:02 am
Well, the graphs on page 3 are against various Rb standards (PRS, LPRO), the graphs in the last PDF are all against "Rb3", which was probably Lars'  house standard.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on July 04, 2020, 07:58:48 am
They are all connected to the same M8T in the same hardware design and running with a TC of 1.000 except the CTI which used a TC of 500. I just switched it to 1.000, but I'm not too happy with it so I'm in the process of switching the CTI to my Trimble 65256 again. The reason is that OCXO's with a solid and thick case have virtually no hindrance from ambient temperature changes, if you put them into an isolation box all by themselves.
Both the CTI and the IsoTemp I tried have flimsy housings and suffer greatly from ambient temperature changes.

If you look in the original pdf from Lars, it shows the TL graphs that I referred to.

I think what you can safely conclude from the graphs is that the whole system with the Bliley OCXO is the most stable of them, since the MDEV graph basically shows that the control loop has to do much less "work" to keep the OCXO locked. This might be due to the OCXO alone. If you isolated the other two OCXOs better from temperature changes, they will likely improve as well. But as it stands, under the conditions you tested, the Bliley is the "best". The final proof can only come from doing a measurement e.g. against a good Rb standard. This will bring you into serious "time-nut" territory :)

Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on July 11, 2020, 11:19:38 am
Just to see how far I could go with my now stable and reliable hardware and GPS setup, I selected a TC of 2,000 and ran that for about 20 hours. I also switched the CTI out for my Trimble 65256. This Trimble has a sine wave output, just like the Oscilloquartz.

During this run, there was absolutely no risk of getting out of lock and I think I can increase the TC even higher. The deviations get a little larger, so from a precision point of view for the output, it makes no sense to me. It looks like a TC of 1,000 seems to be optimal for all three of these OCXO's. Due to the thermal isolation I provided by boxing in these OCXO's, there is no temperature effect that I can determine, unlike with the CTI and IsoTemp ones.

Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: cdev on July 18, 2020, 01:03:57 pm
Just curious if all the 10 MHz sine waves from all these oscillators remain in phase with one another, year in and year out?

Ive recently acquired a perfectly sized thermal box (used for shipping frozen goods, etc.) and I am wondering if I should first fireproof it, and then try putting my (Bliley OCXO containing) GPSDO in that and putting it in my basement and building a separate controller to put upstairs in the living area. I could maybe use it for training GPSDOs. Have a little "rack" for disciplining them. ;)

Just for fun.

Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on July 18, 2020, 03:25:39 pm
Just to see how far I could go with my now stable and reliable hardware and GPS setup, I selected a TC of 2,000 and ran that for about 20 hours. I also switched the CTI out for my Trimble 65256. This Trimble has a sine wave output, just like the Oscilloquartz.

During this run, there was absolutely no risk of getting out of lock and I think I can increase the TC even higher. The deviations get a little larger, so from a precision point of view for the output, it makes no sense to me. It looks like a TC of 1,000 seems to be optimal for all three of these OCXO's. Due to the thermal isolation I provided by boxing in these OCXO's, there is no temperature effect that I can determine, unlike with the CTI and IsoTemp ones.

Yes, that's to be expected. There's a decision to be made where you want the best performance. If you want stability at small observation intervals, you choose a long time constant to slow the regulation down. If you favor long intervals, make the time constant shorter. Have a look at this image, it shows my DiY GPSDO against a commercial Trimble UCCM module. My own GPSDO is running with a time constant of 700 seconds, the Trimble is using whatever, but you can clearly see that it uses a different strategy: It sacrifices small-tau stability for a faster dive-down into stable regions around 100s.
[attachimg=1 width=800]

However, increasing the time constant looses its benefit at a point, as you cannot get better than the short-term stability of your OCXO.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on July 19, 2020, 06:45:04 am
@cdev,

I have found that boxing in the OCXO with dense insulation of 10-15 mm thick walls works really well separating the ambient temperature changes to that of the OCXO. Note that I also use the insulation between the PCB and the bottom of the OCXO. I extended the leads so I could do that. Furthermore, OCXO's with a thick/double casing like the Oscilloquartz, Bliley and Trimble are much, much better in this respect as well.

The OCXO temperature measured by the sensor inside the insulated box still changes somewhat with the ambient temperature, but the effects on the DAC are barely recognizable or so small that there is no need to use temperature compensation.

Below is my Oscilloquartz version.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: bingo600 on July 20, 2020, 04:59:34 am
@Dbldutch

Any plans on publishing the Schematic + PCB ?

/Bingo
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on July 20, 2020, 06:38:45 am
@Bingo

Yes I will do so pretty soon. I'm on vacation right now while I'm still collecting data from my three OCXO's.
I will publish my findings on my own blog to not pollute this thread and when I'm done I will announce that here.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on July 31, 2020, 01:35:42 pm
As I promised, here is the link to my own blog where I will describe my project and findings in more details, without "polluting" this blog.
I will be adding information as I go, since there is a lot to share and learn.

I would like to thank several of you for your generous support in picking me up when I stumbled or fell.

Here is the blog post: http://www.paulvdiyblogs.net/2020/07/a-high-precision-10mhz-gps-disciplined.html (http://www.paulvdiyblogs.net/2020/07/a-high-precision-10mhz-gps-disciplined.html)
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: cdev on July 31, 2020, 06:07:59 pm
I've been saving foam boxes to build a thermally managed enclosure at some point. Some time ago Lief Asbrink demonstrated a method for keeping his miri sdr dongle thermally stable, he buried it in a bucket of fine sand. He found that worked really well. The only thermally stable place in my house is the basement, so I am thinking it might be interesting to see if putting a GPSDO there made for a more stable environment.

@cdev,

I have found that boxing in the OCXO with dense insulation of 10-15 mm thick walls works really well separating the ambient temperature changes to that of the OCXO. Note that I also use the insulation between the PCB and the bottom of the OCXO. I extended the leads so I could do that. Furthermore, OCXO's with a thick/double casing like the Oscilloquartz, Bliley and Trimble are much, much better in this respect as well.

The OCXO temperature measured by the sensor inside the insulated box still changes somewhat with the ambient temperature, but the effects on the DAC are barely recognizable or so small that there is no need to use temperature compensation.

Below is my Oscilloquartz version.


I am thinking about building Lars's gpsdo in part so I can a second point of reference, to evaluate my surplus telcom GPSDO, and also because. I have almost all the parts already, with the exception of the OCXO.  Because part of the reason I am interested in the project is "affordable science" I dont want to spend a lot on the OCXO.

Maybe $15-20 tops.  I plan on using a navspark mini for the GPS. Do you think the Bliley you are using is a good choice?

I think spending much more than that would defeat my purpose of showing how it can be done for cheap. The navspark doesnt make sawtooth correction or anything like that available but it does let you tell the kalman filter its stationary.  And it does keep a stable 1PPS even when it is deprived of most of the signal (one way to do that is put it in a antistatic bag. It is remarkably sensitive so works almost anywhere where there is any signal at all.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on August 01, 2020, 08:02:48 am
Hi cdev,

Quote
Do you think the Bliley you are using is a good choice?

The Bliley NV47M1008 I finally got, after receiving 2 failing ones, is the best of the 5 OCXO's that I currently have.
It has some strange jumps, but before and after the jumps it is amazingly stable with no temperature effects on the DAC at all.
I got mine for about $20-25
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on August 01, 2020, 08:35:43 am
Correction from post 108:
Quote
The OCXO temperature measured by the sensor inside the insulated box still changes somewhat with the ambient temperature, but the effects on the DAC are barely recognizable or so small that there is no need to use temperature compensation.

After running the three OCXO's for several weeks, including with higher outside temperatures (very warm weather), I noticed that both the Oscilloquartz and the Trimble had some small temperature effects on the DAC. My assumption is that this effect will be less again when the outside temperature drops back, making the delta difference larger. This is probably the reason why I didn't notice it earlier, with lower outside temperatures.

I used the advised calculation described by Lars to determine the tempRef and tempCoeff values. For my Trimble that turned out to be a tempRef of 521 (daily avg OCXO temp of 52.17 degrees C), and a tempCoef value of 400. I still noticed some effects on the DAC, so the next day I increased that value first to 450, and a day later to 500.

The Oscilloquartz tempRef was set to 515 (daily avg 51.52 degrees C) and a calculated tempCoef value of 175. That did it, the DAC curve is no longer following the daily OCXO temp changes.

The Bliley still has absolutely no temperature effects on the DAC whatsoever. Not even a single DAC count, and that with a gain of 902. Splendid!

Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on August 01, 2020, 08:48:42 am
The Oscilloquartz tempRef was set to 515 (daily avg 51.52 degrees C) and a calculated tempCoef value of 175. That did it, the DAC curve is no longer following the daily OCXO temp changes.

That's a bit odd. The DAC temperature compensation should not stop the DAC from following the temperature changes, rather it should stop the TIC (and thus, the frequency) deviating in the presence of temperature changes. If the DAC is no longer correcting temperature effects, the frequency would change, this should be visible in the TIC values and cause the control loop to compensate (potentially driving it into unlock).

Maybe the DAC value Lars' firmware is reporting has the temperature compensation already subtracted?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: cdev on August 01, 2020, 01:38:17 pm
Thank you for the reminder to check it thoroughly when it arrives!

Are there any other cheap OCXOs you would recommend that are comparable to the Bliley, in your opinion?

Hi cdev,

Quote
Do you think the Bliley you are using is a good choice?

The Bliley NV47M1008 I finally got, after receiving 2 failing ones, is the best of the 5 OCXO's that I currently have.
It has some strange jumps, but before and after the jumps it is amazingly stable with no temperature effects on the DAC at all.
I got mine for about $20-25
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on August 02, 2020, 08:19:54 am
@thinkfat : Yes that is the case, I verified that in the code. The DAC calculation takes the temp compensation into account. This means that the DAC curve no longer follows the OCXO temperature curve while still compensating the TIC differences. I'll put some example graphs in my blog soon.

@cdev: The Bliley comes in several versions, with sine wave and square wave out. They can be obtained rather inexpensively. I have used this seller a lot. https://www.ebay.com/itm/1-Bliley-NVG47A1282-10MHz-5V-Sine-Wave-OCXO-Crystal-Oscillator/332416522967?hash=item4d65919ad7:g:~ecAAOSwPDRfGQUS (https://www.ebay.com/itm/1-Bliley-NVG47A1282-10MHz-5V-Sine-Wave-OCXO-Crystal-Oscillator/332416522967?hash=item4d65919ad7:g:~ecAAOSwPDRfGQUS) Both the Trimble and especially the Oscilloquartz are popular and therefore have higher prices. I have not tried other "heavy"or thick cased OCXO's. My CTI and IsoTemp OCXO's both have very thin casings and are therefore very sensitive to ambient temperatures, even when isolated, which is why I don't use them at this moment. My setup and environment (put everything in a sand box in the basement?) has to be changed considerably for me to use them.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: cdev on August 03, 2020, 10:50:45 pm
Bliley is the brand that my True Position GPSDO uses (its a NVG47A1282) , and as far as I know the True Position's accuracy is very good, so it will be interesting to see how the two compare if they do.

The True Position is telecom surplus GPSDO that was used in a TDOA system for locating 911 phone callers physical location from the time the signals arrived. They typically lived in either dispatcher setings, or often, at cell phone sites, typically cabinets on telephone poles that were exposed to a wide variety of weather and still maintained a high level of precision, good enough for TDOA.

@thinkfat : Yes that is the case, I verified that in the code. The DAC calculation takes the temp compensation into account. This means that the DAC curve no longer follows the OCXO temperature curve while still compensating the TIC differences. I'll put some example graphs in my blog soon.

@cdev: The Bliley comes in several versions, with sine wave and square wave out. They can be obtained rather inexpensively. I have used this seller a lot. https://www.ebay.com/itm/1-Bliley-NVG47A1282-10MHz-5V-Sine-Wave-OCXO-Crystal-Oscillator/332416522967?hash=item4d65919ad7:g:~ecAAOSwPDRfGQUS (https://www.ebay.com/itm/1-Bliley-NVG47A1282-10MHz-5V-Sine-Wave-OCXO-Crystal-Oscillator/332416522967?hash=item4d65919ad7:g:~ecAAOSwPDRfGQUS) Both the Trimble and especially the Oscilloquartz are popular and therefore have higher prices. I have not tried other "heavy"or thick cased OCXO's. My CTI and IsoTemp OCXO's both have very thin casings and are therefore very sensitive to ambient temperatures, even when isolated, which is why I don't use them at this moment. My setup and environment (put everything in a sand box in the basement?) has to be changed considerably for me to use them.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on August 04, 2020, 01:40:26 pm
After setting the temperature compensation and running with it for a few days, I noticed a strange side effect.
Here are the graphs for the Trimble, with the temperature compensation in effect:

[attach=1]

Note the Ambient and OCXO oven temperature graphs on the bottom first. When the temperature drops a bit around 30.000 seconds, there is a sudden steep rise in the oven temperature, until about 64.000 seconds when there is a sudden and steep drop. This is unrelated to the room temperature! These transitions can also be observed in the ns and DAC graphs. So despite the fact that the DAC graph is much flatter due to the compensation, there are some pretty serious side effects. The Oscilloquartz has exactly the same behavior.

As a result, I decided to disable the temperature compensation again. These two OCXO's don't really need it anyway.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on August 04, 2020, 04:46:43 pm
I don't quite understand - are you saying the temperature compensation has an effect on the OCXO temperature? Or that there is a dip in phase error and DAC when the temperature changes?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on August 05, 2020, 09:08:45 am
thinkfat, it is indeed very strange but after spending more time on it, I may have an explanation  :-//

Here are some observations to see if we can shed some more light on this.

Normally, and without temp compensation, all three GPSDO's virtually show the same daily ambient and OCXO temperature curves.
It's very hard to put my finger on it due to the fuzzy graphs, but I have to assume that the OCXO temperatures follow the ambient temperatures. They transition at the same time, but since the delta excursion for the ambient is a little bit larger than that of the OCXO, that must be the lead. That makes sense and is to be expected.

Below are the Bliley temperature curves during the same period as the previously shown curves of the Trimble with the temp comp.
The Trimble should have been the same. However, just when the temperature compensation was activated several days ago, the daily curves changed as I show in the Trimble example graphs above. These are very strange changes I cannot explain yet. I also looked in more detail to the Oscilloquartz, because it behaved different after the compensation as well, but it is not the same as the Trimble.

Also below is a zoomed-in portion of the Trimble graphs above.
Note that the transition in the OCXO temperature starts at point 338, followed by the gradual transition in the ambient temp that starts at 342 and the dip in the DAC that starts at point 347. These graphs seem to indicate that the OCXO temperature is the lead and that seems to indicate that it's a Trimble issue.

The big question still is if it's related to the activation of the temp compensation (unlikely because how?) or is it a strange coincidence that the Trimble itself suddenly behaves weird?
I don't know yet, it will take a few days of further observation to see if it happens again.

I'm also going to add more temp sensors to figure out where the ambient temp changes are related to. I doubt if it is driven by the room temperature alone because the ambient variations inside the enclosure are larger than those of the room temperature. I'll also put a sensor on top of the Arduino CPU.



Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on August 05, 2020, 11:38:41 am
Initially, I thought the Oscilloquartz had the same problem as the Trimble, because it also showed this strange jump in the temperatures after I initiated the temp compensation. However, on careful examination, it appears that this jump is driven by the ambient temperature. It starts 2 seconds before the OCXO temp follows suit. I see no evidence that the ambient temperature is driven by the room temperature, so what is causing this???

Very weird coincidence!

As I mentioned, I need to add more temperature measurements to learn more.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on August 05, 2020, 11:44:31 am
You mentioned there's an isolating box around the devices, right? So, it must be something happening in that box, a temperature jump of such magnitude can hardly originate from outside.
I have seen such jumps with my own GPSDOs, but they're just on my workbench, without any protection against air drafts and completely exposed to ambient.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on August 05, 2020, 11:57:44 am
@thinkfat,
It's a pretty serious box made from 10-15mm hi-density foam. Look at the picture at post #500.
There are no leaks in the box.

The logical conclusion is that it must come from the OCXO itself.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on August 05, 2020, 01:24:47 pm
What just dawned on me...

Could it be that the internal OCXO oven controller switches to a higher temperature range when the delta with the ambient temperature becomes too small?
That would make sense, if it is really that smart and the frequency is not changing because of this...

Can somebody maybe confirm this?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: bingo600 on August 05, 2020, 02:02:44 pm
Lots of the OCXO's are not made to be wrapped in extra thick foam (isolation) , they can't "Dump their heat when needed.
A cardboard box (or just inside a box)  to isolate from "draft" is recommended , but take care when using thick isolation.

/Bingo
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on August 05, 2020, 04:55:04 pm
Are these double oven types? Maybe something triggers the secondary heater, an ambient temperature drop perhaps, and then the isolation is in the way of dumping the excess heat
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on August 05, 2020, 08:00:22 pm
@Bingo600,
Thanks for the heads-up. I started with the insulation project when I had effects I could not explain. Maybe now that everything is working as expected, I should revisit the insulation part. Before I do however, I want to learn more about the temperature sources and development inside my enclosures. There are still a few weird things going on.

@thinkfat,
The Trimble seems to be a double oven type, the Oscilloquartz apparently is not, but both have these issues.

I'll be back with more data...
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Johnny B Good on August 06, 2020, 01:02:08 am
 I believe you may be overthinking this 'problem' (mainly on account you seem to be monitoring irrelevant data such as the OCXO's case (?) temperature - it's not entirely clear what's being monitored here - readings far too low to be actual oven temperatures and the "ambient" temperature (is this actual room temperature or that of the air within the enclosure?).

===========================================================================================
[EDIT 2020-08-07]

 My bad! :-[ :palm: That data is only irrelevant in the case of a James Miller styled GPSDO design such as I've used in my MKs I and II builds. I apologise for belittling what is actually a vital sensor component in a micro-controller based design. Monitoring the OCXO's case temperature provides a 'catch all' temperature monitoring point to compensate for all sources of temperature variation.

[END_EDIT]
===========================================================================================

 The oven control (going by the way my own CQE OCXOs respond to even the briefest of interruptions to their 12v supply) is done using PWM of a constant current supply to the heater (actually a power transistor, not a Ni-Chrome wire heating element) controlled by a simple minded microcontroller algorithm maintaining a thermistor at a fixed resistance value that corresponds to a precise target temperature (to better than +/- 0.5 deg C), usually around the 65 to 85 deg C mark.

 I say "simple minded microcontroller algorithm" on account of the way it seems to assume every 'reboot event' can only mean it must be starting from stone cold so turns the heater up to "eleven" whilst it runs through the rest of its reboot initialisation sequence before doing the digital equivalent of exclaiming "Oh, shit! I've overcooked the XO!" and shutting off the heater current which then results in the inevitable under/overshoot wobble you'd normally only expect to witness during an actual cold startup event. :palm: :palm: :palm:

 Of course, it may only be my CQE OCXOs that use such a daft reboot algorithm that tests the depth of the water with both feet and plunges straight into its "High speed warmup routine" before testing whether such an action is actually called for. Again :palm: :palm: :palm:

 What I'm suggesting is, if possible, log the OCXO's supply rail voltage (and any other supply rails for good measure) to see whether there are any glitch events taking place to trigger these temperature anomalies (which rather look to my mind, more like software/hardware glitches than actual temperature events).

 Single ovened OCXOs are influenced by changes of temperature to their immediate surroundings when chasing down parts per trillion stability levels.  Double ovened OCXOs are influenced to a lesser extent but still not entirely immune to this effect which is why a modest amount of insulation around a single ovened OCXO can help by reducing internal thermal gradients between the XO, the heater transistor and the sensing thermistor despite the manufacturer's best efforts to keep all three tightly coupled to each other to minimise the effect of these temperature gradients.

 Exactly how much insulation can be considered "modest" rather depends on the expected range of operating temperatures within the enclosure. Given enough insulation, even the modest 145mW dissipation from the XO and its LDO (CQE example) may be enough to raise the temperature above the set point in a particularly warm running enclosure on a hot summer's day outside of an air conditioned laboratory environment (a more likely scenario for a typical DIY GPSDO).

 To my mind, the only sane way to deal with such temperature variations is to use a double ovened OCXO since trying to compensate for them requires the response to match the actual thermodynamics involved else you risk making the situation worse.

 I've been following this thread with some interest since I may find myself having to use a microcontrolled solution to improve on my current hardware PLL controlled GPSDO project where the only major issue I have is due to the unpredictable nature of the ionosphere's effect on the propagation delay of the satellite signals which manifests itself as a variation of 30 to 40ns in the case of the M8N based MK I unit and around 10ns for the M8T based MK II unit I'm currently building. Sadly, even the timing receivers when configured to a fixed location aren't immune to these imperfectly corrected for perturbations in the electron density of the ionosphere :(

 I'm now only awaiting the imminent delivery of panel mount 3.5mm stereo jack sockets to finalise my MK II build. I'm using one to provide a connection to the buffered EFC voltage and a stable 2v dc offset to let me monitor the voltage difference between them on the 1000mV scale of my cheap Mestek DM91A 9999 counts DMM in leu of spending over a hundred quid on a cheap 4 1/2 digit bench meter. I can now monitor variations in EFC voltage in 100uV increments with this cost effective solution - an order of magnitude improvement over using the DM91A just on its own.

 Obviously, with no microcontroller nor DAC, I have no simple automated way to log data to generate fancy MDEV or ADEV plots, just observations from 'scope traces comparing both GPSDOs against each other and my stand in for a Rubidium reference, the OCXO in my FY6600, trimmed to within 5ppt by exploiting the 2G tipover effect to fine tune it against diurnal temperature variations and the almost imperceptible daily ageing effect.

 It's not an ideal solution but it comes close enough to reveal the slow wobbles of phase shifting for minutes to tens of minutes variations in propagation delay from the changing ionospheric conditions. Unfortunately, the once superb stability of this free running OCXO seems to have gone all to pot this past week or so and it looks like I need to revamp the calibration trimmer circuitry (better 22 turn trim pot and more padding to limit the frequency trim range and quite possibly the use of a 5v CMOS RRO opamp to reduce slider contact resistance volt drop effects).

 OTOH, I might just build my own double ovened OCXO using one of my ample stock of 10MHz CQE OCXOs to create a stable enough independent reference to compare the behaviour of my MKs I and II GPSDOs against. I'd like to take the basic hardware PLL based GPSDO to its limit before I start experimenting with microcontroller based designs since it will provide a useful benchmark to test such a new design against.

 In the meantime, I wish you all the best with your own Lars based GPSDO design. I think you just need to step back and reconsider other possible causes for your current anomalous results. I know just how easy it is to get stuck down a dead end road where nothing seems to make sense any more. :-//

JBG
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on August 06, 2020, 08:13:49 am
This is mostly for others following this blog, they may get confused by the following statement from JBG, the rest is mostly irrelevant.
Quote
I believe you may be overthinking this 'problem' (mainly on account you seem to be monitoring irrelevant data such as the OCXO's case (?) temperature

When you don't have the luxury of an atomic clock to your disposal to measure (compare) the accuracy and stability of your DIY GPSDO, you can use TimeLab to characterize your tool. Lars has several examples in his documents, go read them if this is new to you.

The way to use Timelab to characterize your GPSDO is to collect the DAC values and import them into the tool, while converting them back to a frequency representation. However, this only works when the DAC values have a 1:1 relation to the differences measured against the 1PPS coming from the GPS, measured by the TIC system in nanoseconds and the OCXO through the DAC settings.

When the DAC values are influenced by things like temperature, this will skew and distort the TIC relationship and hence the TimeLab representation is of less value. It no longer shows the true disciplined OCXO performance and stability.

The OCXO oven temperature can be monitored by Lars' program to get a handle on the temperature based deviations on the DAC, and his firmware can compensate the DAC settings by taking the OCXO temperatures into account.
The idea behind this is to get a DAC curve that is as much as possible devoid from temperature based deviations.

Below is an example of one of my GPSDO's, with the Trimble OCXO. The graphs show the DAC values, the OCXO temperature, the ambient temperature within the enclosure and the ns value coming from the TIC over a 24 hr period. The second graph shows the room temperature (in red) in my office. All temperatures show a dip of several degrees Celsius, and you can clearly see that the DAC follows this curve, which will compromise a TimeLab measurement. Note that the ns graph does not follow this.

This shows that it is very important to monitor the OCXO temperature and also find the source of deviations in order to properly compensate the DAC.

Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Johnny B Good on August 06, 2020, 09:50:34 pm
 Apologies for using the phrase, " irrelevant data". Upon reflection, knowing how the seemingly small variations of room temperature can effect the OCXO in my cheap FG, monitoring the OCXO's case temperature seems about the best choice of monitoring point since changes of temperature here, once the oven has reached thermal equilibrium, will have the greatest impact on frequency stability. Not only that but it also includes not just the room temperature contribution but all other contributions from the rest of the internal components.

 From my own narrow viewpoint of a basic hardware PLL based GPSDO, it just seemed to be an inevitable variable that would be cancelled out in the disciplining process anyway. However, what had struck me about the graphed data was the suggestion that these anomalies looked more like hardware or software bugs in the logging process.

 These last graphs of the DAC values are very suggestive of variations due to ionospheric effects superimposed upon a longer term temperature trend (trying to interpret their meaning tends to leave me with a bit of a headache :-// ).

 Although the contrast between the Lars design being discussed here and my Gyro inspired version of the James Miller "GPS Stabilised 10 MHz Oscillator", described here : -http://www.leapsecond.com/pages/gpsdo/  as:-

"This is about the simplest design possible for a GPSDO; with no DAC, no Vref, no time interval counter, no microprocessor. Just an XOR gate acting as a phase comparator against the 10 kPPS output of a Jupiter GPS engine. In spite of this simplicity, the performance is amazingly good"

couldn't be any greater, I thought my own observations, such as they are, might offer some small insight into this problem of inexplicable temperature excursions, even if only by way of 'light relief'.

 As you pointed out, in the absence of such data to feed into mathlab, the only other way left open to gather meaningful statistics is to employ an atomic class standard such as a Rubidium oscillator. I'd love to possess one but long gone are those happy days when it had been possible to get hold of used units for just 100  to 200 quid. Since I'm not ready to justify the hundreds of pounds expenditure on one, I'm trying to make do with second best (a very finely trimmed OCXO).

 My recent past experience with the OCXO installed in my cheap FG suggests I could DIY a double ovened OCXO using one of the spare 10MHz CQE single ovened OCXOs for this project which could perform better than what I'd been able to achieve with my cheap FG setup and perhaps suffice as a cheap stand in for the ideal of a Rubidium oscillator reference.

===========================================================================================
[EDIT 2020-08-07]

 After embarking on yet another Holy Grail search for an affordable used Rubidium oscillator (10MHz), I finally located an LPRO-101 here:-

 https://www.ebay.co.uk/itm/Datum-EFRATOM-LPRO-101-Rubidium-Frequency-Standard-10MHz-with-PCB-0-95mHz-test/184374703310?_trkparms=aid%3D1110006%26algo%3DHOMESPLICE.SIM%26ao%3D1%26asc%3D20131231084308%26meid%3Daddf23c2f69044fb9c1c50fa1541f942%26pid%3D100010%26rk%3D1%26rkt%3D12%26sd%3D181632863973%26itm%3D184374703310%26pmt%3D0%26noa%3D1%26pg%3D2047675%26algv%3DDefaultOrganic&_trksid=p2047675.c100010.m2109 (https://www.ebay.co.uk/itm/Datum-EFRATOM-LPRO-101-Rubidium-Frequency-Standard-10MHz-with-PCB-0-95mHz-test/184374703310?_trkparms=aid%3D1110006%26algo%3DHOMESPLICE.SIM%26ao%3D1%26asc%3D20131231084308%26meid%3Daddf23c2f69044fb9c1c50fa1541f942%26pid%3D100010%26rk%3D1%26rkt%3D12%26sd%3D181632863973%26itm%3D184374703310%26pmt%3D0%26noa%3D1%26pg%3D2047675%26algv%3DDefaultOrganic&_trksid=p2047675.c100010.m2109)

 :wtf:  That's taking the piss! Here's a nice petite TinyURL  https://tinyurl.com/y23upfw5 (https://tinyurl.com/y23upfw5)

 I've just "pulled the trigger" and for just under 200 quid delivered and customs charges pre-paid, I'll hopefully have a used but calibrated LPRO-101 in two to five weeks time. Sod the expense! It's only money after all (and I can't take it with me when I finally pop my clogs).

 I've also downloaded every relevant document on the LPRO-101 from KO4BB's very useful web site like a "Good Boy Scout".  :)

===========================================================================================

 I'll save the data gathering operation for when I'm ready to try my hand with the Lars or a similarly based design after I've completed my MK II basic GPSDO to give me that added element of interest and motivation that I now require to embark on ever more complex projects these days.

JBG
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on August 16, 2020, 07:02:20 am
After I took the insulation away from the OCXO's and ran the measurements again for several days, I have decided to put them back on.

Even with the DAC temperature compensation activated, the dependency of my GPSDO systems are too sensitive to the room temperature changes. So much so that I'm loosing lock constantly, while I ran for months without problems when they were boxed in. I only took the insulation away because it seemed that the OCXO oven temperature regulation was misbehaving when the room temperatures were in the order of 30 degrees C, during the current heatwave. My take on that is that maybe the delta temperatures between the ambient and the desired oven temperatures where becoming too small, and the oven jumped to a higher temperature setting.

I think I can live with that effect during a heat wave, rather then having them so sensitive to the room temperatures.

The alternative could be to put my metal enclosed GPSDO system wrapped in insulation inside another plastic enclosure to shield it better from "sudden" room temperature changes.

Has anybody collected experience using that approach?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti on August 16, 2020, 11:53:03 am
My take on that is that maybe the delta temperatures between the ambient and the desired oven temperatures where becoming too small, and the oven jumped to a higher temperature setting.

You should see that jump in the supply current so monitor it.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: cdev on August 16, 2020, 01:06:52 pm
thermal mass. (like very fine clean and and pure sand) would help, but would be a bit of a PITA perhaps.

I was thinking of this.

http://www.sm5bsz.com/linuxdsp/hware/mirisdr/thermal.htm (http://www.sm5bsz.com/linuxdsp/hware/mirisdr/thermal.htm)

After I took the insulation away from the OCXO's and ran the measurements again for several days, I have decided to put them back on.

Even with the DAC temperature compensation activated, the dependency of my GPSDO systems are too sensitive to the room temperature changes. So much so that I'm loosing lock constantly, while I ran for months without problems when they were boxed in. I only took the insulation away because it seemed that the OCXO oven temperature regulation was misbehaving when the room temperatures were in the order of 30 degrees C, during the current heatwave. My take on that is that maybe the delta temperatures between the ambient and the desired oven temperatures where becoming too small, and the oven jumped to a higher temperature setting.

I think I can live with that effect during a heat wave, rather then having them so sensitive to the room temperatures.

The alternative could be to put my metal enclosed GPSDO system wrapped in insulation inside another plastic enclosure to shield it better from "sudden" room temperature changes.

Has anybody collected experience using that approach?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: 0xFFF0 on August 17, 2020, 11:30:23 am
Hi,
I built Lars' circuit and connected a Ublox Neo 7M. But I don't get stable ns tics. If I feed in 1Hz from a function gen, then I get a Lock. Do I have to make further settings in the U-Center? Where could the problem be?

Code: [Select]
time ns dac temp status diff_ns filtX10 tc filt timer1 temp1
...
38 38906 43622 0 NoLock 23996 184080 32 1 25228 0 1088 -1 65535 65535
539 28908 43692 0 NoLock -9998 184080 32 1 25177 0 1089 -1 65535 65535
540 -27090 43761 0 NoLock -55998 184080 32 1 24897 0 1090 -1 65535 65535
541 -54094 43831 0 NoLock -27004 184080 32 1 24763 0 1091 -1 65535 65535
542 37909 43901 0 NoLock 92003 184080 32 1 25222 0 1092 -1 65535 65535
543 28906 43971 0 NoLock -9003 184080 32 1 25178 0 1093 -1 65535 65535
544 -1090 44041 0 NoLock -29996 184080 32 1 25028 0 1094 -1 65535 65535
545 2905 38426 0 NoLock 3995 34030 32 1 25048 0 1095 -1 65535 65535
546 29906 38437 0 NoLock 27001 34030 32 1 25183 0 1096 -1 65535 65535

   
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on August 18, 2020, 08:42:49 pm
Maybe the LO frequency is waay off...
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on August 19, 2020, 07:07:42 am
0xFFF0,

Very strange results you have...

Can you use a scope and look at both the 1PPS from the NEO and the 1Hz from your function generator?
Trigger the scope on the 1Hz signal.
The 1PPS will jitter about 20nS but otherwise should be stable. Both signals will slowly drift, but there should be no jumps.

In U-Center, you can exclude sats with a signal strength of less than 20dB. How many sats will then roughly remain?
Do you have a good view of the sky, meaning all around you (360 degrees), or is it severely restricted?
What kind of antenna do you use, and where is it located.
Can you post a picture of the GPS board?
Post a screenshot of u-center after it ran for at least an hour or so. (the longer the better)

Good luck!
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on August 21, 2020, 12:08:29 pm
I have been working on getting the temperature compensation running on my Oscilloquartz and Trimble OCXO's and wanted to share the before and after so you can see the effect.

I can only show three graphs and I need four so I will split the two OCXO's.
Here are the before and after for the Oscilloquartz.

You can clearly see that at first, the DAC values follow the OCXO temperature. This will skew the reports when you use TimeLab, because it uses the DAC values to calculate the 10MHz frequency stability. If the DAC moves around based on the temperature effects, so will the frequency, and this will show up in the TimeLab graphs. If we can eliminate, or reduce the temperature effect, the representation in TimeLab is much closer to the GPS disciplined OCXO reality, which is what we want.

After the temperature compensation is activated, you can see that the temperature now has a much more reduced effect on the DAC.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on August 21, 2020, 12:10:51 pm
And here are the before and after for the Trimble.
After calculating the values, and running for a day, I actually tweaked the compensation by hand to get more accuracy.

Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: 0xFFF0 on August 21, 2020, 03:20:39 pm
0xFFF0,

Very strange results you have...

Can you use a scope and look at both the 1PPS from the NEO and the 1Hz from your function generator?
Trigger the scope on the 1Hz signal.
The 1PPS will jitter about 20nS but otherwise should be stable. Both signals will slowly drift, but there should be no jumps.

In U-Center, you can exclude sats with a signal strength of less than 20dB. How many sats will then roughly remain?
Do you have a good view of the sky, meaning all around you (360 degrees), or is it severely restricted?
What kind of antenna do you use, and where is it located.
Can you post a picture of the GPS board?
Post a screenshot of u-center after it ran for at least an hour or so. (the longer the better)

Good luck!

Could it be that I have a Neo7 where the settings cannot be changed? I've seen that there are devices with ROM. Changes are always lost.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on August 21, 2020, 04:04:17 pm
It could be you have a counterfeit that isn't a NEO7 at all ;) Everything is possible.

But anyway, if you haven't grossly misconfigured Lars' software, it should achieve lock even with default GPS settings. Most importantly you need to set the gain correctly for your OCXO.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Fennec on August 21, 2020, 04:21:26 pm
Could it be that I have a Neo7 where the settings cannot be changed? I've seen that there are devices with ROM. Changes are always lost.

Jepp, most Clones has no flash ram. You can check it in U-Center.
https://portal.u-blox.com/s/question/0D52p00008HKEEECA5/psa-fake-ublox-modules-and-potential-ways-to-identify-them

it should achieve lock even with default GPS settings.

Nahh, not really. If you set the U-blox M7N to Gallileo Satellites, you have a more accurate System, because Gallileo works with Maser-Clocks only.
Too many Satellites are not really good for the accuracy. We had the same theme in the BG7TBL thread.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: 0xFFF0 on August 21, 2020, 05:29:55 pm
Seems to be okay, but with ROM.

??:??:??  $GPTXT,01,01,02,u-blox ag - www.u-blox.com (http://www.u-blox.com)*50
??:??:??  $GPTXT,01,01,02,HW  UBX-G70xx   00070000 *77
??:??:??  $GPTXT,01,01,02,ROM CORE 1.00 (59842) Jun 27 2012 17:43:52*59
??:??:??  $GPTXT,01,01,02,PROTVER 14.00*1E
??:??:??  $GPTXT,01,01,02,ANTSUPERV=AC SD PDoS SR*20
??:??:??  $GPTXT,01,01,02,ANTSTATUS=DONTKNOW*33
??:??:??  $GPTXT,01,01,02,LLC FFFFFFFF-FFFFFFED-FFFFFFFF-FFFFFFFF-FFFFFFFD*2D
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on August 21, 2020, 06:41:00 pm
Could it be that I have a Neo7 where the settings cannot be changed? I've seen that there are devices with ROM. Changes are always lost.

Jepp, most Clones has no flash ram. You can check it in U-Center.
https://portal.u-blox.com/s/question/0D52p00008HKEEECA5/psa-fake-ublox-modules-and-potential-ways-to-identify-them

it should achieve lock even with default GPS settings.

Nahh, not really. If you set the U-blox M7N to Gallileo Satellites, you have a more accurate System, because Gallileo works with Maser-Clocks only.
Too many Satellites are not really good for the accuracy. We had the same theme in the BG7TBL thread.

For a DIY GPSDO Lars-style, it doesn't matter if you use Galileo or GPS. It should still lock if you use a small enough time constant. As long as the time pulse is in the right ballpark, it'll be fine.

Anyway I don't believe the stability of the Galileo master clock can be transferred to the receiver, with all the uncertainty added by the transmission medium.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on August 22, 2020, 10:21:32 am
Fennec,

Quote
We had the same theme in the BG7TBL thread.
Can you please point to that section? there are way too many threads to plow through.
Thank you!
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Johnny B Good on August 23, 2020, 02:42:50 am
After I took the insulation away from the OCXO's and ran the measurements again for several days, I have decided to put them back on.

Even with the DAC temperature compensation activated, the dependency of my GPSDO systems are too sensitive to the room temperature changes. So much so that I'm loosing lock constantly, while I ran for months without problems when they were boxed in. I only took the insulation away because it seemed that the OCXO oven temperature regulation was misbehaving when the room temperatures were in the order of 30 degrees C, during the current heatwave. My take on that is that maybe the delta temperatures between the ambient and the desired oven temperatures where becoming too small, and the oven jumped to a higher temperature setting.

I think I can live with that effect during a heat wave, rather then having them so sensitive to the room temperatures.

The alternative could be to put my metal enclosed GPSDO system wrapped in insulation inside another plastic enclosure to shield it better from "sudden" room temperature changes.

Has anybody collected experience using that approach?

 Whilst that would filter out the effect of sudden changes in ambient temperature, it does have the downside of elevating the operating temperatures of all the other components, notably that of any electrolytic capacitors which are best kept as cool as possible to maximise their limited service lifetime ratings. Solid state devices will generally be more tolerant of elevated temperatures unless they already run hot to begin with at more normal ambient temperatures.

 Incidentally, the best OCXOs using true SC cut xtals have their oven temperature set point at 92 deg C, according to this article I found when trying to refresh my memory of the "Facts"

 https://4timing.com/techcrystal.htm

 Istr seeing temperature figures of 75 to 85 deg being mentioned for OCXO oven set point temperatures. That's significantly higher than I'd remembered but it does explain the upper ambient temperature limits of 80 deg I'd seen quoted for some OCXOs.

 That higher temperature set point is all to the good since this provides a healthy leeway on just how much thermal insulation you can get away with for any given expected maximum interior case temperature without losing control of the oven set point temperature. With typically less than 100mW for the LDO, the oven controller and the oscillator itself, I guess you can probably take the OCXO's case temperature to within 5 or 10 deg of the oven's set point before compromising its stability.

 IOW, your hypothesis over the OCXO switching to a higher set point temperature is somewhat in error, not the least because, should such an algorithm even exist, it seems rather unlikely with this Lars based design that the temperature would have increased to the point where such an action would ever be called upon. The point of the oven is simply to maintain the xtal oscillator at a precise temperature over a very wide range of external temperatures and nothing more. If the external temperature exceeds the manufacturer's limits, there's no fancy algorithm that can rescue the situation.

 I'm surmising that since the device controlling the heater current also happens to be the heating element itself (a small tabbed plastic power transistor or two), control could simply take the form of an analogue negative feedback proportional controller (no need for fancy PWM to control a separate resistive heating element to avoid the switching device contributing any of its losses into the mix as well as any spurious switching transient noise from a microcontroller running a PID control algorithm (True SC cut somewhat eases the oven set point temperature precision requirements). However, that article didn't go into such detail with regard to oven controllers - that's just an 'educated' guess on my part and I'm probably way off the mark, being the long suffering serial victim of Sod's Law that I am >:(.

 If you've managed to exclude any highly stressed electrolytics from the design, you could try adding a heating element to keep the interior at a moderately high set temperature, say another five to ten degrees higher than you'd expect to see under maximum temperature heatwave conditions otherwise your best bet would be simply to house the OXCO within its own little thermo regulated housing (assuming it isn't a double ovened OCXO to begin with).

 Incidentally, you're not the only one experiencing peculiar VFC variations which, in my case, seem to be an OCXO issue quite possibly related to its oven controller or the 5 to 12v boost converter I'm using to power it. My MK II GPSDO (a modernised version of the James Miller design using a u-blox M8T) has been showing several millivolts variations over and above those expected from ionospheric errors over the past week or so since it was last powered up.

 It's well at odds with the experience I'd had with the MK I's "Five Volt" 13MHz OCXO retrace behaviour where, for example,  it would lock in at 3.293v and gently drop to 3.289 over the next two or three days before increasing back to the 3.293v mark to resume its 2mV or so per week upward ageing trend.

 The MK II did a similar retrace over the first day or two (2.2815v dropping to 2.2791v) before increasing right up to a peak of 2.2860v a few days later only to drop down to around the 2.2835 volt mark where it's been hovering up and down by a millivolt or two ever since, way more than can be accounted for by uncorrected ionospheric errors alone.

 It's a real puzzle which warrants further investigation with a Rubidium frequency standard which, according to the rather pompously named "Global Shipping Programme"'s latest email last Wednesday " has cleared customs and is now out for delivery with the courier" (at their Erlanger shipping centre in Kentucky???  :wtf:).

 Presumably, according to my all knowing brother in law, it's now awaiting cargo space on the next available commercial airline flight which, thanks to the Covid 19 travel restrictions, are now in rather short supply. ::) :palm:

  In the meantime whilst 'm awaiting delivery of that LPRO-101, I might as well carry on monitoring the EFC voltage before opening the MK II up to monitor the OCXO's 12v supply rail (I can already monitor the 5.310v Vcc rail through the sma socket I wired up to let me run FFT spectrum traces of its noise and ripple content via a 4u7 ceramic DC block bypassed with a 1KR to let me measure the voltage with a DMM without any need to open up the enclosure). There seems little point in disturbing it until I've got my Rubidium frequency standard all set up and ready to go.

 If you do decide to run that experiment, do take care to avoid thermally overstressing any expensive components. It may fail but even a failed experiment leaves you a little wiser and hopefully not too out of pocket if you took enough care not to overstress anything expensive.

 Unless you have a bad one, I rather doubt the OCXO is that sensitive to external temperature shifts as to cause the microcontroller to 'lose it big time'. It's either a flaw in the control algorithm or else a component that has an inordinately high tempco which is not being properly accounted for.

 Past temperature related problems with this Lars design all seem to have arisen during initial testing outside of any enclosure where draughts and/or solar insolation have created fast temperature transients which more or less disappear once the project has been installed into its enclosure or simply shielded from those influences. In your case, boxing it up hasn't cured it of its seemingly inordinate sensitivity to external changes of temperature. The problem might simply be a wiring error or else something you've overlooked.

 You might need to give it a few more coats of "Good looking at" to figure out the true cause of this temperature induced instability you're experiencing. Otoh, taking a few days break can often work wonders by allowing you to take a fresh look at the problem.  :)

JBG
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on August 23, 2020, 12:34:52 pm
Has somebody figured out how to derive and display the true OCXO frequency from the data provided by the Lars program?  :-//

I have tried the TimeLab method in Excel but that only works well when you subtract the frequency offset and the drift line and these statistical numbers are not available in the Lars program.


Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on August 23, 2020, 01:16:04 pm
Has somebody figured out how to derive and display the true OCXO frequency from the data provided by the Lars program?  :-//

I have tried the TimeLab method in Excel but that only works well when you subtract the frequency offset and the drift line and these statistical numbers are not available in the Lars program.

Even TimeLab cannot do that. It will display "something" because it cannot know how the data it is being fed was generated, and probably all assumptions on what the number represents are broken anyway. So it will not be a "true OCXO frequency". It's only a number with an unknown relation to the true OCXO frequency.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on August 23, 2020, 06:33:58 pm
I think you can get really close though.
Consider that over a long enough period, like a day or more, the average DAC setting must be very close to the ideal 10Mhz by virtue of the GPS disciplining.
If you used that averaged DAC number, and subtract the actual DAC value from it, you get a delta of the ideal 10MHz.
If you multiply that delta with the gain multiplied with 1E-9 you get an offset in absolute fractions of a Hz.
My assumption is that this is the way TimeLab does it.

I tried that in Excel and it gets really close.
The challenge of course is in getting absolute values based on past averages, and we will never know exactly how close they are to the real thing.

I also have to assume that the display of the OCXO frequency on the BG7TBL is done the same way.
Or is there another trick?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: cdev on August 23, 2020, 07:45:52 pm
The display would always round out to be less (maybe a lot less) than 1 significant digit away from 10,000,000 - but it might be hard to tell how much if the accuracy variation was in the millihertz range, as what do you compare it to?


Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on August 23, 2020, 08:59:55 pm
The display would always round out to be less (maybe a lot less) than 1 significant digit away from 10,000,000 - but it might be hard to tell how much if the accuracy variation was in the millihertz range, as what do you compare it to?

Ultimately, the reference is of course the GNSS. The idea to use the DAC average (better, the DAC bias term in Lars PI loop) to be the "true" 10MHz and then compute the frequency offset in terms of DAC deviation from this "true" value has some merit, but unless you can compute the uncertainty of that value, it's useless to output anything. Moreover, this average is moving up and down quite a bit first and foremost due to thermal effects, so unless you can compensate all these effects perfectly, the DAC values are not worth a lot.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on August 26, 2020, 06:41:27 pm
Hi everyone

After researching various designs for a GPSDO I settled on the Lars solution.

I've built it up and it works, but with a couple of issues. Sorry if these have been covered already, I have read most of the posts on this thread!

When I switch it on I get regular "Missing 10MHz?" for about 15 minutes, even though the 10MHz input is a good 5V p-p square wave. Eventually it will lock and the message no longer appears. Is there a setting I can tweak to stop this?

Also, it loses lock if I close the Arduino Serial Monitor. Shouldn't it run standalone?

TIA

Mike
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: bingo600 on August 26, 2020, 07:00:40 pm
Also, it loses lock if I close the Arduino Serial Monitor. Shouldn't it run standalone?

I have seen ardu namo's w. USB misbehave if you write from the ardu (seial usb) wo having a terminal open.
I did a check if usb serial was ready , before writing.

But maybe that's already in the Lars Source

/Bingo
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on August 26, 2020, 07:46:32 pm
Also, it loses lock if I close the Arduino Serial Monitor. Shouldn't it run standalone?

I have seen ardu namo's w. USB misbehave if you write from the ardu (seial usb) wo having a terminal open.
I did a check if usb serial was ready , before writing.

But maybe that's already in the Lars Source

/Bingo

But if I switch the GPSDO on without a serial connection shouldn't it run and lock?

Mike
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on August 27, 2020, 06:35:00 am
OK I understand now.

The Arduino resets when you connect/disconnect the serial bus.  :palm:

So much to learn ...

Mike
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: 0xFFF0 on August 27, 2020, 07:24:43 am
https://forum.arduino.cc/index.php?topic=500176.0
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on August 29, 2020, 09:17:56 am
https://forum.arduino.cc/index.php?topic=500176.0]

Thank you sir, the 10uF solved the problem.

Now I have a working system. The "Missing 10MHz?" message stops after warm up and it locks reasonably quickly.

I ran a 12 hour MDEV measurement to get the hang of how TimeLab works.

Please could someone explain how to optimise the time constant, as I don't really understand the instructions that Lars wrote. Set the GPSDO into hold mode, but then what?

Thanks

Mike
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: cdev on August 30, 2020, 02:15:53 pm
I just saw this post by Bob ,KB8TQ, over on Time-Nuts on how to test an OCXO, this looks like a useful thing to add to this thread. He says that most salvaged OCXOs on EBAY etc, have issues, and this is a way to weed out the ones that are obviously defective from the good ones, (and the ones with more subtle issues, it seems).  You need a multiple bench supply with adjustable voltage and current.

http://lists.febo.com/pipermail/time-nuts_lists.febo.com/2020-August/101216.html (http://lists.febo.com/pipermail/time-nuts_lists.febo.com/2020-August/101216.html)


[time-nuts] Datasheet for TeleQuarz 20TQG01?
Bob kb8tq kb8tq at n1k.org
Sat Aug 22 09:18:58 EDT 2020
Previous message (by thread): [time-nuts] Datasheet for TeleQuarz 20TQG01?
Next message (by thread): [time-nuts] Datasheet for TeleQuarz 20TQG01?
Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi

Regardless of who made it, OCXO’s often don’t do well after being knocked around.
The process of puling them off pcb’s is stressful to the internals. The shock and vibration
in normal “junk box” storage can be an issue. As a result, the original performance data
may not be of much use.

I’ve tested a lot (like hundreds) of surplus OCXO’s. Well under 10% of them met their original
performance specs. That’s just for the stuff I can test in the basement, with better test systems,
the total would be lower.

Pinout wise, the ground pin *should* be easy to spot. Normally it’s bonded to the case. Once you
have it identified, start looking at pinot diagrams for similar sized OCXO’s. It may fit a standard
pattern. That would give you a guess for the +12V pin.

Hook up with a supply set to about a 1.2A current limit. Apply 12V to the assumed supply and
ground. The part probably pulls < 1A and almost certainly pulls < 1.5A. After 10 minutes on power
the current should start to cut back. If the case gets really hot (like you can’t touch it for the count
of 5) then something probably is wrong ….

Once you have it on power, a ’scope hopefully will spot the output pin. If it’s a sine wave, running
without a load may give you a pretty distorted output. 50 ohms is a good guess for the load.

The EFC pin should look like a high resistance on an ohm meter. It may or may not have a bias
on it when the device it powered. Feeding it 0 and 2.5V while watching the output on a frequency
counter should let you ID it. After running the device for a day or three, “tune” the EFC to whatever
voltage gives you 10 MHz. That’s the center voltage for what you have, regardless of what it
was when it left the factory ….

Lots of fun !!

Bob

> On Aug 22, 2020, at 8:34 AM, Paul Boven <p.boven at xs4all.nl> wrote:
>
> Hi again,
>
> Replying to myself:
>
> More online searching has revealed that 20TQG01 is likely a date code (week 20 of year 2001, charge G?). The other identifiers printed on the OCXO are '7368' and 'EO10391410'.
>
> On 8/22/20 11:56 AM, Paul Boven wrote:
>> Dear time nuts,
>> In my surplus drawer, I found an OCXO which I would like to use for a home-built GPSDO. The part in question is a 10 MHz, 12V OCXO, type 20TQG01. It came from a flea market, and looks to have been removed from a PCB. It's fairly large metal case (h = 2.5cm, w = 4cm, l = 5cm) and has 7 pins. According to the seller, it achieves 1.2 ppb (!).
>> Unfortunately, the Telequarz group no longer exists, and I've been unable to find anything resembling a datasheet. Any further information would be very welcome, especially pinout and performance parameters.
>> Regards, Paul Boven.
>> _______________________________________________
>> time-nuts mailing list -- time-nuts at lists.febo.com
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on September 02, 2020, 04:53:37 pm

Please could someone explain how to optimise the time constant, as I don't really understand the instructions that Lars wrote. Set the GPSDO into hold mode, but then what?

Thanks

Mike

OK I decided to do the decent thing and read this thread before asking any more questions. Several days later I have a better understanding  :-+

I have built Lars' original circuit with an NDK OCXO that came out of an IFR signal generator. It's very sensitive to control voltage (1500ppb/volt) but I managed to get the gain up to 500 with a voltage reference, potential divider and a 4.7M resistor in the DAC line.

With default EEPROM values it locks quickly and stays locked over long periods. However there are quite a few "10MHz Missing?" errors during warm up. Once it's locked they disappear forever except if I use the h command (h0, h1 etc.) when they appear quite frequently again. This means I can't use the hold mode to estimate the optimum TC. I'm confident in the quality of the 10MHz input to the divider, so could this be a software issue?

Instead I plotted MDEV in locked mode with TC=4. Am I right that it's suggesting around 1,000s for the optimum TC?

Thanks,

Mike
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on September 02, 2020, 06:29:22 pm
Provided you have not tinkered with the data by removing the drift, yes, it suggests that. But you should display the error bars and maybe take more samples, right and the "end" of the graph the uncertainty is very high.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on September 02, 2020, 07:02:32 pm
Provided you have not tinkered with the data by removing the drift, yes, it suggests that. But you should display the error bars and maybe take more samples, right and the "end" of the graph the uncertainty is very high.

OK, thanks. I will do a longer run but I get very impatient  :(.

I changed the TC to 200 and it took 85 minutes to lock, even though the TIC value was below 100 at all times.

Still confused about the 10MHz Missing message.

Mike
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on September 02, 2020, 07:48:28 pm
Provided you have not tinkered with the data by removing the drift, yes, it suggests that. But you should display the error bars and maybe take more samples, right and the "end" of the graph the uncertainty is very high.

OK, thanks. I will do a longer run but I get very impatient  :(.

I changed the TC to 200 and it took 85 minutes to lock, even though the TIC value was below 100 at all times.

Still confused about the 10MHz Missing message.

Mike

Oh, patience is a much needed trait when you tune a GPSDO ;)

The "10MHz Missing" message is printed when the ADC value is at 1023, i.e. at maximum. It should not get higher than 1000. Looks like the interpolator is not OK.

Take a look at the output of the 4046 and check the components from there to the ADC input pin. Maybe you need a larger series resistor.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on September 02, 2020, 07:51:50 pm

The "10MHz Missing" message is printed when the ADC value is at 1023, i.e. at maximum. It should not get higher than 1000. Looks like the interpolator is not OK.

Take a look at the output of the 4046 and check the components from there to the ADC input pin. Maybe you need a larger series resistor.

OK will do.

Mike
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on September 03, 2020, 03:06:27 pm
I checked the series resistor and it measured 3.8k. I replaced it with a 4.7k and there were no "Missing 10MHz?" messages during warmup  :-+

I've started another run with TC=4s (I'll leave it running longer this time). I notice that the values for TIC and diff_ns are much closer to zero than before.

Mike
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Johnny B Good on September 05, 2020, 12:26:37 pm
 Hi cdev,

 I've been preoccupied with my latest addition, an Efratom LPRO-101, this past week so only spotted your post just now. That article on testing unknown OCXOs by Bob offers good advice but there is one worrying aspect of it concerning the choice of Vcc/Vdd voltage where he suggests you just blunder in directly with a 12v Vdd voltage. If he's talking about an OCXO for which there's seemingly no published datasheet to provide any firm guidance on the required voltage (and this seems to be the case), you could land up applying 12v to a 5v part which is guaranteed to make said 5v part instantly emit its 'magic smoke'.

 This was exactly the situation I was facing just over 18 months ago with my very first (one and only) 13MHz CQE OCXO. Although it was a dead ringer for a 13MHz Vectron (the only datasheet I could download for any guidance), I was still unsure about risking 12v on what may have possibly been a 5v part (it looked like NOS rather than a carefully extracted OCXO removed from a decades old PCB where 12v was the most common Vdd specification).

 I wasn't prepared to take any risk of 'smoking my 4 quid radioham rally bargain' with a 12v jolt so tested it on a 5v supply which proved sufficient for it to start outputting a 3v p-p square wave after about 10 to 20 seconds delay (it turned out that the voltage regulation with load of the humble 1117-5 is rather crap - I was actually only getting 4.82v at the 280mA (current limited) warm up loading upon the cheap LDO used on the solder-less breadboard power adaptor board).

 After an 8 minute warm up time, the frequency settled down to 13MHz exactly and the current had dropped to 180mA. Using a potentiometer across the Vcc to supply a tuning voltage to the EFC pin proved it could be electrically tuned and thus a candidate for my GPSDO experiments (I'd already figured out a way to generate a 10MHz output locked precisely to a 13MHz square wave).

 I tried powering it from a 6.9v rail (half of the 13.8v smpsu made up with a pair of 5v 10A Farnell switchers in series modified to output 6.9v each), monitoring the square wave output voltage which had shot up to 6v p-p. I decided to risk another volt's worth using a charged up NiCad in series (I didn't possess a 32V 10A max variable bench supply back then - I do now :) ) and saw the output had risen by yet another volt strongly hinting that the oscillator/buffer was seeing the full Vdd voltage rather than the 5v of an internal LDO which would be mandated by a 12v design.

 I'd spotted a trend whereby I could expect to see a 10 or 11 volt p-p output off a 12v Vdd, assuming no loss of magic smoke, an output voltage I'd never ever seen specced by any of the many OCXO datasheets I'd perused so decided it was best to play safe and assume for the time being that it actually was a 5v part (after all, on a 5.2v supply, it was outputting a 4v p-p square wave within seconds of applying power and functioned exactly as an OCXO would be expected to behave. The only hint that it may have been a 12v part - the now slightly less protracted 7.5 minutes warm up time, wasn't strong enough evidence at the time to risk destroying my one and only OCXO to date.

 One advantage in assuming a Vcc of 5v being the simplification of the power rails in my MK I GPSDO down to just a single 5.17v. The protracted 7 minutes or so warmup was no impediment since it meant less overshoot when it finally did get up to temperature - you really need at least half an hour either way for an OCXO to be reasonably settled down before the GPS stops chasing a moving target.

 By the time I had more evidence of it being a 12v part ( a bunch of 10MHz sine output CQE OCXOs of exactly the same form factor and pin out I'd fortuitously chanced upon as a result of a continued fruitless search for a datasheet) by virtue of having enough spare 10MHz CQE OCXOs to risk blowing one up for just a modest 6 quid investment which revealed the exact same 280mA warm up current which, at 12v, dropped to just 90mA to give an identical warmed up power consumption of around 900mW, I'd already settled on a single 5.2v rail design, devoid of the need of another DC boost converter or the need to tie the power supply to a 12v only option in place of the 7 to 24 v requirement allowed by the buck converter I was using for the single 5.2v rail.

 Apart from the protracted warm up time, that 13MHz OCXO worked just fine in my MK I GPSDO (essentially a variant of the excellent James Miller design). I only retested that OCXO with a 12v rail less than a fortnight ago after I had successfully commissioned and proved my MK II variant as its replacement, proving what I had long suspected that it had been a 12v OCXO all along - still, better safe than sorry. :) It had served me well as an ersatz 5v OCXO these past 6 months or so. Now it can serve as a memento of my first experimental efforts at designing and building a GPSDO - I doubt I'll find another use for it.

 Anyhow, for anyone checking out their very first and only OCXO for which they have no absolute and incontrovertible evidence as to its actual voltage requirement, rather than plunge straight in with a 12v supply as Bob suggested (not a problem if you've bought a job lot dirt cheap), try a 5 or 6 volt supply to start with and monitor the Vref pin to check whether it stabilises at either 3.3 or 5 volts (the more ancient 12v OCXOs may have oddball 6 or 7 volt reference voltages). A 3,3v reference would strongly hint at a 5v OCXO whereas a 5v reference would suggest a 12v unit (that 13MHz CQE didn't stabilise at its 5.1xx volt set point until Vdd had hit the 11 volt mark).

 Unfortunately, checking the Vref pin (if it has one - why would you even bother with an OCXO if it doesn't have a Vref pin?) isn't a reliable indicator - some OCXO's with a "Vref pin" are no better than those without by virtue of it not being connected to anything, hence the advice to monitor the output pin to look for it reaching a fixed p-p limit as the test voltage is ramped up.

 Also, though I didn't appreciate it at the time, if the output takes 15 to 20 seconds or more to stabilise into a recognisable waveform on a 5v supply but appears much quicker off a 6v supply (2 or 3 seconds), that's a pretty good indicator that it's more likely a 12 rather than a 5 volt part. This was a more obvious indicator that the 10MHz units weren't 5 volt parts - they did eventually stabilise at a 3v p-p sine output after a 20 or so seconds delay on a 5.2v supply (slower than the 13MHz unit had done on a 4.82 volt supply - hence my doubt as to it being a 12v part).

 A variable bench supply (which I didn't have when I was first trying to determine that 13MHz OCXO's voltage requirement) is a very useful tool in this case. Although the accuracy of their built in voltage and current meters (particularly the current meter) leave something to be desired in the cheaper (affordable) Chinese models, they're still good enough to indicate unexpected behaviour perhaps just in time to terminate the test before lasting damage has occurred.

 However, a better strategy is to monitor the current demand at a 5.5 or 6 volt setting and wait for the warm up current to drop to a lower steady reading after maybe as long as 10 minutes if the part is a 12v one. The heater current is normally a constant current during the warm up phase so you can reconfigure the current limit setting on your bench supply to somewhere between the heating up current and the settled at temperature current and restart the test, allowing the current to stabilise at its set point temperature before increasing the voltage in small increments, looking for any departures from the expected small reductions in heater current demand to compensate for the voltage increase to maintain the steady energy consumption required to hold a constant oven temperature, not forgetting to monitor the clues provided by the Vref pin and the p-p output voltage level.

 If you keep in mind that the absolute maximum allowed supply voltage stress of 7 volts typically quoted in datasheets for 5v parts, if you reach the 8v mark with no obvious symptoms of distress being shown, then it's almost certain you're dealing with a 12v OCXO where you can use one volt increments to reach a 12v target. Once you're confident you're testing a 12v part, you can 'ice the cake' with a 13.2v test to definitely confirm this (standard voltage tolerance for 12v parts being +/-10% - I took the test voltage on my 13MHz OCXO right up to 14v for good measure: I was curious and had no foreseeable use for it so wasn't concerned as to whether this would prove to be 800mV too many).

JBG

Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on September 05, 2020, 05:31:41 pm
Wise advice from JBG.

I only currently have one OCXO, which was made by NDK and came out of an IFR signal generator. There is no data sheet for it but the IFR schematic shows it fed with a supply of 11V so I think it's safe to assume it's a 12V part.

I have a Trimble 65256 on order from China. It's advertised as a 12V part but I know that many of them are 5V so I will be adopting your cautious approach when it arrives.

As for a Vref pin, I wouldn't use one even if it was present as I think an external precision regulator would perform better.

Mike
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: BobPDX on September 05, 2020, 06:50:58 pm
I prototyped up the Lars GPSDO from the schematic in his original post, set a Ublox 7N to 1 Hz with a 10% duty cycle and connected the GPSDO to a BG7TBL Crystal Board dated 2016-09-25 with a DAPU 055A-HSDD OCXO. I had previously removed the trimpot on the OCXO board and replaced it with a 3 wire header for the ground, voltage reference and control signals.  Lars original software was downloaded and used unmodified.  I did use the F1 D command to set the DAC nearer the approximately 3.3 Volts needed to give a 10 mHz signal.  The control voltage was monitored by a Fluke 45 DVM and the output frequency measured by a BG7TBL FA-2 Frequency counter with a gate of 1 second.  A LPRO-101 rubidium oscillator, which had been calibrated to a Cesium Standard 2 months ago when I purchased it, was used as the FA-2 clock.  One of the purposes of building the GPSDO was to provide ongoing assessments of accuracy of this clock, and perhaps eventually discipling it also.  The GPSDO was run continuously for more than 24 hours before collecting the data shown in the attached.  The Lars GPSDO appears to be accurate (assuming the clock is still on frequency) with a median value of 10,000,000.000 078 Hz and a mean value of 10,000,000.000 222 Hz  with a n=25112.    The frequency does vary over several milliHz as shown in the FreqTimePlot.pdf attached.  Perhaps someone who is familiar with what this GPSDO  could advise me how much the precision could be improved with better settings.  By comparison and on the same scale is a similar plot from a BG7TBL GPSDO 2014-12-09 input with the same clock.  Thank you.  Bob
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: cncjerry on September 06, 2020, 07:33:43 am
 Hey, I read thru all the notes, Lars did a great job and Jim Harmon took it a step further with the 7200 and DAC.  I plan to use Jim's design to discipline an Rb unit but instead of all the EFC stuff, the Rb I'm using takes a tuning word of .2e-11 offset so I can just send that over another serial line.  I bought two of those M8T GPS units a while back, one for the Rb and another for a DOCXO.

Question: how are you getting the data for the Adev/Mdev charts? Is that coming off the Aduino in relation to the GPS 1PPS phase?  I use a reference, either a Cs or another GPSDO, with Riley's DMTD as realized by Bert feeding a TIC.  I want to compare this to my Lucent GPSDOs. 

Thanks,

Jerry
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on September 06, 2020, 09:10:50 am
Root cause found for the temp/ns/DAC jumps.

For several months I have been hunting for the cause of the strange temperature jumps of the three different OCXO ovens I have. For far too long, I suspected the temperature jumps to come from the ambient temp, or the OCXO oven and this would influence the ns/DAC jumps and so I was hunting in that direction.

I have finally found the root cause.
Below is what happens with my Oscilloquartz version. It is no longer using the full OCXO isolation, to avoid "over-heating" but the whole GPSDO unit is now in an extra enclosure with isolation to avoid sudden room temperature drifts.

These graphs run from midnight to midnight and are sampled every second as they are coming from the Lars firmware. I collect the output by a Raspberry Pi connected to the Txd/Rxd pins of the Arduino Nano. These daily log files are emailed to me.
To see what is going on during the day, I also use a USB-mini cable connected between the Arduino and my PC. I use the Arduino serial monitor to show the second by second Lars' report on my screen.

The cause of the temperature jumps, that literally changes from one second to the next, is due to my PC waking-up from sleep in the morning or going to sleep in the evening. This going to sleep or wake-up will activate or deactivate the power on the USB port of the PC, and hence will apply 5V to the Arduino through the USB serial link, or not.

This is interesting, because I feed a regulated 8V DC to the VIN power input of the Arduino, and I do not have any other logic connected to the 5V and 3V3 power outputs from the Arduino board. I only have a 100uF cap attached to the 5V output, and nothing to the 3V3 output. You would think that the 8V supply and the on-board voltage regulator would sufficiently power the Arduino, regardless of the presence of 5V coming from the USB connection. The Arduino circuit uses a Schottkey diode (D1) to "OR" the on-board regulated 5V supply with the 5V coming from the USB input.

For a reason I cannot explain yet, the Arduino ADC1 and ADC2 inputs that are used to sample the temperatures are influenced when you apply the USB cable with power. You can also see in the graphs that ADC0, used for the TIC input, gets the same treatment, and this influences the TIC measurement (ns graph) and hence the DAC.

Because of the DAC jumps, we have a "falsifying" event in the TimeLab reports.

The solution would be to use a USB cable with the 5V power removed, or remove D1 on the Arduino board. Unfortunately, this diode is located on the bottom of the PCB and is not easy to get to when you already soldered the Arduino on a main PCB, like I did.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Fennec on September 06, 2020, 12:08:50 pm
Hey,

my english is not the best but I found this. Maybe someone can use it.

/attached
comes from https://ieeexplore.ieee.org copyright maybe? idk

[attachimg=1]

Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Johnny B Good on September 06, 2020, 09:37:41 pm
Wise advice from JBG.

I only currently have one OCXO, which was made by NDK and came out of an IFR signal generator. There is no data sheet for it but the IFR schematic shows it fed with a supply of 11V so I think it's safe to assume it's a 12V part.

I have a Trimble 65256 on order from China. It's advertised as a 12V part but I know that many of them are 5V so I will be adopting your cautious approach when it arrives.

As for a Vref pin, I wouldn't use one even if it was present as I think an external precision regulator would perform better.

Mike

 Hi Mike,

 thanks for that 'vote of appreciation'.  :) The advice really only covers the situation where you just can't find a datasheet or any hints whatsoever of the Vcc / Vdd voltage requirement for a one and only example of OCXO. If I'd found a datasheet for the 10MHz CQE OCXOs, I might have dared to test the 13MHz unit at 12v sooner rather than much later using the additional clue given by both types exhibiting the exact same 280mA constant current warm up characteristic.

 I never did find any datasheets for the 10MHz units and the vendor had no idea either so I only discovered they were a 12v type by risking one at the higher voltage (the difference being that I had another two to spare at that stage). I'd already committed to a 5 volt only design by then and since the 13MHz OCXO seemed to be coping much better with a 5.0v supply than any of those 10MHz variants ever did, I decided to play safe and carry on assuming the 13MHz OCXO was a 5 volt part with just a rather protracted warm up characteristic (I didn't have a variable voltage bench supply back then otherwise it might well have been a different story).

 My thinking behind the use of an OCXO Vref instead of a separate high precision reference IC was that even if a cheap 'n' cheerful 1117-5 LDO had been used, the fixed loading from the oscillator and thermal controller and another fixed 1mA external load would eliminate the issue of voltage variation with current demand and the fixed 12v supply, likewise the voltage regulation versus input voltage variations and ripple leaving only the question of the effect of its TC. Guess what? With a precisely regulated 'oven temperature', this was simply going to be yet another non-issue!  :)

 Until I saw this blog posting:-

http://syncchannel.blogspot.com/2016/03/schematic-of-cts-1960017-10mhz-ocxo.html (http://syncchannel.blogspot.com/2016/03/schematic-of-cts-1960017-10mhz-ocxo.html)

 I would have expected the Vref pin option to always be an excellent alternative to a separate (and expensive) high precision voltage reference IC. In this case, I'd agree with you regarding an external precision voltage reference IC being the much superior option.  ::)

 I suppose I should now qualify my recommendation with the phrase "provided it is a 5v reference in the case of a 12v OCXO or a 3.3v reference in the case of a 5 volt one and you run a basic verification test to prove they will be as temperature stable as you have every right to expect".

 It seems at least one brand (CTS) cheats on this critical aspect of OCXO design so I can see why you have a different view to my own (so far I've only had experience of the CQE brand which doesn't cheap out on the Vref circuit). It seems I touched lucky with that batch of seven CQE 10MHz 12v OCXOs I'd purchased at just £4.99 each off a UK seller last year. If they're good enough for the Symmetricom GPSDO described here:- https://youtu.be/zkzMtLyqju4?t=793 (https://youtu.be/zkzMtLyqju4?t=793)

 I think I can safely say they must be one of the better brands for use in a DIY GPSDO.  :) That one is almost identical to mine in that the DOC number matches exactly that of all of the 10MHz units in my own modest collection (the 13MHz one has a different DOC number). Even the little blue circular stickers are the same except for the fact that on mine they appear to be a day/month code rather than whatever the 90/4 is supposed to represent. (on very close inspection, the number seems to be 30/4 - another day/month code, maybe the colour of the sticker codes for the year?). The layout on the label is different but all the numbers are present on both mine and that Symmetricom one. The 9850/0529 looks to be some sort of serial number since they're all unique on mine eg 0042/nnnn, 0047/nnnn and 0050/nnnn on the five remaining spares I have to hand.

 I was rather pleased to see a CQE OCXO used in that Symmetricon GPSDO since I seem to be the only one mentioning this particular brand in these EEVBlog topic threads. They must be good quality OCXOs otherwise Symmetricom wouldn't be using them in any of their kit. :)

 In my case, stability of this voltage reference trumps absolute accuracy since I just need a very stable meter DC offset to allow a cheap 9999 counts DMM to display the millivolts portion to within a tenth of a millivolt, allowing me to observe the effects of ionospheric and tropospheric timing errors, the latter being about a tenth of the former, inherent in the GPS navigation system which impose those annoying subsonic (mHz) phase shifts that become ever more evident when trying to use them to calibrate RFSs to within a few uHz in even the best of the single frequency (L1) GPSDOs.

 Using a more expensive dual frequency timing receiver can dynamically cancel the ionospheric timing errors for each of the SV signals used in the navigation fix calculations but are a rather expensive solution for hobbyist use.

 A GPSDO, whether a simple cheap DIY effort or a sophisticated expensive microntroller based one disciplining a high quality double ovened OCXO, might be accurate enough over days long intervals out to tens of years but they all stink when it comes to the minutes long periods of stability required to calibrate an RFS to within a few uHz of its potential accuracy within a reasonable span of time. To do that, you need to be disciplining another RFS which could be done with the cost effective Lars based design that doesn't have to cope with the unpredictable behaviour of OCXOs at this scale of precision.

 Whilst a microcontroller based GPSDO can, in principle use a Kalman filtering algorithm to smooth out these annoying phase shifts from data collected over periods of 24 hours and longer, this seems like a "Catch 22" situation in that you're relying on what you're disciplining to carry on following a predicted trajectory by which to refine the tuning voltage to match an average of the previously collected data.

 Unfortunately, even the best quality of double ovened OCXOs can't be guaranteed to always follow the plan and will depart from their predicted trajectory from time to time, requiring a contingency algorithm to promptly drag them back on frequency. It strikes me that the Lars design either lacks such an algorithm or else it isn't being properly tuned by those attempting to configure their own implementations (or, possibly overlooking unexpected shortcomings in their choice of components and circuit layout).

 Disciplining a RFS is a lot easier. You only have to compensate for ageing once you've stabilised the base plate temperature and eliminated the effect of barometric variations (using a barometric sensor to compensate via the external tuning voltage input being the most practical alternative to a vacuum containment or, a little less impractical, a pressure regulated containment).

 Of course, the main worry by hobbyists who've blown close to 200 quid on a twenty year old RFS is the remaining lamp life. Most hobbyists will put up with the limitations of an OCXO based frequency standard and only run the RFS for a day or three at a time for occasional use as a calibration standard in order to extend the service life of this precious commodity..

 Considering the exorbitant pricing of a "High Quality" GPSDO, I think I'd prefer to take my chances and run a disciplined RFS full time - I'd like to see just how much longer a 20 year old RFS with a "Design life of at least ten years" will run for before it needs replacing.

JBG
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on September 07, 2020, 03:16:17 pm
I would have expected the Vref pin option to always be an excellent alternative to a separate (and expensive) high precision voltage reference IC. In this case, I'd agree with you regarding an external precision voltage reference IC being the much superior option.  ::)

Yes I'd rather use an external reference with known characteristics than the unknown internal circuitry of the OCXO.

I think your requirements are rather more demanding than mine. All I need is an accurate affordable 10MHz frequency reference for occasional use to calibrate my frequency counter and other amateur radio equipment.

Mike
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on September 07, 2020, 03:37:15 pm
Of course, the main worry by hobbyists who've blown close to 200 quid on a twenty year old RFS is the remaining lamp life. Most hobbyists will put up with the limitations of an OCXO based frequency standard and only run the RFS for a day or three at a time for occasional use as a calibration standard.

I'd not trust a RFS that hasn't warmed up and settled for at least a couple of days...
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: cncjerry on September 07, 2020, 07:35:40 pm
Hats off to Lar's.  I breadboarded his circuit, hooked it to one of my HP 10811s that sit on a board from an HP 5328 counter and gave it a shot.  It wouldn't lock until I found I had to invert the EFC.  So I made a simple change in the programming and it locked in about a minute (changed the positive to the negative terminal - Young Frankenstein) .  Yet to see if it sticks but I'm optimistic.

I wish I had wired up the Lock LED to make it easier to watch.  Anyway, lots of fun with a simple circuit.

Jerry

Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on September 08, 2020, 04:06:59 pm
I've just finished a 5 day run of my Lars GPSDO with a 4 second time constant. Some results are attached, and I have some questions for the experts please.

1) Does the MDEV plot suggest an optimum time constant of around 500 seconds?
2) Given that my use for this is as a frequency standard for occasional calibration of test equipment I have no need to run it 24/7. If I chose a shorter time constant for a faster lock time what effect would it have on frequency accuracy?
3) Is it possible to deduce the quality of the OCXO from these results (e.g. good/average/poor)?

Thanks!

Mike
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on September 08, 2020, 07:32:26 pm
Is that really the DAC column you imported, or is it that TIC values? TIC values would be mostly useless, as they don't tell you enough about the OCXO.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: 0xFFF0 on September 08, 2020, 10:39:24 pm
The DAC is in the 3rd column. But the value jumps a lot.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on September 09, 2020, 06:14:38 am
The DAC is in the 3rd column. But the value jumps a lot.

Yes, but with TC=4 that's expected. The DAC follows closely the TIC and the ADEV or MDEV will eventually expose the point where the GPS beats the OCXO with regards to stability.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on September 09, 2020, 10:36:19 am
Is that really the DAC column you imported, or is it that TIC values? TIC values would be mostly useless, as they don't tell you enough about the OCXO.

Yes, I imported the DAC column.

Mike
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on September 09, 2020, 10:47:53 am
Is that really the DAC column you imported, or is it that TIC values? TIC values would be mostly useless, as they don't tell you enough about the OCXO.

Yes, I imported the DAC column.

Mike

Did you by chance edit the series in TimeLab? Like, remove linear drift or drift curve? The MDEV graph looks a bit indecisive here, after 5 days of collecting samples, you'd expect a very clear uptick that signifies the OCXO drift. But it's going down and further down only.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on September 09, 2020, 10:49:38 am
The DAC is in the 3rd column. But the value jumps a lot.

Here's an extract from an overnight run with TC = 200s. The DAC value rises and falls slowly. Is that correct?

(I don't have any temperature compensation yet and the GPSDO is not enclosed).

Mike
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on September 09, 2020, 11:03:07 am
Did you by chance edit the series in TimeLab? Like, remove linear drift or drift curve? The MDEV graph looks a bit indecisive here, after 5 days of collecting samples, you'd expect a very clear uptick that signifies the OCXO drift. But it's going down and further down only.

Yes I subtracted the global linear frequency trend. Here is the unedited plot.

Mike
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on September 09, 2020, 11:47:38 am
Did you by chance edit the series in TimeLab? Like, remove linear drift or drift curve? The MDEV graph looks a bit indecisive here, after 5 days of collecting samples, you'd expect a very clear uptick that signifies the OCXO drift. But it's going down and further down only.

Yes I subtracted the global linear frequency trend. Here is the unedited plot.

Mike

Aha. Well, that's more like it. You know, by removing the linear frequency trend you edited out the very thing you've been looking for :-)

Now, how I'd interpret the graph is that this OCXO should be good up to a time constant of 2000 seconds, which is pretty impressive, especially since it is not protected against temperature changes at all.

PS: Note that the curve shows a clear drift behavior only beyond 20000 seconds, which is a bit too good to be true. That would be more in line with a Rubidium standard, but not with an OCXO.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on September 09, 2020, 12:23:04 pm
Mike,

The DAC plot looks reasonable. There are no significant corresponding changes in the ns plot, although the excursions are a bit large. Due to the saw-tooth effect, this should create about a 20nsec "band", which it typical and sufficient.  Your setup is not bad at all, most of the saw-tooth excursions are in a 15nsec band, which is very good. From your data, it looks like that the DAC just moves with the temperature.

Due to the temperature induced changes on the DAC (room temperature changes and draft), it makes sense to add OCXO temperature tracking. With that you can compensate the DAC with the temperature effects and try to eliminate them.

This is important because these temperature induced changes in the DAC values "falsify" a TimeLab plot based on the DAC values and therefore cannot show the "real" OCXO performance. This DAC-based TimeLab method is a poor man's way of looking at the OCXO performance, so keep that in mind.

Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on September 09, 2020, 12:24:29 pm
When looking at the pictures in Lars' docs (page 19-21) he got something like ~1E-12 at 1000secs (in "the hold mode", not sure it is an identical measurement process, however)..
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on September 09, 2020, 12:36:18 pm
Thanks everyone, that's all very educational!

Now, how I'd interpret the graph is that this OCXO should be good up to a time constant of 2000 seconds, which is pretty impressive, especially since it is not protected against temperature changes at all.

The problem with such a long time constant would be the initial lock time (I think 2000 seconds would take around 3 hours with the warmup?) as I don't plan to run this continuously. However I will try it out of curiosity (this project is becoming addictive!).

I will add temperature compensation once I put it in an enclosure.

My Trimble OCXO is due to be delivered today, and yesterday I bought a Vectron oscillator on eBay from a UK seller (just £10 and it's new!) so I will have plenty to play with soon.

Mike
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on September 09, 2020, 12:42:12 pm
Quote
However I will try it out of curiosity (this project is becoming addictive!)

 :-DD Welcome to the club!
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: 0xFFF0 on September 09, 2020, 01:29:44 pm
Would you post photos of your device? A little hardware porn...
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on September 09, 2020, 02:23:19 pm
Would you post photos of your device? A little hardware porn...

Of course, here it is.

I'm running it off a 15V wall wart which supplies an LM7812 for the OCXO, then an LM7805 for the logic/Arduino/GPS and a REF02EZ for the OCXO control voltage.

All unused tracks on the stripboard have been removed, and I've built a transistor buffer for the 10MHz output.

The GPS antenna is an active puck mounted on a ground plane on the house wall with about 180 degree view of the sky.

Mike
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on September 09, 2020, 04:08:34 pm

My Trimble OCXO is due to be delivered today, and yesterday I bought a Vectron oscillator on eBay from a UK seller (just £10 and it's new!) so I will have plenty to play with soon.

Mike

A quick update on this. The Trimble OCXO is tatty but working, although very power hungry. It draws 1.9A on startup before settling down to around 200mA.

The output looks a bit noisy. This is with an open circuit control pin.

The good news is that the Vectron device I ordered is an MX2001X4 which appears to be what is fitted inside the Trimble module  :-+

Mike
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: 0xFFF0 on September 09, 2020, 06:46:58 pm
The assembly is quick and clean. What is the REF02 for? If the GPS fails?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on September 09, 2020, 07:11:07 pm
The assembly is quick and clean. What is the REF02 for? If the GPS fails?

No, it's a precision 5 volt reference that feeds the resistive divider connected to the OCXO voltage control.

Mike
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: 0xFFF0 on September 09, 2020, 07:27:55 pm
The assembly is quick and clean. What is the REF02 for? If the GPS fails?

No, it's a precision 5 volt reference that feeds the resistive divider connected to the OCXO voltage control.

Mike

??? The OCXO voltage control comes from Arduino PWM.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on September 09, 2020, 08:24:16 pm
??? The OCXO voltage control comes from Arduino PWM.

Yes, but in order to reduce the tuning range of the OCXO to get the gain up to around 500 I had to add a resistor network and a 5 volt supply. I couldn't do it with resistors alone.

The circuit is attached. The 10M resistor has been reduced to 4M7 and the gain is now 585.

Mike
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: 0xFFF0 on September 09, 2020, 08:34:47 pm
??? The OCXO voltage control comes from Arduino PWM.

Yes, but in order to reduce the tuning range of the OCXO to get the gain up to around 500 I had to add a resistor network and a 5 volt supply. I couldn't do it with resistors alone.

The circuit is attached. The 10M resistor has been reduced to 4M7 and the gain is now 585.

Mike

Ok, now I understand. A kind of limiter/bias. The REF02 can drift around 0.5mV, but I think that doesn't matter.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: rpetitho on September 10, 2020, 07:33:04 am
I posted this on another thread, but wanted to show the difference between an indoor and outdoor antenna on my GPSDO (very similar to Lars' design). This was the same antenna, but ran it for a few hours outside, then a few hours inside.

[attachimg=1]
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: 0xFFF0 on September 10, 2020, 08:22:28 am
I posted this on another thread, but wanted to show the difference between an indoor and outdoor antenna on my GPSDO (very similar to Lars' design). This was the same antenna, but ran it for a few hours outside, then a few hours inside.

[attachimg=1]

Would be interesting to know how much dB U-Center shows indoor and outdoor.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Johnny B Good on September 10, 2020, 08:55:15 am
I posted this on another thread, but wanted to show the difference between an indoor and outdoor antenna on my GPSDO (very similar to Lars' design). This was the same antenna, but ran it for a few hours outside, then a few hours inside.

[attachimg=1]

 Proof positive that it's vital to locate the antenna outside with as clear an all round view of the horizon as you can achieve! :) It doesn't matter how good the gpsdo is, a poorly sited antenna will seriously degrade the phase and frequency stability. There are enough deficiencies in the whole GPS system to start with without adding yet another deficiency in the form of a poorly located antenna. :(

John
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Johnny B Good on September 10, 2020, 10:52:32 am
I posted this on another thread, but wanted to show the difference between an indoor and outdoor antenna on my GPSDO (very similar to Lars' design). This was the same antenna, but ran it for a few hours outside, then a few hours inside.

[attachimg=1]

Would be interesting to know how much dB U-Center shows indoor and outdoor.

 It's a surprisingly small 10 to 15 dB drop in the C/NO figures!  :)  I was testing the second of the last two 24 quid M8T modules I'd purchased some five weeks ago despite a seemingly minor "NAV5" bug, that turned out to be a USB2 winXP VM driver issue I'd discovered only a a day ago, in the first 41 quid one I'd purchased some weeks earlier from the Amazon seller "Amoq313"  (the bad news is that he's now bumped the price to £59.19 - still relatively cheap, mind you) using the supplied IPX connected active 25mm square ceramic patch antenna on my bench, some 15 feet away from a lead roofed first floor bay window, when I wanted to force LoS to avoid wearing out the IPX connector so I could verify the 4Hz 50% unlocked PPS output I'd programmed (set to 10Hz 50% when locked for the purposes of this test).

 Optimistically, I rather though that placing a small empty peanut tin and then a taller coffee powder tin over the antenna might have cut off the signals, especially if filled with steel wire wool to act as an "RF absorber". Fat chance! ::)

 Just as on all previous attempts to provoke a LoS situation, human flesh still proves the most effective attenuator (using my hand to cover the antenna) even if it still wasn't enough to provoke an unlocked state (I wasn't about to risk damaging the module by sitting on it to degrade both the signal and my dignity any further).

 Even disconnecting the antenna to invoke a LoS condition to lose (NOT "Loose"! >:() GPS lock can take several minutes to remove all trace of the SV signals from the sky map plot. These M8 u-blox modules (both N and T types) can maintain an extremely tenacious grip on its acquired constellation of SV signals unltil they all finally dip below the 5dB C/NO threshold for more than a few seconds.

 It's an impressive 'Party Trick' to my mind, considering that even with a good antenna, the signals are still below the background noise, but it does make simulating a LoS condition a lot more tricky to achieve when you want to avoid undue wear and tear on the antenna connectors. However, I've just remembered that in the case of active antennas, an effective way to obtain another 20 to 30dB loss is simply to disable the active power in the ANT CFG settings (has no effect of course with a passive patch antenna).  Dang it! I clean forgot that fact!  :palm: :-[

John
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on September 10, 2020, 12:41:36 pm

 ... when you want to avoid undue wear and tear on the antenna connectors.
John

That's easy, just fit SMA connectors to the pads provided on the PCB.

Mike
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Johnny B Good on September 11, 2020, 03:42:48 am

 ... when you want to avoid undue wear and tear on the antenna connectors.
John

That's easy, just fit SMA connectors to the pads provided on the PCB.

Mike

 That's all fine and dandy after you've verified that the delivered module is working properly before tainting it with the leaded goodness of 'proper solder' to avoid accusations by the seller, in the event you have to return it for a refund or replacement, that you've damaged it by careless soldering.  :)

 I've soldered edge contact SMA sockets to these modules in the past to avoid fiddling around with those pesky IPX connectors any longer than needed to do the initial test, using clip on connectors to the Vcc, GND and TTL serial contacts which have been more trouble than they're worth (I use an elastic band with a  4 pin header to provide a more reliable temporary connection for these tests now).

 The MK I gpsdo build used a right angled edge soldered SMA socket to attach the module to the rear panel for additional support but the current MK II which replaced it makes use of an IPX ended panel mount SMA socket pigtail, mainly it has to be said due to the M8T module's location and orientation within the case.

 Regardless of the connector type, it's still good practice to avoid a high connect/disconnect cycle count to keep wear and tear to a minimum even with the more robust SMA sockets if you can help it.  :)

 John
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Fennec on September 11, 2020, 08:45:06 am
@Johnny B Good

Pls can you make some pictures from your "version". U know, pix say more than 1000 words..

@all  (esp. Dbldutch)

Pls upload PCB files (projects) for maybe Eagle, Target something like that, so it make it way easier to change the PCB design. Just the Gerber files are hard to use.
Also pls upload more pictures, configs, wich OCXO you use, and the source code. It's way easier than to read the whole thread.

kr
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on September 11, 2020, 12:32:15 pm
Fennec,

I'm posting most of my stuff on my own blog to not pollute this thread more than needed, and through that you can get to my Github site. I think I mentioned that in an earlier thread.

https://github.com/paulvee/Lars-GPSDO (https://github.com/paulvee/Lars-GPSDO)
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: cdev on September 11, 2020, 12:50:14 pm
I have one of the exact same GY-GPSV3-NEO "blue boards" which Lars mentions in his original description, the one where to connect the 1PPS you need to connect to the high side of the LED resistor.

The GPS board is thinner than the typical PCB size and I had to use a shim on an SMA to use mine with the SMA connectors I had at that time. Now I have some that work without a shim, of course.

But to test the GPS with any SMA antenna just plug the antenna cable with its SMA edge mount in without soldering it.

You may have to use gravity to presss the tinned area - prop it up a bit at an angle to get it to make the connection adequately. It takes a little less than 15 minutes to work from a cold start.

Additionally, in my experience if one is careful the (male?) IPX connectors may last years and can be used dozens of times. You buy them premade. The other end is tinned.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Johnny B Good on September 12, 2020, 01:58:22 am
@Johnny B Good

Pls can you make some pictures from your "version". U know, pix say more than 1000 words..

@all  (esp. Dbldutch)

Pls upload PCB files (projects) for maybe Eagle, Target something like that, so it make it way easier to change the PCB design. Just the Gerber files are hard to use.
Also pls upload more pictures, configs, wich OCXO you use, and the source code. It's way easier than to read the whole thread.

kr

 Well, I'm a little flattered that you think "my version" will be of much interest here since... well I'll quote this from the leapsecond.com article on a GPSDO performance comparison here:- http://www.leapsecond.com/pages/gpsdo/ (http://www.leapsecond.com/pages/gpsdo/) since it's essentially a re-spin of the following using a modern u-blox timing GPS rx module in place of the Jupiter-T, running at 100kPPS to simplify the divider and operate at a better optimised phase locking input frequency.

"James Miller Simple GPSDO

This is about the simplest design possible for a GPSDO; with no DAC, no Vref, no time interval counter, no microprocessor. Just an XOR gate acting as a phase comparator aginst the 10 kPPS output of a Jupiter GPS engine. In spite of this simplicity, the performance is amazingly good."

 Not only does it lack all the essential component parts of the Lars design, it also lacks sensitivity to ambient temperature variations (just thought I'd toss that in  >:D ). So posting pictures of "my version" and hand drawn circuit sketches here would, I suspect, be regarded as "off topic" and earn me a  :--

 I've been following this thread simply because it relates to a cost effective DIY GPSDO project and hasn't withered away like 99% of all other GPSDO related threads that I've been able track down. Also, of course, I'm doing this with a view to finally making use of one of my collection of three Nano3 boards, the first of which didn't get extracted from the anti-static bag it had been delivered in some 18 or months ago, until just a few months back to try it out with the "Blink" test program... er, sketch?

 I've only made contributions where I've believed they might help, either in regard of more general problems that apply to all designs of GPSDO or where they might just prompt a fresh look at the problem. I know just how easy it is to become blind sided to a problem that ultimately in hindsight proves to be blindingly obvious now! ::)

 I'm currently trying to build myself an RFS from an Efratom LPRO-101 rubidium frequency standard which means mounting it in an enclosure where I can stabilise the base plate temperature and compensate for the effects of changes in atmospheric pressure.

 It turns out that it's not only ambient temperature variations you have to account for with a RFS but barometric variations as well and whilst I had hoped I could keep it simple and use a barometric sensor with analogue output which, with some pre-conditioning, could be applied directly to the freq tuning input terminal, it turns out that the most cost effective way is to use a cheap digital sensor and, you've guessed it, a nano3, so it looks like I'll be diving much deeper into programming the nano3 rather sooner than I thought.

 If my nano3 based environmentally compensated RFS project succeeds, the next obvious project is going to be this Lars gpsdo one (leaving me just one spare nano3 to find a use for). Ultimately, if I'm going to discipline my RFS to a GPS based frequency standard, the Lars design is the most cost effective way to smooth out the minute to minute and hour to hour phase variations by averaging days' worth of timing data with a Kalman filtering algorithm to compensate for the ageing driven frequency drift of the RFS. It might be some time before I'm ready to make any experience based contributions to this topic though.

John (formally JBG)

Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on September 12, 2020, 08:54:45 am
Update on item #561: root cause of OCXO temperature jumps

Contrary to what I first believed the root cause for the OCXO temperature jumps was, it is not caused by the USB power connections (+5, GND or shield), but the data lines (D- and D+). I figured this out by using a break-out board contraption after I isolated the +5V line earlier.
 
If either one or both of the data lines are connected, both temperature measurements in the Lars report jump by about 0.5 degrees up when connected and down when not.

I can't explain that yet, can anybody?  :-//

Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Fennec on September 14, 2020, 07:56:45 am
Dbldutch
Johnny B Good
& all

Very interesting to watch/read both of you at work. You're doing a great job. Thanks a lot for this.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on September 14, 2020, 08:04:32 am
Update on item #561: root cause of OCXO temperature jumps

Contrary to what I first believed the root cause for the OCXO temperature jumps was, it is not caused by the USB power connections (+5, GND or shield), but the data lines (D- and D+). I figured this out by using a break-out board contraption after I isolated the +5V line earlier.
 
If either one or both of the data lines are connected, both temperature measurements in the Lars report jump by about 0.5 degrees up when connected and down when not.

I can't explain that yet, can anybody?  :-//

Where's that Arduino, in the box with the rest of the GPSDO? Maybe it just consumes more power with USB connected. Maybe connecting the USB lines has an influence on the voltage reference for the ADC. Can you provide an external reference?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: tonyalbus on September 14, 2020, 08:38:00 am
I took the time today to make two of the modifications imo suggested:
Quote
1. 78xx are the poorest performers in terms of TC and noise, it could be the fluctuations come from there (I would replace the 7808 with something better)
2. pot trimmer - I would avoid it, large TC of resistance and of wiper contact
3. resistors around the EFC input - should be low TC ones
4. LM35 - with longer wires put a "68-82ohm ser 10u MLCC" between its output and gnd (close to its pins).

Instead of using the 78L08 as the basis for the 4V OCXO reference voltage divider, I'm now using an LM4040 4.096V shunt. (fed through a 3K9 resistor from the 8V to get a 1mA current)
The result is so remarkable it is beyond belief! Gone are the oscillations and the instability. If your OCXO does not have a reference voltage out, make sure you use a real reference. I'll show some results later.

I also did 4, but there is little change however. I think I'm going to be using a filter in software later on. I don't think the current variations are going to help if I invoke the temperature compensation.

I'll do 2 and 3 if/when I go to a pcb layout. Right now I'm still playing and experimenting. Yesterday I got my CTI OC5SC25 OCXO, still fitted on the original pcb that was cut from the original. After de-soldering, a quick test showed it to be working, so I'll have another one that I can play with.

More later

Thank you very much for your insights imo!  :clap:

PS: it turned out that I was using a different setting for my measurement. The result with the reference is not that spectacular, but definitely a significant improvement.

Hi Guys, one of you have the datasheet of the CTI OC5SC25 ..or thee connections... it seems hard to find.
Thanks,
Tony
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on September 14, 2020, 08:53:28 am
@thinkfat:
All three of my GPSDO's (all electronics including the Arduino Nano) are inside an aluminum enclosure. The Oscilloquartz GPSDO enclosure is inside a plastic enclosure, and that is where the Raspberry Pi and the temperature sensor and fan is also.

However, I see this effect on all three of my GPSDO's.
I currently do not believe that the regulated 8V power applied to the Arduino plays a role, and neither do I believe that the onboard 5V regulator is the culprit. However the USB to serial FT232RL chip provides the 3V3 supply and that may cause the issue.

I do not know enough about the Arduino architecture, but I also suspect the Arduino internal reference used for the ADC's. Unfortunately I do not know from what voltage it is internally driven from.

It would take some serious surgery to change to an external reference and calibrate everything so I'm holding off on that idea, however good it is.

This must be an issue related to the Arduino Nano, and not related to Lars' hardware.

As a minimum, we now know the cause of the effect on the temperature, and what causes the jumps on the DAC.

Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on September 14, 2020, 09:13:00 am
After I put my Oscilloquartz based GPSDO inside a plastic container, and regulated the inside temperature with a fan, I am very happy with the results.

In the picture you can see the Trimble and Bliley based GPSDO's in their aluminum enclosures. The same enclosure for the Oscilloquartz is inside the plastic container.

There is a 30mm 5V fan high in the back of the plastic enclosure, and that is driven by an DS18B20 temperature sensor through a script on the Raspberry Pi, that is also inside the container. The RPi also logs the Lars' report and uses a wireless connection to mail me the results. You can see the 5 holes on the front panel where fresh air is sucked in. The air flow is only over the top of the electronics inside, while the GPSDO has bubble wrap insulation and is located on the bottom. The air flow does not strike the GPSDO.

I'm using a proportional PWM signal to drive the fan, and it keeps the temperature inside the enclosure at 33 degrees and within .2 degrees. The ambient temperature sensor inside the GPSDO enclosure is stable at 52 degrees, and the temperature sensor inside the isolation box around the OCXO is now also stable at 65 degrees, both within half a degree Celsius. I think I have finally isolated the temperature effects on the DAC, although the room temperature changes have been moderate the last few days.

The next step is to add a P(I?)D controller function to control the fan even better with larger swings of the room temperature, and I have ordered two more 30mm fans for the other two enclosures. I have high hopes that if I can control the ambient temperatures inside the GPSDO enclosures better, I can also largely eliminate room temperature effects on the DAC.



Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on September 14, 2020, 06:04:51 pm
Bargain of the week. I bought this OCXO on eBay for just £10 from a local test equipment supplier. I don't think they knew what it was, as it was advertised simply as a 10MHz oscillator and has never been used  ;D ;D. Sadly they don't have any more ...

[attachimg=1]

Anyway, here is the phase noise specification from the data sheet. Can anyone interpret this for me please? Is it a reasonable performance for a GPSDO?

[attachimg=2]

Mike
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: 0xFFF0 on September 14, 2020, 06:11:17 pm
The last Vectron from ebay was defective.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on September 15, 2020, 09:36:56 am
The last Vectron from ebay was defective.

Oh I think I've got a good one. It tunes up to 10MHz at exactly half the reference voltage, and after 12 hours the frequency had moved by 10ppb. The spec is 1ppb/day after 72 hours so we shall see.

Mike
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: 0xFFF0 on September 15, 2020, 12:58:37 pm
The last Vectron from ebay was defective.

Oh I think I've got a good one. It tunes up to 10MHz at exactly half the reference voltage, and after 12 hours the frequency had moved by 10ppb. The spec is 1ppb/day after 72 hours so we shall see.

Mike

Did you heat insulate it?

I have a nice OCXO for you:
https://www.morion-us.com/catalog_pdf/mv336m.pdf (https://www.morion-us.com/catalog_pdf/mv336m.pdf)
 ;D
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: cdev on September 15, 2020, 01:08:52 pm
If anybody sees any decen't new reliable 10 MHz OCXOs for sale inexpensively, not equipment pulls, please post them and what you know about them.

Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: FriedLogic on September 15, 2020, 02:19:52 pm
I'm currently trying to build myself an RFS from an Efratom LPRO-101 rubidium frequency standard which means mounting it in an enclosure where I can stabilise the base plate temperature and compensate for the effects of changes in atmospheric pressure.
   I did that too - also with an LPRO, which I think is one of the best to use for this. It's a cheap way to get something that's getting on for caesium performance without the price. It's particularly easy using fan cooling.
   One of the main reasons that I did it in the first place was to make a good reference for GPSDOs, but it was so good that I lost most of my interest in GPSDOs after that.

Quote
It turns out that it's not only ambient temperature variations you have to account for with a RFS but barometric variations as well and whilst I had hoped I could keep it simple and use a barometric sensor with analogue output which, with some pre-conditioning, could be applied directly to the freq tuning input terminal, it turns out that the most cost effective way is to use a cheap digital sensor and, you've guessed it, a nano3, so it looks like I'll be diving much deeper into programming the nano3 rather sooner than I thought.
   I use an analogue sensor to bias the EFC too, but have been looking to upgrade. I thought that I'd found one in the Infineon KP236, but on testing there are larger steps in the output than I would like. Some old Bosch ones like the SMD288 are promising if a little noisy. I was trying to avoid having to use a digital sensor and microcontroller etc. just for a sensor, but it's looking like that's probably a good way to go. The effect of changes in barometric pressure seemed a bit delayed too, so using a microcontroller here could allow for that.

Quote
If my nano3 based environmentally compensated RFS project succeeds, the next obvious project is going to be this Lars gpsdo one (leaving me just one spare nano3 to find a use for). Ultimately, if I'm going to discipline my RFS to a GPS based frequency standard, the Lars design is the most cost effective way to smooth out the minute to minute and hour to hour phase variations by averaging days' worth of timing data with a Kalman filtering algorithm to compensate for the ageing driven frequency drift of the RFS.
   I had also originally thought about making a full GPSDO with it, but did not end up doing that. Once you have temperature control, air pressure compensation and long term drift correction, a good LPRO could have a better stability than GPS out to a tau of days, so if short term measurements are relevant there's something very wrong. I think that it would probably take something like a u-blox ZED-F9 series receiver to see what's going on. I think that some folk on the time-nuts list were going down this route.
   If you can do continuous measurements (such as with a TDC) what can be useful is adding other references (quartz/Rb/GPS) into the mix. That way, if you do get a frequency jump or any other strange issues, it's easier to see what has happened.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Fennec on September 15, 2020, 02:56:58 pm
Does anyone has tried to discipline a Rubidium Reference like the FE-5680A or FE-5650A?
I've searched but I can't find an easy solution. The DAC is too imprecise to be used as a Mhz10 ... 000 reference. So you have to use the analoge side. And I can't find any information about that. Maybe the Heater itself?
My "good" FE-5680A is more than 10Hz off.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on September 15, 2020, 03:00:26 pm
Does anyone has tried to discipline a Rubidium Reference like the FE-5680A or FE-5650A?
I've searched but I can't find an easy solution. The DAC is too imprecise to be used as a Mhz10 ... 000 reference. So you have to use the analoge side. And I can't find any information about that. Maybe the Heater itself?

LPRO-101 is an easy target. You can just hook up the DAC to the external C-Field input.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on September 15, 2020, 05:30:46 pm
Did you heat insulate it?
Not yet, but I will when it's on the PCB. I'm just aging it at the moment  ;)

I have a nice OCXO for you:
https://www.morion-us.com/catalog_pdf/mv336m.pdf (https://www.morion-us.com/catalog_pdf/mv336m.pdf)
 ;D
Well it's better than my Vectron but probably costs 10 times as much  :(
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Johnny B Good on September 16, 2020, 04:18:11 am
I'm currently trying to build myself an RFS from an Efratom LPRO-101 rubidium frequency standard which means mounting it in an enclosure where I can stabilise the base plate temperature and compensate for the effects of changes in atmospheric pressure.
   I did that too - also with an LPRO, which I think is one of the best to use for this. It's a cheap way to get something that's getting on for caesium performance without the price. It's particularly easy using fan cooling.
   One of the main reasons that I did it in the first place was to make a good reference for GPSDOs, but it was so good that I lost most of my interest in GPSDOs after that.

Quote
It turns out that it's not only ambient temperature variations you have to account for with a RFS but barometric variations as well and whilst I had hoped I could keep it simple and use a barometric sensor with analogue output which, with some pre-conditioning, could be applied directly to the freq tuning input terminal, it turns out that the most cost effective way is to use a cheap digital sensor and, you've guessed it, a nano3, so it looks like I'll be diving much deeper into programming the nano3 rather sooner than I thought.
   I use an analogue sensor to bias the EFC too, but have been looking to upgrade. I thought that I'd found one in the Infineon KP236, but on testing there are larger steps in the output than I would like. Some old Bosch ones like the SMD288 are promising if a little noisy. I was trying to avoid having to use a digital sensor and microcontroller etc. just for a sensor, but it's looking like that's probably a good way to go. The effect of changes in barometric pressure seemed a bit delayed too, so using a microcontroller here could allow for that.

Quote
If my nano3 based environmentally compensated RFS project succeeds, the next obvious project is going to be this Lars gpsdo one (leaving me just one spare nano3 to find a use for). Ultimately, if I'm going to discipline my RFS to a GPS based frequency standard, the Lars design is the most cost effective way to smooth out the minute to minute and hour to hour phase variations by averaging days' worth of timing data with a Kalman filtering algorithm to compensate for the ageing driven frequency drift of the RFS.
   I had also originally thought about making a full GPSDO with it, but did not end up doing that. Once you have temperature control, air pressure compensation and long term drift correction, a good LPRO could have a better stability than GPS out to a tau of days, so if short term measurements are relevant there's something very wrong. I think that it would probably take something like a u-blox ZED-F9 series receiver to see what's going on. I think that some folk on the time-nuts list were going down this route.
   If you can do continuous measurements (such as with a TDC) what can be useful is adding other references (quartz/Rb/GPS) into the mix. That way, if you do get a frequency jump or any other strange issues, it's easier to see what has happened.

 The LPRO-101's are getting rather long in the tooth leaving you wondering just how long you've got before you resort to refurbishing the physics package with IPA to clean 20+year's worth of contaminants off the glassware and taking a hairdryer to the lamp in the hope of redistributing the rubidium back to where it belongs. They're a better choice compared to the FE5680As if you need a low phase noise reference you can use to transvert an HF transceiver right up to 24GHz without having to add a clean up XO.

 I take your point over the use of a simple fan to control temperature. You've just got to pick a target temperature that's not too high for the sake of the electronics, yet not so low that the heaters in the physics package land up running too close to the limit for comfort at the lowest expected ambient temperature.

 I reckon my chosen instrument case might be large enough to avoid the need for ventilation by varying the speed of recirculated airflow targeting the base plate to control heat dissipation into the relatively large surface area of the enclosure's panels. I've always got the option to add ventilation to the case if such a cooling scheme proves inadequate during the final commissioning test stage. It'll be interesting to see what stability improvement I can achieve with thermal regulation alone (first things first, especially the easiest ones to begin with :)).

 I've already purchased a BMP280 module from here:-  https://www.ebay.co.uk/itm/BMP280-Pressure-Sensor-Module-Arduino-Precision-Atmospheric-BMP180-Replacement/283518687928?hash=item420307dab8:g:3gAAAOSwLdVcpzYQ (https://www.ebay.co.uk/itm/BMP280-Pressure-Sensor-Module-Arduino-Precision-Atmospheric-BMP180-Replacement/283518687928?hash=item420307dab8:g:3gAAAOSwLdVcpzYQ)

 along with a couple of 4 channel bi-directional logic level converters to interface it to my Nano3 so I can experiment with the BMP280 libraries and create a suitable pressure and temperature sensor module to replace whatever thermistor based fan controller I cobble together for my initial thermal regulation experiments.

 Off the top of my head, I don't think you can sample barometric pressure readings much faster than ten times a second with the BMP280 anyway which is at least an order of magnitude quicker than I'd need even if I use an oversampling technique to filter out any sampling error noise for a once per minute update to the output signal driving the EFC input of the RFS. Even this rate is probably way faster than would actually be called for.

 Changes of barometric pressure even in the case of rapidly approaching storms here in the UK seem unlikely to exceed a 10 hPa per hour. Checking out my inexpensive I.T. Works weather station's pressure trend histogram just now shows that between 4 and 8 hours ago, there had been a 'sudden jump' (basically a 1 hPa per hour rise) of 4 hPa up to the current reading of 1010 hPa. Actually, the histogram just updated to show that same jump as now spanning an 8 hour period! At those rates of change, the Nano3 won't be working hard so much as hardly working at all ::).

 That remark about your LPRO being so good that you lost interest in GPSDOs made me smile. :) I fully appreciate where you're coming from. However, if you want to check and redo the calibration from time to time, you'll need to keep hold of at least one GPSDO even if its short term phase stability leaves something to be desired compared to a RFS.

 I checked out the price of a ZED-F9 based plug 'n' play module - too bloody expensive for my taste :o. I'll make do with a humble single frequency timing module for my current gpsdo experiments for the time being. As for the idea of acquiring a TDC (I had to google that acronym - I'd seen it used before but couldn't recall exactly what it had referred to ::) ), I'll manage a bit longer without (just like I managed without a RFS until I just had to take a closer look at how my GPSDOs were responding to the effects of ionospheric disturbance to the ToF of the satellite signals  :) ). And, to think this all started out as a means of accessing a high accuracy frequency reference to calibrate a TCXO (followed by an OCXO) upgrade of the crappy 50MHz XO smd IC in a cheap FeelTech FY6600 AWG function generator. :palm:

John (JBG)

 
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on September 16, 2020, 06:28:48 am
The LPRO-101's are getting rather long in the tooth leaving you wondering just how long you've got before you resort to refurbishing the physics package with IPA to clean 20+year's worth of contaminants off the glassware and taking a hairdryer to the lamp in the hope of redistributing the rubidium back to where it belongs. They're a better choice compared to the FE5680As if you need a low phase noise reference you can use to transvert an HF transceiver right up to 24GHz without having to add a clean up XO.

I wouldn't worry so much about the physics package in the LPRO. I'm now into repairing/restoring the third RFS of that breed (two LPRO, one SLCR) and the physics package itself was never the problem. It was always something else, mostly aging of components due to heat. Should you really need to "rejuvenate" the Rb lamp itself, it's a quick and easy procedure. Besides, that failure mode is not typical to the LPRO.

The best thing about the LPRO is that it is a fairly contemporary design, with only two components (three, if you count the physics package) being unobtainable but possibly salvageable: The SRD in the cavity and the FPGA. Everything else is standard stuff you can buy from DigiMouser. The most expensive component is likely the RF MOSFET that drives the lamp exciter, at roughly $30 in single quantities. The transistors in the synthesizer are probably hard to come by but there are suitable replacements.

Anyway, there are still so many around that repair is not economically viable today.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: axel on September 19, 2020, 02:42:42 pm
Hi everyone!

I've been wanting to get a GPSDO for my lab for a while now. Thumbed through Lars's PDFs and realized this was a surprisingly trivial circuit to set up.

I spent a day in Kicad working on my own version, with the hopes to have a compact GPSDO with 4 buffered 10MHz outputs and a USB serial port for outputting NMEA.

Here's the result:

(https://raw.githubusercontent.com/W3AXL/Simple-GPSDO/master/kicad/sch/revA/sch-small.png) (https://raw.githubusercontent.com/W3AXL/Simple-GPSDO/master/kicad/sch/revA/simple-gpsdo.png)

And the PCB:

(https://raw.githubusercontent.com/W3AXL/Simple-GPSDO/master/kicad/board-model/board-small.png) (https://raw.githubusercontent.com/W3AXL/Simple-GPSDO/master/kicad/board-model/simple-gpsdo.png)

With the hopes that the final assembly will look something like this:

(https://raw.githubusercontent.com/W3AXL/Simple-GPSDO/master/cad/render-front.PNG)

I'd love to hear thoughts, and if I've made in major mistakes in the schematic that I should fix before I commit to buy the boards.

Made a github repo for the project as well, if anyone cares to check that out (https://github.com/W3AXL/Simple-GPSDO)

Can't wait to join the ranks of people keeping Lars's legacy alive!
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on September 19, 2020, 03:30:47 pm
For a bit of additional flexibility regarding the OCXO EFC, you might want to use something like the attached circuit as a buffer/amplifier. Nevermind the DAC, just have a look at U6A and U6B.

(https://www.eevblog.com/forum/projects/lars-diy-gpsdo-with-arduino-and-1ns-resolution-tic/?action=dlattach;attach=1070018)

PS: attaching inlined images is forever broken it seems. It used to work. Not any longer :-(
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: FriedLogic on September 19, 2020, 08:30:58 pm

 The LPRO-101's are getting rather long in the tooth leaving you wondering just how long you've got before you resort to refurbishing the physics package with IPA to clean 20+year's worth of contaminants off the glassware and taking a hairdryer to the lamp in the hope of redistributing the rubidium back to where it belongs. They're a better choice compared to the FE5680As if you need a low phase noise reference you can use to transvert an HF transceiver right up to 24GHz without having to add a clean up XO.
   Most of the problems that I've seen mentioned with LPROs are electronic, not lamp. Although the lamp has a more defined ageing characteristic than most other components, it is otherwise just one reliable component out of very many others, so tends not to be the cause of too many problems. Lamps have been gradually refined over the decades, and by the late 90's it appears to have become much less of an issue.

   It's not just noise that causes problems with other types. The SRS PRS12 is excellent, but it uses a DAC for all it's adjustments. This limits the resolution to between 1E-12 and 2E-12, and there is the DAC non-linearity on top of that.
   The FE-5680A type ones come in many different variants, and usually have a coarse temperature compensation that causes frequency jumps.
   I once checked with Temex about their FRS series and was told that the analogue C-field adjustment was truly analogue and step-less, but neither of the two old Temex ones that I tried worked brilliantly.
   Most rubidiums are so noisy that for RF applications you're often going to need to add an OCXO and lock that to the rubidium anyway.

Quote
I take your point over the use of a simple fan to control temperature. You've just got to pick a target temperature that's not too high for the sake of the electronics, yet not so low that the heaters in the physics package land up running too close to the limit for comfort at the lowest expected ambient temperature.
   There's a table in the manual for it that shows the MTBF falling from 381,000 hours at 20°C  to 134,000 hours at 60°C. There's really way too much concern out there about operating them at lower baseplate temperatures. The LPRO has a minimum operating temperature of -30°C, and often will be operating in equipment which has fans blowing air over them keeping the whole case at ambient (probably not at -30°C...). Keeping the baseplate temperature down towards room temperature - although not necessary - is not a crazy low target, but will increase the power consumption a bit and probably won't be practical with fan cooling unless you live in a far north cave. If the temperature is set too low it will just take a sunny day or a heater left on for longer than expected for it to get too hot and potentially mess up a long test run.

Quote
I reckon my chosen instrument case might be large enough to avoid the need for ventilation by varying the speed of recirculated airflow targeting the base plate to control heat dissipation into the relatively large surface area of the enclosure's panels. I've always got the option to add ventilation to the case if such a cooling scheme proves inadequate during the final commissioning test stage. It'll be interesting to see what stability improvement I can achieve with thermal regulation alone (first things first, especially the easiest ones to begin with :)).
   I think that it might be a challenge to keep the temperature down with a closed case. I tried that with a power supply and there was still a lot of heat build up.
   One issue with having the fan in more or less open air is that if the air temperature changes fast (such as opening a door) it tends to cause a temperature spike - adding an extra sensor measuring the temperature of the cooling air should help. Something this size does not have a single temperature anyway, but it may be as well just compensating for any remaining temperature fluctuations rather than trying too hard to remove them.
   I was experimenting with a PWM fan that stopped rather than just going slow at minimum, and combining that with feedback should give good control.

Quote
I've already purchased a BMP280 module from here:-  https://www.ebay.co.uk/itm/BMP280-Pressure-Sensor-Module-Arduino-Precision-Atmospheric-BMP180-Replacement/283518687928?hash=item420307dab8:g:3gAAAOSwLdVcpzYQ (https://www.ebay.co.uk/itm/BMP280-Pressure-Sensor-Module-Arduino-Precision-Atmospheric-BMP180-Replacement/283518687928?hash=item420307dab8:g:3gAAAOSwLdVcpzYQ)

 along with a couple of 4 channel bi-directional logic level converters to interface it to my Nano3 so I can experiment with the BMP280 libraries and create a suitable pressure and temperature sensor module to replace whatever thermistor based fan controller I cobble together for my initial thermal regulation experiments.

 Off the top of my head, I don't think you can sample barometric pressure readings much faster than ten times a second with the BMP280 anyway which is at least an order of magnitude quicker than I'd need even if I use an oversampling technique to filter out any sampling error noise for a once per minute update to the output signal driving the EFC input of the RFS. Even this rate is probably way faster than would actually be called for.

 Changes of barometric pressure even in the case of rapidly approaching storms here in the UK seem unlikely to exceed a 10 hPa per hour. Checking out my inexpensive I.T. Works weather station's pressure trend histogram just now shows that between 4 and 8 hours ago, there had been a 'sudden jump' (basically a 1 hPa per hour rise) of 4 hPa up to the current reading of 1010 hPa. Actually, the histogram just updated to show that same jump as now spanning an 8 hour period! At those rates of change, the Nano3 won't be working hard so much as hardly working at all ::).
   Since the sensitivity of an LPRO to pressure is <1E-13/mbar, but its nominal 1s stability is very much greater at 3E-11, there's not usually much need to worry about noise or sampling rate for pressure.

Quote
That remark about your LPRO being so good that you lost interest in GPSDOs made me smile. :) I fully appreciate where you're coming from. However, if you want to check and redo the calibration from time to time, you'll need to keep hold of at least one GPSDO even if its short term phase stability leaves something to be desired compared to a RFS.
   The timescales involved are long enough that a GPS will usually be as good or better than a GPSDO anyway, as long as there are no major sawtooth issues. For calibration, I usually just log 1000 second averages of the 1PPS derived from the LPRO against the 1PPS from GPS. That makes it very easy to check the drift over hours or days.

Quote
I checked out the price of a ZED-F9 based plug 'n' play module - too bloody expensive for my taste :o. I'll make do with a humble single frequency timing module for my current gpsdo experiments for the time being. As for the idea of acquiring a TDC (I had to google that acronym - I'd seen it used before but couldn't recall exactly what it had referred to ::) ), I'll manage a bit longer without (just like I managed without a RFS until I just had to take a closer look at how my GPSDOs were responding to the effects of ionospheric disturbance to the ToF of the satellite signals  :) ). And, to think this all started out as a means of accessing a high accuracy frequency reference to calibrate a TCXO (followed by an OCXO) upgrade of the crappy 50MHz XO smd IC in a cheap FeelTech FY6600 AWG function generator. :palm:
   With me it was to calibrate an oscillator for a clock...
   There are lots of cheap boards with TDC-GP21 or GP22s in them, and there are arduino libraries for them. Just add an arduino and a few other components and for very little you can measure short time differences of up to 100us quite well. Much cheaper to buy and run than frequency counter.
   The TI TDC7200 is probably easier to use, but I've not seen any cheap boards for them.

   This may be getting a little OT for this thread, but it is one of the few ways of actually testing a GPSDO. The self referencing measurements can only go so far.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Johnny B Good on September 19, 2020, 11:54:05 pm
Hi everyone!

I've been wanting to get a GPSDO for my lab for a while now. Thumbed through Lars's PDFs and realized this was a surprisingly trivial circuit to set up.

I spent a day in Kicad working on my own version, with the hopes to have a compact GPSDO with 4 buffered 10MHz outputs and a USB serial port for outputting NMEA.

Here's the result:

(https://raw.githubusercontent.com/W3AXL/Simple-GPSDO/master/kicad/sch/revA/sch-small.png) (https://raw.githubusercontent.com/W3AXL/Simple-GPSDO/master/kicad/sch/revA/simple-gpsdo.png)

And the PCB:

(https://raw.githubusercontent.com/W3AXL/Simple-GPSDO/master/kicad/board-model/board-small.png) (https://raw.githubusercontent.com/W3AXL/Simple-GPSDO/master/kicad/board-model/simple-gpsdo.png)

With the hopes that the final assembly will look something like this:

(https://raw.githubusercontent.com/W3AXL/Simple-GPSDO/master/cad/render-front.PNG)

I'd love to hear thoughts, and if I've made in major mistakes in the schematic that I should fix before I commit to buy the boards.

Made a github repo for the project as well, if anyone cares to check that out (https://github.com/W3AXL/Simple-GPSDO)

Can't wait to join the ranks of people keeping Lars's legacy alive!

 Just one observation. I do think, imo, you have one too may switches on that front panel.  :)  To my mind, that just seems a little redundant when you can simply shut it off by literally pulling a DC jack plug out the back on those, hopefully, rather rare occasions when you might need to shut it down for repair/troubleshooting or upgrade work.

John
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on September 20, 2020, 07:13:47 am
@Axel,

Although in principle, the schematic is very simple indeed, however, the devil is lurking in the details.

I suggest you give every functional block their own voltage regulator. Especially the NEO and the Arduino. Use some fer-rites to block the 10HMz coming from the OCXO back into the DAC circuit. The 1PPS signal introduces a lot of supply and ground bounce, be aware. To slow down some edges, use small resistors in series with the 1PPS, 10MHz and 5Mhz signals.

I also suggest you look at many posts up where a method was discussed to isolate the noisy Arduino PWM output for the DAC by adding some gates with their own seperate reference supply.

You don't mention the OCXO you're going to use (I can guess from the layout), but many of them are very sensitive to the ambient temperature. I suggest to add some hardware to be able to drive a small fan to keep the temperature inside the enclosure as stable as possible. For that you need temperature sensors for the OCXO and the ambient inside the enclosure. You'll need the OCXO temp sensor to use the compensation in the Lars program anyway. I am currently experimenting with a fan and I see great results in making the DAC output less sensitive to temperatures, which will help to truly analyze the GPSDO with TimeLab plots.

Succes!
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: 0xFFF0 on September 20, 2020, 07:33:23 am
Having lots of voltage regulators is a good solution to preventing noise. Long lines between voltage regulator and consumer cause voltage fluctuations due to the relatively high PCB line resistance. Every 100uV counts.

Is temperature compensation really crucial? We are talking about a GPSDO and not a free-running OCXO. Changes in temperature should be regulated away by the PLL. In my opinion, you just have to make sure that the OCXO is protected from temporary temperature changes, e.g. an open door. A good case is enough. Long-term changes are also eliminated by the PLL.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on September 20, 2020, 07:51:04 am
A DAC that is influenced by temperature changes falsifies the GPSDO analysis in TimeLab.
If you look back into several of my earlier posts, you can clearly see the effects room temperature changes have on the OCXO.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on September 20, 2020, 08:16:27 am
Having lots of voltage regulators is a good solution to preventing noise. Long lines between voltage regulator and consumer cause voltage fluctuations due to the relatively high PCB line resistance. Every 100uV counts.

Is temperature compensation really crucial? We are talking about a GPSDO and not a free-running OCXO. Changes in temperature should be regulated away by the PLL. In my opinion, you just have to make sure that the OCXO is protected from temporary temperature changes, e.g. an open door. A good case is enough. Long-term changes are also eliminated by the PLL.

I agree with that in general. Putting a lot of thermal "impedance" between the OCXO and the environment is better than trying to compensate temperature change in software. However, what you try to achieve is keeping the GPS influence on the OCXO minimal. That demands long filters and long time constants. The PLL will eventually not be able to compensate environmental effects any more, unless you help the regulation with additional information. With very long time constants you might get the PLL to unlock even due to small temperature effects.

In any case, requirements drive the design. What do you want to do with the GPSDO? What stability do you require over which observation time? A very long time constant might not be what you want, it tends to degrade stability over large observation intervals, with no obvious gain for short tau because of the inherent phase noise of the LO.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: 0xFFF0 on September 20, 2020, 08:28:40 am
A DAC that is influenced by temperature changes falsifies the GPSDO analysis in TimeLab.
If you look back into several of my earlier posts, you can clearly see the effects room temperature changes have on the OCXO.
The changing DAC value ruins your measurement in Timelab, but not the accuracy of the 10MHz-OCXO.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: 0xFFF0 on September 20, 2020, 08:29:42 am
Having lots of voltage regulators is a good solution to preventing noise. Long lines between voltage regulator and consumer cause voltage fluctuations due to the relatively high PCB line resistance. Every 100uV counts.

Is temperature compensation really crucial? We are talking about a GPSDO and not a free-running OCXO. Changes in temperature should be regulated away by the PLL. In my opinion, you just have to make sure that the OCXO is protected from temporary temperature changes, e.g. an open door. A good case is enough. Long-term changes are also eliminated by the PLL.

I agree with that in general. Putting a lot of thermal "impedance" between the OCXO and the environment is better than trying to compensate temperature change in software. However, what you try to achieve is keeping the GPS influence on the OCXO minimal. That demands long filters and long time constants. The PLL will eventually not be able to compensate environmental effects any more, unless you help the regulation with additional information. With very long time constants you might get the PLL to unlock even due to small temperature effects.

In any case, requirements drive the design. What do you want to do with the GPSDO? What stability do you require over which observation time? A very long time constant might not be what you want, it tends to degrade stability over large observation intervals, with no obvious gain for short tau because of the inherent phase noise of the LO.

Calculating the PI filter is a science.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on September 20, 2020, 08:30:13 am
  The FE-5680A type ones come in many different variants, and usually have a coarse temperature compensation that causes frequency jumps.
   I once checked with Temex about their FRS series and was told that the analogue C-field adjustment was truly analogue and step-less, but neither of the two old Temex ones that I tried worked brilliantly.
   Most rubidiums are so noisy that for RF applications you're often going to need to add an OCXO and lock that to the rubidium anyway.

The FE-5680 breed of Rb standards is a very different design to the LPRO. They opted for an LO frequency of an even multiple of the Rb hyperfine resonance. That simplifies the design as you don't need a complex synthesizer to generate the 6.8GHz interrogation signal. Of course they then need a DDS to generate 10MHz from the LO output and that comes at a cost, too: the 10MHz output is not very "pure". But all in all, if requirements are met, this design is cheaper to make. Some FE5680 don't even have a 10MHz output, probably for a good reason.

Quote
   The TI TDC7200 is probably easier to use, but I've not seen any cheap boards for them.

It would be simple enough to make a breakout board for the TDC7200. It is not a very complex device to operate. It's just cumbersome to solder, being TSSOP package and all...
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on September 20, 2020, 12:58:20 pm
@0xFF0
Quote
The changing DAC value ruins your measurement in Timelab, but not the accuracy of the 10MHz-OCXO.

Very true, but if you don't have a Rubidium or other standard to compare with, nor a counter that can measure down to 10^-12, TimeLab is your only friend that can help you to qualify your DIY GPSDO, right?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: 0xFFF0 on September 20, 2020, 03:42:34 pm
@0xFF0
Quote
The changing DAC value ruins your measurement in Timelab, but not the accuracy of the 10MHz-OCXO.

Very true, but if you don't have a Rubidium or other standard to compare with, nor a counter that can measure down to 10^-12, TimeLab is your only friend that can help you to qualify your DIY GPSDO, right?

yep!
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on September 20, 2020, 05:40:49 pm
@0xFF0
Quote
The changing DAC value ruins your measurement in Timelab, but not the accuracy of the 10MHz-OCXO.

Very true, but if you don't have a Rubidium or other standard to compare with, nor a counter that can measure down to 10^-12, TimeLab is your only friend that can help you to qualify your DIY GPSDO, right?

Well, but if you don't have any instruments that can appreciate such precision... What for? If you cannot 'see' your GPSDO, it is by definition good enough.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: billy_gr on September 20, 2020, 06:06:19 pm
Hi,

Long time reader of eevblog, first post :)

I have build in the past this GPS DO https://www.instructables.com/id/GPSDO-YT-10-Mhz-Lcd-2x16-With-LED (https://www.instructables.com/id/GPSDO-YT-10-Mhz-Lcd-2x16-With-LED) and yesterday i have finished also the LARS version on a breadboard, tried the both on a 53131A (using them as external reference and measuring the other) and both are at 10.000.000 +-001-2mHZ when locked. ISOTEMP on the first, an old CORNING on the LARS GPSDO

I had the issues with the missing PPS and had to use a small coaxial cable to connect the C1 to ADC0 now it looks solid.
Any ideas why it is so sensitive ? I am using an Arduino Pro Mini (not Nano)

Since i am not an expert... i used the timelab on lars version for 3 hours and tried to interpretat the results.
Looks good i think (although there is an LM317 boiling hot because no 7805 on stock during the weekend...)
Comments are more than welcome !!! Feedback needed :)





Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: axel on September 20, 2020, 06:37:52 pm
Thanks for the advice and suggestions everyone, especially Dbldutch who I know has been doing amazing things with this design. Thankfully most of your suggestions are easy to implement with almost no increase to BOM cost. That's been the biggest driver here: right now my total BOM cost all-in is right at 100USD and I'd love to keep it right around there if possible.

I'll certainly look into adding individual regulators for every IC. I think I'll adjust the main reg to be a 12V-5V buck and have individual 3.3V linears powering everything directly. That way I don't have to worry too much about power dissipation with a 12V->3.3V linear conversion but I can still get relatively low-ripple 3.3V.

Filtering for the 1PPS, 5MHz, and 10MHz lines is easy. I'll also probably do a new revision of the board with the traces a lot further separated, and add some inline resistors and maybe even LPFs to the 5 and 10 meg lines. I'll definitely look into the PWM cleanup as well; I didn't thumb through all 25 pages before getting to work so there's definitely some useful tidbits here and there that I missed.

Likewise, temperature probes for the case and oven temps are also fairly easy to add in. A good idea for sure, I didn't even realize the code had provisions for temperature monitoring.

As some of you probably guessed, the OCXO I was going with originally was the McCoy OSC92-100B (also known as the Isotemp 134-12), but it seems as if this is less common on eBay than I thought (I bought the last one). I had originally intended to distribute out boards to some friends for them to build their own, but that requires them to be able to get ahold of oscillators for cheap. I'm now looking at the RALTRON OX4114A-D3-1-10.000-3.3 (http://www.raltron.com/wp-content/uploads/2017/04/OCXO-SERIEs-1000.pdf). It seems to have similar specs to the OSC92, is much smaller, and is available from Digikey for cheaper than I got the McCoy on eBay. whoops, that one has no electronic frequency adjustment. Also linked the wrong datasheet. Looks like the hunt continues!

At the end of the day, my goals for this project are two-fold: 1) a fun DIY project that will result in a useful piece of lab gear when everything's done, and 2) something to help my various used bits of test gear stay relatively in-spec. I'm definitely no "time nut" but I do a lot of RF projects and knowing I'm close enough to an accurate frequency is all I really need. My service monitor was last cal'd in 2002 so I'd imagine a good external reference will help things out.

Oh, and by popular demand the extraneous power switch has been removed in revision B:

(https://i.imgur.com/82DjOF6.png)
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on September 21, 2020, 07:17:13 am
Just wanted to show the first results of my attempts to regulate the temperature inside the GPSDO enclosure, in an attempt to isolate the OCXO temperatures from the room temperature changes. All this to get a "pure" DAC result, devoid of temperature effects.

The data is taken from my Trimble based GPSDO, where the OCXO itself is insulated from all 6 sides in a 10-15mm thick hard-foam box. Inside the box is one of the LM35 temperature sensors.

I'm using the other LM35 that measures the ambient temperature right on top of D1/R1/C1 inside the enclosure to drive a 30mm 5V DC fan with a PWM signal, coming from a simple PID controller. Both LM35's are now low-pass filtered to get rid of the noise. I've drilled a few holes in the front-panel to let the air in, but tried to keep the air-flow away from the OCXO. The fan with the electronics is located on the back-panel.

I've modified the Lars program to add the required functionality.

UPDATE: I have posted the code on my Github site. https://github.com/paulvee/Lars-GPSDO (https://github.com/paulvee/Lars-GPSDO)

This small and simple addition is very promising I think.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on September 23, 2020, 12:09:50 pm
I'll certainly look into adding individual regulators for every IC. I think I'll adjust the main reg to be a 12V-5V buck and have individual 3.3V linears powering everything directly. That way I don't have to worry too much about power dissipation with a 12V->3.3V linear conversion but I can still get relatively low-ripple 3.3V.

Unfortunately, LDOs are not very good at removing input supply ripple. You might want to look into adding a "capacitance multiplier" after the buck regulator to have a clean input to the LDOs:
https://www.youtube.com/watch?v=wopmEyZKnYo (https://www.youtube.com/watch?v=wopmEyZKnYo)
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on September 23, 2020, 07:54:14 pm
Curse this addiction  >:D >:D

A few months ago I'd never heard of a GPSDO and now I have built two of them ...

[attachimg=2]

The first is to Lars' original design using breadboard construction with an NDK OCXO.

The second is Dbldutch's modified design on a PCB with a Vectron OCXO.

Both use a Neo-7 GPS and I have an active puck antenna on the outside wall of the house.

Time to do a comparison. See you in a few weeks  :)

Mike
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Bryan on September 23, 2020, 08:33:48 pm
Attempting to compile v 3.51 on the Arduino and receiving a compilation error. error: 'loop_delay' was not declared in this scope
float derivative = (temp_error - prev_error)/ loop_delay;

Is there a missing library or is it just a missing forward slash and loop_delay is supposed to be a comment??

// *** paulv The fan controller
void control_fan() {
  // Use the low-pass filtered ambient temperature sensor value.
  // Do not mess with the original code so convert the value to Celsius here again.
  ambient_t = temperature_to_C(tempADC1_IIR,temperature_Sensor_Type/10);
  // PID calculation
  float temp_error = ambient_t - cool_baseline;
  integral = integral + temp_error;
  float derivative = (temp_error - prev_error) / loop_delay;
  duty_cycle = pwm_baseline + (Kp * temp_error) + (Ki * integral) + (Kd * derivative);
  prev_error = temp_error;

  if (duty_cycle > max_pwm) { duty_cycle = max_pwm; } // max = 100% = 255
  if (duty_cycle < pwm_baseline) { duty_cycle = pwm_baseline;} // set minimum

/* for debugging:
  Serial.print("Kp = ");
  Serial.print(Kp * temp_error);
  Serial.print("\tKi = ");
  Serial.print(Ki * integral);
  Serial.print("\tKd = ");
  Serial.print(Kd * derivative); 
  Serial.print("\tambient temp = ");
  Serial.print(ambient_t);
  Serial.print("\tduty cycle = ");
  Serial.println(duty_cycle);
*/           
  analogWrite(fan_pin, duty_cycle);
}
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: fourfathom on September 23, 2020, 09:56:44 pm
Attempting to compile v 3.51 on the Arduino and receiving a compilation error. error: 'loop_delay' was not declared in this scope
float derivative = (temp_error - prev_error)/ loop_delay;

Is there a missing library or is it just a missing forward slash and loop_delay is supposed to be a comment??

  float derivative = (temp_error - prev_error) / loop_delay;
 

Looking at the code, and the position of the semicolon, I'm pretty sure you are missing a declaration for loop_delay.  It's probably a variable (based on the lack of capitalization), but could possibly be a constant or a #declare.  "loop_delay" might be in a header file.  If you search through the code, do you see any other references to it?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Bryan on September 23, 2020, 10:03:12 pm
There is no other reference to loop_delay in the sketch so has me scratching my head a bit. Unless it's in a missing header somewhere.

https://github.com/paulvee/Lars-GPSDO
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on September 23, 2020, 10:32:55 pm
loop_delay is the time constant for the "I" part of the PID. It must be defined somewhere. Maybe on the compiler commandline (like, adding a "-Dloop_delay=10" for a 10 second time constant) if it's not in the code.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on September 24, 2020, 06:17:51 am
Hi guys,

Very sorry for the introduction of the error in the source code.  |O

I had initially defined loop_delay but that was taken out, unfortunately not completely.
This constant
Code: [Select]
int loop_delay = 1;       // 1 second loop timewas initially used to indicate the loop time for the PID controller, but since it is always 1 second, I took it out of the definitions, but not from the PID function.
You can remove the loop_delay division from the PID controller.

Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Bryan on September 24, 2020, 07:32:54 am
Thanks for clarifying, appreciated. I was able to compile it after removing the division, as a matter of fact it compiled using the NANO as the board.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: axel on September 24, 2020, 03:35:21 pm
Alright, did some major rework to the schematic and board this week.

I think I'm going for something in between Lars's "minimum viable" design and dbldutch's "pursuit of perfection" design. Like I said before, I'll be more than satisfied with a GPSDO that gets me reasonable performance, especially for the price. Current BOM cost all-in is around $85.

New schematic:
(https://raw.githubusercontent.com/W3AXL/Simple-GPSDO/master/kicad/sch/revC/simple-gpsdo.png)

New board:
(https://raw.githubusercontent.com/W3AXL/Simple-GPSDO/master/kicad/board-model/board-revC.png)

Changes made:

Things I'm still considering:

Opinions, comments, and anything else are always appreciated! This has been one of the most in-depth designs I've done in a while so I'm really enjoying the process.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: bingo600 on September 24, 2020, 06:08:11 pm
Looks nice  :-+

But once you get into time nuttery, you would want a buffered 1PPS output too.

How about reverse polarity protection ?
I killed a FEI 5080A Rubidium , by being lazy and not testing that some IDI.. PSU designer made the "screen +" and the "inner core -"

/Bingo
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: imo on September 24, 2020, 06:29:25 pm
Are those R17-R20 10k resistors "placeholders" or do you want really go with 10k? That is too much for that kind of circuit, isn't it? I would expect a few hundreds of ohms there..
Also I would add a 3.3uH-10uH choke followed by 1u||10n to ground as a filter after the switcher.
PS: the L1=33u seems to me too large too, it will just pickup a noise, moreover it could create an instability of the loop.
Mind the USB is a great source of noise coming from your PC..
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: axel on September 24, 2020, 06:48:51 pm
RE: Reverse Polarity Protection, that's a great point. I'll stuff a small diode/fet combo somewhere to take care of that.

RE: 1PPS, I'd love to, and a friend who's interesting in buying one of these from me asked about it as well. I've got an internal PPS test point but I don't really have any room left in the case for PPS, unless I added another BNC above the GPS/power connectors.

RE: OpAmp Gain Resistors, thanks for bringing that up. I ripped that buffer circuit straight from Brian Dorey's 10MHz project. (https://github.com/briandorey/10Mhz-Frequency-Standard-Distribution-Project/blob/master/Schematic%20and%20PCB/10Mhz%20Frequency%20Standard%20-%20Distribution%20Board.pdf) The Bliley OCXO I'm going with is a square wave output, and as far as I can tell it's not expecting a low impedance of any kind on its output. Are you concerned about loading of the OCXO?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: bingo600 on September 24, 2020, 07:36:03 pm
RE: 1PPS, I'd love to, and a friend who's interesting in buying one of these from me asked about it as well. I've got an internal PPS test point but I don't really have any room left in the case for PPS, unless I added another BNC above the GPS/power connectors.

Use sma  .... sma->BNC adapters are cheap

/Bingo
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on September 25, 2020, 08:19:51 am
@ Axel
Good job with the circuit.

Be aware that the Bliley has sine-wave out and square-wave out versions. You could add the "miti" squarer parts as placeholders.

Two small and easy things that will help to reduce side-effects. Use high-efficiency LED's, as a minimum for the Lock signal, so you can increase the resistor size and reduce current. I've shown the effects on the loop in one of my earlier posts.

If you don't want to give the NEO it's own regulator, add a small value series resistor and a larger reservoir cap in the supply line to the NEO. It has it's own 3V3 voltage regulator, so a bit less than 5V in is no problem.  As an alternative, you could also feed it with your 6V supply. This will help to reduce the 1PPS bounce effects.

As an option, put a 68 Ohm resistor in series with the LM35 dataline and use a 10uF T cap from the data to GND. Alternatively, you could also add my low-pass filter in the firmware.

Add placeholders for the parts that can drive a fan, you'll be happy you did afterwards.

Good luck!
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on September 26, 2020, 07:20:07 pm
I've just run my new GPSDO with the Vectron OCXO for a couple of days and would appreciate the experts' opinion on the results.

I have a gain of 590, TC of 200s and TempCoeff of 0. The OCXO temperature varied by less than two degrees.

I'm curious about the slope on the DAC value.

Thanks,

Mike

Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: cdev on September 26, 2020, 09:33:39 pm
vref use on GPSDO?


I have an OCXO that has both the EFC and a vref connection. Its my understanding that this is the point that represents the highest tip of the control voltage range. Is it used?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: 0xFFF0 on September 26, 2020, 10:10:37 pm
The OCXO either loses heat or it heats up more and more. In any case, the temperature control does not seem to be working.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Johnny B Good on September 27, 2020, 01:12:23 am
Curse this addiction  >:D >:D

A few months ago I'd never heard of a GPSDO and now I have built two of them ...

[attachimg=2]

The first is to Lars' original design using breadboard construction with an NDK OCXO.

The second is Dbldutch's modified design on a PCB with a Vectron OCXO.

Both use a Neo-7 GPS and I have an active puck antenna on the outside wall of the house.

Time to do a comparison. See you in a few weeks  :)

Mike

 Blimey, Mike!

 That was bloody fast work! I started working my way from using a NEO-M8N module as a cheap 10MHz/30MHz reference to check the calibration of an HF Transceiver I hadn't re-calibrated in over twenty years for lack of a suitable antenna and propagation conditions to receive the 10MHz WWV broadcast I'd last used, gulp! back in the early nineties!

 Happily, the HF rig was still within 0.5Hz at 30MHz (after a half hour warmup). My next calibration exercise on the 50MHz TCXO upgrade oscillator board I'd used to replace the crappy 50ppm smd XO in an FY6600-60M is what started me down the road to DIYing a 'proper GPSDO' a whole 18 months ago now,

 It took me 12 months just to complete a MK I version and then another 4 months to respin it into a MK II version which I'd unwittingly morphed into a modern day version of the James Miller design.  :) I've got three nano3s waiting to be utilised but DIYing a GPSDO is a lot simpler without such encumbrance.

 I'm taking a keen interest here because the only sensible way to go take filtering time constants much beyond 5000 seconds is to use a microcontroller and Kalman filtering to discipline a Rb oscillator from 24 hours or more's worth of GPS timing data. I'm going to start disciplining a much easier beast to tame than an unruly double ovened OCXO when I get round to trying my hand at a microcontroller based GPSDO.  :)

 However, my first non-trivial use of a nano3 looks like it will be to control the RFS's baseplate temperature and compensate for barometric pressure variations to simplify the disciplining to just compensating the more predictable ageing characteristic of a RFS. I'll save the thankless task of disciplining an OCXO till when I feel more comfortable in using a microcontroller to keep such an unpredictable beast as an OCXO on track.

 As you gain more experience and strive for ever better stability out of your GPSDO projects, you'll become a lot more aware of the GPS system's weakness as a frequency and timing reference source soon enough, assuming you're not already well acquainted with its deficiencies to begin with.

 My plan to discipline a RFS is just my way to bypass all the hassle of an OCXO based GPSDO and cheat my way towards the goal of a reference operating at the 1.0E-14 limit of the GPS master clock itself. What I'll do after that, Deity only knows - probably dabble in the voltnut domain (either that or just vegetate into a senile old age). :-\

John
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Johnny B Good on September 27, 2020, 02:46:58 am
I'll certainly look into adding individual regulators for every IC. I think I'll adjust the main reg to be a 12V-5V buck and have individual 3.3V linears powering everything directly. That way I don't have to worry too much about power dissipation with a 12V->3.3V linear conversion but I can still get relatively low-ripple 3.3V.

Unfortunately, LDOs are not very good at removing input supply ripple. You might want to look into adding a "capacitance multiplier" after the buck regulator to have a clean input to the LDOs:
https://www.youtube.com/watch?v=wopmEyZKnYo (https://www.youtube.com/watch?v=wopmEyZKnYo)

 You're only bloody right about relying on LDOs as a switching hash filter add on to a switching converter since above 100KHz they start looking like high pass filters. The real value of using an LDO, post converter output, is to restore regulation lost the the resistance of an RC LPF placed between the switching converter's output and the input to the LDO.

 It's the RC LPF which deals with suppression of switching hash - the LDO is simply there to regulate the voltage unmolested by switching hash and ripple from the converter stage.

 The 'capacitor multiplier has its own issues of energy loss and is not really a viable solution in this type of ripple suppression, being aimed at dealing with the more sedate 100 to 120Hz ripple components of a conventional mains voltage psu.

 The charm of the humble RC LPF, apart from its compact simplicity, is its almost total lack of self resonance effects into the hundreds of MHz that such switching hash frequencies can extend into. However, that benign filtering characteristic comes with an efficiency cost and a requirement to restore voltage regulation with an LDO so tends to be used to power the more sensitive and less power hungry parts of a system. If you feel the need for such measures, target their use with with care.

John
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on September 27, 2020, 03:36:51 am
@Mike

I have seen the same DAC slopes for several of my second-hand OCXO's as soon as I powered them up. For some of them, it took several months to stabilize, so I just left them with power on, and kept them well insulated before I started using them in my GPSDO's.

Even after many months of using them in a GPSDO, after a cold start, it takes a few days for some of them to really settle. And I'm witnessing this again even with my temperature controlled enclosures as well, so it's not always temperature related. On top of that, my Bliley still has some strange jumps in the DAC value when it starts from a cold state. After several days it is rock-stable now, but it used to take several weeks before the jumps stopped.

The good news is that eventually, they all stabilize. At least that's what I've seen with the 6 different used OCXO's I have.

It has been reported that the rough handling of the old equipment they were in, the removal from the old PCB's and finally the transport could be the cause. These things apparently can be extremely delicate.

The net-net of all this is that you should wait for the OCXO's to stabilize before setting the temperature correction and also before analyzing your GPSDO with TimeLab, however tempting that may be.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on September 27, 2020, 06:57:17 am
The OCXO either loses heat or it heats up more and more. In any case, the temperature control does not seem to be working.

Nah, that's typical for 2nd hand OCXOs that have been off for a while, ripped off of a PCB, bumped around in junk bins, mishandled in shipping, etc. Like Dbldutch said, it's going to take weeks if not months for to stabilize. I have the same behavior right now with a used MV85A that I use in a GPSDO. Short term stability is quite nice, but initially it drifted like crazy. It's been over a month now and it still hasn't completely found its bearing. It's much, much better now, though.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on September 27, 2020, 10:11:27 am
Thanks for all your suggestions but I think I've worked out what's causing the DAC slope.

It corresponds to 2mV per day which for my OCXO equates to 0.9ppb (I measured the sensitivity before fitting it to the GPSDO).

The OCXO aging spec is +/- 1ppb per day after 72 hours of operation so this looks like a good fit!

This OCXO was sold as new, so although the date code is 2011 my assumption is that it has never been used until now (the pins had no evidence of being soldered).

What about the other graphs? Will the shape of the MDEV curve change after running for a few weeks?

Mike
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on September 27, 2020, 10:13:45 am
vref use on GPSDO?


I have an OCXO that has both the EFC and a vref connection. Its my understanding that this is the point that represents the highest tip of the control voltage range. Is it used?

No, I have a separate precision voltage source for Vref.

Mike
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on September 27, 2020, 10:15:04 am
The OCXO either loses heat or it heats up more and more. In any case, the temperature control does not seem to be working.

I haven't implemented temperature control yet. tempCoeff=0.

Mike
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on September 27, 2020, 10:20:06 am
That was bloody fast work! I started working my way from using a NEO-M8N module as a cheap 10MHz/30MHz reference to check the calibration of an HF Transceiver I hadn't re-calibrated in over twenty years for lack of a suitable antenna and propagation conditions to receive the 10MHz WWV broadcast I'd last used, gulp! back in the early nineties!

Hi John

That's precisely my reason for building this, as last year I bought a Yaesu FT-840 transceiver and wanted to check its calibration. I have an end fed half wave antenna which allows me to receive WWV after midnight, although it's very weak and probaby not a good calibration source!

Mike
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on September 27, 2020, 10:29:58 am
Because I don't have a counter with a high enough resolution and precision to measure the GPSDO 10MHz output other than by using the TimeLab "trick", I have been on the look-out for an alternative.

It seems like this "competitor" to the Lars GPSDO has an interesting aside, a counter that has the sought after resolution and precision.
Have a look: https://www.instructables.com/id/GPSDO-YT-Disciplined-Oscillator-10Mhz-Reference-Fr/ (https://www.instructables.com/id/GPSDO-YT-Disciplined-Oscillator-10Mhz-Reference-Fr/)
Any comments?

I have ordered an ATMEGA 328p chip and will try to only use the counter function.
It may work, or it may not...

I'll keep you posted.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: billy_gr on September 27, 2020, 11:14:45 am
Because I don't have a counter with a high enough resolution and precision to measure the GPSDO 10MHz output other than by using the TimeLab "trick", I have been on the look-out for an alternative.

It seems like this "competitor" to the Lars GPSDO has an interesting aside, a counter that has the sought after resolution and precision.
Have a look: https://www.instructables.com/id/GPSDO-YT-Disciplined-Oscillator-10Mhz-Reference-Fr/ (https://www.instructables.com/id/GPSDO-YT-Disciplined-Oscillator-10Mhz-Reference-Fr/)
Any comments?

I have ordered an ATMEGA 328p chip and will try to only use the counter function.
It may work, or it may not...

I'll keep you posted.

Use this one (updated version )
https://www.instructables.com/id/GPSDO-YT-10-Mhz-Lcd-2x16-With-LED/ (https://www.instructables.com/id/GPSDO-YT-10-Mhz-Lcd-2x16-With-LED/)

I have build it on a breadboard before trying LARS version, "looks" accurate, meaning i have tried on my counter while using LARS as a reference and then this one both are stay locked at 10MHz (0,001 Hz)
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: 0xFFF0 on September 27, 2020, 11:42:16 am
Have a look: https://www.instructables.com/id/GPSDO-YT-Disciplined-Oscillator-10Mhz-Reference-Fr/ (https://www.instructables.com/id/GPSDO-YT-Disciplined-Oscillator-10Mhz-Reference-Fr/)
Any comments?

These GPSDO work with a FLL not with a PLL. The lock is very fast and stable. Are there any further experiences with this type? Unfortunately there is no source code from the project.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: 0xFFF0 on September 27, 2020, 11:48:10 am
I've just run my new GPSDO with the Vectron OCXO for a couple of days and would appreciate the experts' opinion on the results.

I have a gain of 590, TC of 200s and TempCoeff of 0. The OCXO temperature varied by less than two degrees.

I'm curious about the slope on the DAC value.

Thanks,

Mike

So far I have bought 3 Vectrons on ebay. The first did not work at all, the second the REF-V was defective, the third finally worked. I can't make the seller responsible now, but mostly they are destroyed during transport.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: 0xFFF0 on September 27, 2020, 11:57:27 am
I'll certainly look into adding individual regulators for every IC. I think I'll adjust the main reg to be a 12V-5V buck and have individual 3.3V linears powering everything directly. That way I don't have to worry too much about power dissipation with a 12V->3.3V linear conversion but I can still get relatively low-ripple 3.3V.

Unfortunately, LDOs are not very good at removing input supply ripple. You might want to look into adding a "capacitance multiplier" after the buck regulator to have a clean input to the LDOs:


 You're only bloody right about relying on LDOs as a switching hash filter add on to a switching converter since above 100KHz they start looking like high pass filters. The real value of using an LDO, post converter output, is to restore regulation lost the the resistance of an RC LPF placed between the switching converter's output and the input to the LDO.

 It's the RC LPF which deals with suppression of switching hash - the LDO is simply there to regulate the voltage unmolested by switching hash and ripple from the converter stage.

 The 'capacitor multiplier has its own issues of energy loss and is not really a viable solution in this type of ripple suppression, being aimed at dealing with the more sedate 100 to 120Hz ripple components of a conventional mains voltage psu.

 The charm of the humble RC LPF, apart from its compact simplicity, is its almost total lack of self resonance effects into the hundreds of MHz that such switching hash frequencies can extend into. However, that benign filtering characteristic comes with an efficiency cost and a requirement to restore voltage regulation with an LDO so tends to be used to power the more sensitive and less power hungry parts of a system. If you feel the need for such measures, target their use with with care.

John

Capacitance Multiplier play their role in audio equipment. They will filter audible hum. I think in GPSDO they don't make any sense
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on September 27, 2020, 12:08:44 pm
They can adjust frequency every 1000 seconds only. The rest of the time the OCXO effectively drifts around. No temperature compensation either.  Suitable for an Rb standard, or for an extremely good OCXO. Not possible to provide 1PPS output, either, as they're only frequency locked.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on September 27, 2020, 12:55:13 pm
So far I have bought 3 Vectrons on ebay. The first did not work at all, the second the REF-V was defective, the third finally worked. I can't make the seller responsible now, but mostly they are destroyed during transport.

I was lucky, mine came from a test equipment supplier a few miles from my home. It's a shame he didn't have any more.

Mike
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: nealix on September 27, 2020, 04:24:17 pm
Hi guys:

New to this forum thread.  I am very interested in bread-boarding my first GPSDO attempt, and have some Bliley and other 5 and 12 volts OCXO's in the parts bin.  I have already built various Arduino Nano projects and also have an Agilent 53131A counter and a resonable scope.   I have been using a "commercial" BG7TBL eBay GPSDO for the last few years.  So now I would like to learn more and try building one.    QUESTIONS:

1.  What is the latest version schematic that has evolved from all the discussion here about improvements?
     Is this exists, does anyone share the arduino sketch code so I can get started learning how it works?

2.  Does anyone share the KiCad files so I can learn to adapt a PCB to the OCXO and parts that I have?
     (I have recently installed KiCad, and need an excuse to start learning it :-)  )

3.  Has anyone in the forum made a PCB with multiple mounting holes for the various OCXO types/sizes?

4.  Is it best to use a square wave or sine wave OCXO for this project?

Sincere Thanks in advance for any mentoring/guidance,

Neal
N6YFM
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on September 28, 2020, 09:18:22 am
@nealix

I suggest that first of all, you read this complete blog from beginning to end at least once. Yes, it may take you a day or two, but the information in here is invaluable. All what you're asking for is there, including the source code.

If you want, you can also have a look on my personal blog for more information about what I did. On that blog is also a link to my Github site with code, schematics and PCB information, albeit made with DipTrace.

http://www.paulvdiyblogs.net/2020/07/a-high-precision-10mhz-gps-disciplined.html (http://www.paulvdiyblogs.net/2020/07/a-high-precision-10mhz-gps-disciplined.html)

Be careful though, this topic can be very contagious, before you realize it, you're a time-nut.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: nealix on September 29, 2020, 04:21:01 am
@Dbldutch

I read your entire blog.  Thanks.

I have a question about the GPS modules.   You talked about the M8T (expensive) and less cost M7N and Neo 6M modules.
Once you finally found a good view of the sky, had enough satellites, and saved coordinates in the EEPROM, did you still find the
need for the expensive M8T, or did you find adequate operation/accuracy using the Neo 7N or M?
(I should qualify that I am not looking for perfection, just reasonable accuracy for the average radio and test equipment hobbyist.
Also, I do have a proper outdoor GPS antenna mounted in a 360 degree clear-sky view.  My GPS disciplined dual-timezone wall clock
project always shows 12 sats with it's NEO 6 module)

Second question -  You mentioned in your blog's GPS section;
"One other mistake I made was that I didn't save all the settings into the NEO EEPROM and so I lost them after a power cycle. Because I no longer monitored the NEO output, I was unaware of this."

Where do I read to learn more about how to do the above, how to store things in the EEPROM?  Is there a forum post, or is that from
some other web site or article or user manual?   Would it perhaps be the u-center program at the Ublox site?
And is it just the local coordinates that you store so after a power cycle it can lock faster?  Or do you make other settings such
as modes, etc? 

Thanks again for getting me started.   I have some GPS modules already, and also ordered some of the other parts today.

Cheers,

Neal
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on September 29, 2020, 06:38:36 am
@Dbldutch

I read your entire blog.  Thanks.

I have a question about the GPS modules.   You talked about the M8T (expensive) and less cost M7N and Neo 6M modules.
Once you finally found a good view of the sky, had enough satellites, and saved coordinates in the EEPROM, did you still find the
need for the expensive M8T, or did you find adequate operation/accuracy using the Neo 7N or M?
(I should qualify that I am not looking for perfection, just reasonable accuracy for the average radio and test equipment hobbyist.
Also, I do have a proper outdoor GPS antenna mounted in a 360 degree clear-sky view.  My GPS disciplined dual-timezone wall clock
project always shows 12 sats with it's NEO 6 module)

Second question -  You mentioned in your blog's GPS section;
"One other mistake I made was that I didn't save all the settings into the NEO EEPROM and so I lost them after a power cycle. Because I no longer monitored the NEO output, I was unaware of this."

Where do I read to learn more about how to do the above, how to store things in the EEPROM?  Is there a forum post, or is that from
some other web site or article or user manual?   Would it perhaps be the u-center program at the Ublox site?
And is it just the local coordinates that you store so after a power cycle it can lock faster?  Or do you make other settings such
as modes, etc? 

Thanks again for getting me started.   I have some GPS modules already, and also ordered some of the other parts today.

Cheers,

Neal

Only timing receivers like the M8T will have an "overdetermined clock mode" which calculates precise timing instead of precise position (can't do both): You supply a precise position, the receiver calculates precise time. A general purpose receiver cannot make use of an externally supplied precise position, it will calculate position and time for every measurement interval, usually once per second. Accuracy of the time pulse generally depends on the precision of the position, so if the position uncertainty is high, so is the time uncertainty. With a general purpose receiver under open sky, the position accuracy will be maybe down to 2 or 3 meters. But as you can feed a timing receiver with an arbitrarily precise position, you can get the uncertainty it down into the centimeter regime.

Eventually, any GPS module will do, but of course there will be an impact on the stability. A timing receiver after a good survey-in will output a time pulse accurate down to 1ns, if your GPSDO software makes use of the quantization correction. A general purpose receiver will be in the >20ns range. This means heavier filtering and longer time constants will be needed to achieve good short-term stability. For long term stability it doesn't matter a lot. Quality of the OCXO matters, though: An OCXO that ages fast or has high susceptibility to temperature changes will require a faster control loop, which will not be able to filter the timepulse noise of the GPS as efficiently.

Regarding configuration of the Ublox modules and saving to EEPROM, that's done with the U-Center software indeed. But I'm not aware that you can also save a position. I think after a restart, if you don't feed a position externally or start a survey-in, it will function as a regular GPS receiver.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: 0xFFF0 on September 29, 2020, 08:40:38 am
You can buy these modules (not cheap, ~$130):
Multi-band GNSS receiver with nanosecond-level timing accuracy:
https://www.u-blox.com/en/product/zed-f9t-module (https://www.u-blox.com/en/product/zed-f9t-module)
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on September 29, 2020, 08:53:53 am
Neal,

If you have a good location for the antenna with a 360 degrees view of the sky, there is less need to use a timing receiver. I have a very poor view of the sky which is why I have to rely on a timing version.

The U-Blox website gives you access to the datasheets and documentation. I could not find much information in blogs so I had to look it all up and give it a try.
There are cheaper sources for timing receivers other than buying them from U-Blox, Google is your friend.

Success!
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on September 29, 2020, 12:39:49 pm
I got a little tired of re-programming my GPSDO's after I changed a fan controller parameter while tuning the PID controller.
I have now added code to the Lars program to incorporate the settings of the minimum PWM, the maximum ambient temperature and the Kp, Ki and Kd gain parameters. Both the info and help display(f1) and the list of current variables (f2) incorporate these changes.

The code for version 3.60 is on my Github https://github.com/paulvee/Lars-GPSDO (https://github.com/paulvee/Lars-GPSDO)

Enjoy!
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on September 29, 2020, 04:19:22 pm
I should qualify that I am not looking for perfection, just reasonable accuracy for the average radio and test equipment hobbyist.

Hi Neal, and welcome to the forum.

I am only a couple of months ahead of you on the learning curve and will leave the difficult answers to the experts  :)

However, my needs are the same as yours and my philosophy is to start cheap and work up. On that basis I bought a couple of GY-GPSV3-NEO modules on eBay for UKP7 each and an active GPS antenna for UKP9. The antenna is mounted on the house wall and can see about half the sky. It works fine for me (so far ...) although my GPS modules are the NEO-7M which doesn't have the EEPROM so you can't update the firmware.

Mike
G8GYW
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: 0xFFF0 on September 29, 2020, 04:48:52 pm
Thanks again for getting me started.   I have some GPS modules already, and also ordered some of the other parts today.
Cheers,
Neal

I can recommend this: https://www.youtube.com/watch?v=q_KOPdy6VYc&t=637s (https://www.youtube.com/watch?v=q_KOPdy6VYc&t=637s)
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: nealix on October 05, 2020, 01:12:07 am
Just wanted to show the first results of my attempts to regulate the temperature inside the GPSDO enclosure, in an attempt to isolate the OCXO temperatures from the room temperature changes. All this to get a "pure" DAC result, devoid of temperature effects.

The data is taken from my Trimble based GPSDO, where the OCXO itself is insulated from all 6 sides in a 10-15mm thick hard-foam box. Inside the box is one of the LM35 temperature sensors.

I'm using the other LM35 that measures the ambient temperature right on top of D1/R1/C1 inside the enclosure to drive a 30mm 5V DC fan with a PWM signal, coming from a simple PID controller. Both LM35's are now low-pass filtered to get rid of the noise.

@Dbldutch

When you say that the LM35 is low-pass filtered, I assume that is in software?   Or have you updated a schematic to show
the interfacing of the LM35 and filter?    I have already downloaded and looked at;   Controller Schematic V2_1.jpg

Is C11 and R12 the filtering you mention, or is it in software on your version 3.6?

Cheers,

Neal
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on October 05, 2020, 04:18:08 am
@Neal:

The capacitor and resistor in the hardware actually does very little to filter the LM35 output. It helps but the output still jitters a lot from second to second.

I used a quick-and-dirty IIR filter to average the acquisitions in the software. In my V3.6 software, look at lines 97..101 for the details.

Because Lars also uses one of these values for his temperature compensation, in a (for me) rather complicated way that I didn't want to disturb, I only filter the LM35 outputs for the status display. They are at lines 1040 and 1079. I use this status display for my analysis in Excel.

I hope this helps.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: nealix on October 05, 2020, 04:57:22 am
Yes, thanks, that helps a lot.
I also ran across this:   https://elvistkf.wordpress.com/2016/04/19/arduino-implementation-of-filters/ (https://elvistkf.wordpress.com/2016/04/19/arduino-implementation-of-filters/)
which, with your answer, now make perfect sense :-)

Thanks!
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on October 05, 2020, 06:57:19 pm
I've just seen this, which appears to be a Trimble GPS antenna/receiver for almost no money:

https://www.ebay.co.uk/itm/Acutime-2000-GPS-Smart-Antenna-for-Precise-Timing/233702099796 (https://www.ebay.co.uk/itm/Acutime-2000-GPS-Smart-Antenna-for-Precise-Timing/233702099796)

Would this be a good source for the 1pps signal?

Mike
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: bingo600 on October 05, 2020, 07:02:10 pm
I've just seen this, which appears to be a Trimble GPS antenna/receiver for almost no money:

https://www.ebay.co.uk/itm/Acutime-2000-GPS-Smart-Antenna-for-Precise-Timing/233702099796 (https://www.ebay.co.uk/itm/Acutime-2000-GPS-Smart-Antenna-for-Precise-Timing/233702099796)

Would this be a good source for the 1pps signal?

Mike

I have one of these (in a box somewhere).
I seem to remember the 1pps is accurate to 40ns , not stellar.
The multiplug is a funny beast ... Can you source it ?

/Bingo
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on October 05, 2020, 07:25:11 pm
I've just seen this, which appears to be a Trimble GPS antenna/receiver for almost no money:

https://www.ebay.co.uk/itm/Acutime-2000-GPS-Smart-Antenna-for-Precise-Timing/233702099796 (https://www.ebay.co.uk/itm/Acutime-2000-GPS-Smart-Antenna-for-Precise-Timing/233702099796)

Would this be a good source for the 1pps signal?

Mike

The press release says something like "synchronized to UTC within +/- 100 nanoseconds (one sigma)". I guess that may be before "sawtooth correction"? The user manual says "50ns against UTC". Not stellar. But as far as bang-per-buck is concerned, a timing receiver ready for montage for 10 bucks is hard to beat.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: texaspyro on October 06, 2020, 07:18:15 am

The multiplug is a funny beast ... Can you source it ?


You can use regular "Dupont" jumper wires to populate the connector.   How you secure them is up to you.   I've used cable ties to bundler them.  Maybe candle wax or casting resin to fill the housing?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on October 06, 2020, 09:17:16 am

The multiplug is a funny beast ... Can you source it ?


You can use regular "Dupont" jumper wires to populate the connector.   How you secure them is up to you.   I've used cable ties to bundler them.  Maybe candle wax or casting resin to fill the housing?

It's a standard military connector, you can find them on eBay.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on October 06, 2020, 09:22:56 am

The press release says something like "synchronized to UTC within +/- 100 nanoseconds (one sigma)". I guess that may be before "sawtooth correction"? The user manual says "50ns against UTC". Not stellar. But as far as bang-per-buck is concerned, a timing receiver ready for montage for 10 bucks is hard to beat.

The User Guide says "Over-determined Clock Mode with a timing accuracy of <15 nanoseconds (one sigma) to UTC, GPS, or GNSS time."

I don't know how that compares to my NEO-7 which quotes "30ns RMS"?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on October 06, 2020, 11:15:10 am
If you have a general purpose NEO-7 receiver, the Trimble will likely get you better stability. Maybe you can even improve on the 15ns with a longer position self-survey (seems you can configure that).
My NEO-M8T can do better than +-10ns accuracy (peak, not RMS, after sawtooth correction), but it needs a really good position uncertainty. I ran a survey-in setting a boundary of < 200mm position uncertainty, and after that it claimed 2ns time accuracy.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on October 06, 2020, 02:27:05 pm
It's an attractive price but I think I'll give it a miss. It would need a cable making up and an RS-422 to USB converter plus yet more software to learn.

I do need a better antenna installation though as my NEO-7 can only see 3 satellites despite being wall mounted outside the house.

Oops software glitch. It's 13 now ...

Funny how my smartphone can see 16 from inside the house  :-//

Mike
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on October 06, 2020, 04:30:36 pm
Funny how my smartphone can see 16 from inside the house  :-//

Your smartphone is cheating. It has a lot of assistance from the network (time, coarse position, almanac and ephemeris for all constellations) so it only needs exact time (easy to receive). Then all it has to do is track the satellites.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on October 07, 2020, 09:58:04 pm
Your smartphone is cheating. It has a lot of assistance from the network (time, coarse position, almanac and ephemeris for all constellations) so it only needs exact time (easy to receive). Then all it has to do is track the satellites.

Thanks for that. I'm getting there slowly ...

My external antenna is seeing 10-12 satellites which should be enough for the GPSDO. I'm getting a splitter so I can feed my GPS clock as well.

Mike
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: nealix on October 10, 2020, 04:06:01 am
@Dbldutch

Hi:  I notice on your Oscillator Circuit V2 schematic from GIThub, that the voltage control line going into the OCXO goes through a DC choke filter, a 33uH L102 inductor.   Can you share more detail on this?   I understand the purpose, in filtering out higher frequency noise on the voltage control line to the OCXO, but is it a 1/4 watt, 1/2 watt, or 1 or 2 amp inductor?   I assume since the average OCXO can take a little over an amp while heating, then around 600ma running, that the inductor might be bigger than 1/4 watt types?   But how do you calculate the size/wattage/part needed?   What specifically is L102 if I want to use one (or wind it myself)?

Second question:   On that Oscillator Circuit V2 schematic, the main schematic is using a Bliley NV47M1008 with an R109 of 27K ohms.  But the little table at the bottom
right of the schematic shows R109 as 330K ohms for a Bliley.  Quite a difference.    What do you suggest would be the proper starting point for R109?

Third newbie question :-)   :   I have both Arduino Nano 5 volt modules and also some Arduino Pro Mini 3.3 volt modules.   If I decide to start with the Arduino Pro Mini
modules so that the 3.3volt logic will all match, should I still use the series 100 ohm resistors that you show on your Arduino Nano digital I/O lines?

Last question for now;   On your Controller Schematic V2_1, you have 68 ohm resistors in series with the LM35 output.  What made you choose this value?
Is that a form of the low pass filtering based on R12/C11 for the LM35?

Sincere Thanks.

@everyone

I finally decided to compare my china fake U-blox Neo-6 GPS modules (all 5 are fakes), to a real U-Blox purchased via reputable USA supply chain.
I ended up buying a Mikroe GNSS 7 Click module from Mouser (also carried at DigiKey), which has the U-Blox Neo-M9N that just started shipping last month.
Ref:  https://www.mouser.com/ProductDetail/Mikroe/MIKROE-3922?qs=GBLSl2AkirvsES1Toi%252BOeA%3D%3D (https://www.mouser.com/ProductDetail/Mikroe/MIKROE-3922?qs=GBLSl2AkirvsES1Toi%252BOeA%3D%3D)

WOW!.   The Neo-6 modules are good, even as fakes.  But, the Neo-6 only gets USA GPS sats.   The new Neo-9 series will simultaneously receive all four
systems (BeiDou, Galileo, GLONASS, GPS / QZSS).  With an indoor GPS puck antenna near a window, Neo-6 with just USA GPS could give me maybe 5 to 6
SATs.   But the new Neo-M9N give me closer to 20 satellites indoors.   Impressive little module for $40 USD.

Cheers,

Neal
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on October 10, 2020, 08:34:25 am
Hi Neal,

Q#1: I use two choke filters.

One for the VCF input, and I just used what I had available. I once ordered a selection from a China source. Unfortunately, no documentation. They look like .25W resistors and cannot carry much of a current. They are there to keep the 10MHz from the OCXO from getting in the DAC adjustment circuit. The value is not very critical but they do make a large difference.

The second one is used in series with the powerline to the OCXO. I used a Ferrite I already had available. It has a few holes (we call it a pig-snout in Dutch) where the lead is winded through a few times. It can carry several Amps. It is there to keep hf noise from the outside (switching power supply) from getting in the OCXO. For a picture for this one, have a look at one of my pictures of the PCB  in an earlier post, or look for a picture on my blog.

Q#2: I used the values in the table. The resistors in the diagram where just placeholders for the OCXO that I used first. Don't forget that these values are dictated by the gain setting procedure, and are highly depending on the quality of your OCXO and the sensitivity of the adjustment.

Q#3: The small resistors in series are there to remove some of the sharp edge transitions that may cause cross-talk or ringing. Leave them in.

Q#4: I used what somebody on this blog recommended. 68 Ohm in series with the data line and a 10uF capacitor to ground. Yes it is a low-pass filter.

You are right, only NEO's at model 7 and up can be configured to receive all the constellations. If you don't have a clear view of the sky, get a timing version like the 8MT.

Good luck!
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on October 10, 2020, 10:48:31 am
Hi Neal

Just to add to what Dbldutch said (I have built his circuit and it works very well).

The voltage control input to the OCXO is high impedance so almost any size choke will be OK. I used these 0.25W 33uH chokes:

https://www.ebay.co.uk/itm/Inductor-Choke-Coil-1-4W-0-25W-Values-0-1uH-to-1mH-Various-Pack-Sizes/152687409289?ssPageName=STRK%3AMEBIDX%3AIT&var=452270326536&_trksid=p2057872.m2749.l2649 (https://www.ebay.co.uk/itm/Inductor-Choke-Coil-1-4W-0-25W-Values-0-1uH-to-1mH-Various-Pack-Sizes/152687409289?ssPageName=STRK%3AMEBIDX%3AIT&var=452270326536&_trksid=p2057872.m2749.l2649)

And for the supply ferrites I used these:

https://www.ebay.co.uk/itm/PACK-OF-4-FERROXCUBE-MHC6-6-10-4B1-MULTI-HOLE-FERRITE-CORES-10MM-BY-6MM/122831367380?ssPageName=STRK%3AMEBIDX%3AIT&_trksid=p2057872.m2749.l2649 (https://www.ebay.co.uk/itm/PACK-OF-4-FERROXCUBE-MHC6-6-10-4B1-MULTI-HOLE-FERRITE-CORES-10MM-BY-6MM/122831367380?ssPageName=STRK%3AMEBIDX%3AIT&_trksid=p2057872.m2749.l2649)

The Mikroe module looks like a bargain (£29 in the UK). Does it have a 1pps output line or do you have to tack a wire on?

Mike
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on October 10, 2020, 11:07:28 am
The two that Mike took the effort to look up are indeed the ones I use.
Thanks Mike!
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Fennec on October 10, 2020, 01:29:00 pm
But the new Neo-M9N give me closer to 20 satellites indoors.   Impressive little module for $40 USD.

Cheers,

Neal

M9N  Accuracy of time pulse signal RMS  30ns
99%                                                     60ns

M8T   20ns

You don't need 100 sats, you need a stable Module.

Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on October 10, 2020, 03:12:33 pm
You are right, only NEO's at model 7 and up can be configured to receive all the constellations. If you don't have a clear view of the sky, get a timing version like the 8MT.

Is the M8T pin compatible with the 7N? If so I could swap the module on one of my boards.

Mike
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on October 10, 2020, 04:10:59 pm
As far as I know, the 6, 7 and 8 are all pin compatible.
I swapped my Chinese copy of the 6 with a genuine M8T on the same carrier.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Fennec on October 10, 2020, 04:13:37 pm
Is the M8T pin compatible with the 7N? If so I could swap the module on one of my boards.

Mike

Yes we did it in the BG7TBL thread.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: nealix on October 10, 2020, 10:37:20 pm

M9N  Accuracy of time pulse signal RMS  30ns
99%                                                     60ns

M8T   20ns

You don't need 100 sats, you need a stable Module.

@Fennec:

Thanks, I do understand that, and did at the time.  But I could not locate any supplier of a breakout module board with the M8T on it
for anywhere less than $100 USD.    Where do you guys find a timing module on a breakout board that can actually be used without
doing your own wave soldering and PCB design?     I did find a person selling on Tindie selling the SkyTraq timing module and ordered that:
   SkyTraq Venus838LPx-T Timing GPS module breakout
   Add a u.FL to SMA pigtail?: No
   Add an amplified u.FL patch antenna?: No
   Connection style: SIP
   Unit Price: $50.00 + free shipping.
   Quantity: 1

But I also ordered the Ublox M9N breakout module I mention above at the same time, just to compare, since I knew
that module would arrive in a few days, and the Skytraq takes about a month to get here.

Cheers,

Neal
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: nealix on October 10, 2020, 10:41:31 pm
Hi Neal

The Mikroe module looks like a bargain (£29 in the UK). Does it have a 1pps output line or do you have to tack a wire on?

Mike

Yes, it does have 1-PPS output.   Here is the schematic of the board;
https://www.mouser.com/datasheet/2/272/gnss-7-click-schematic-v100-1863770.pdf (https://www.mouser.com/datasheet/2/272/gnss-7-click-schematic-v100-1863770.pdf)

It also comes with the backup battery installed.

Neal
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Fennec on October 11, 2020, 11:17:29 am
But I could not locate any supplier of a breakout module board with the M8T on it
for anywhere less than $100 USD.    Where do you guys find a timing module on a breakout board that can actually be used without
doing your own wave soldering and PCB design?   

You like it accurate, so you have to pay. If you need just a "frequency" you can set a cheap $US15 UBlox module output with UCenter.
I do not understand why you want to use an "High End Lars-Board" with the lowest quality pulse generator.  :rant: :-// :-// :scared:
Contradiction in terms
See att

https://www.ebay.com/itm/1x-Ublox-LEA-6T-2-000-50-channel-15ns-1pps-Timing-GPS-module-WD22UGRC/313149500246?hash=item48e92a2b56:g:IR8AAOSwULhfEG5T (https://www.ebay.com/itm/1x-Ublox-LEA-6T-2-000-50-channel-15ns-1pps-Timing-GPS-module-WD22UGRC/313149500246?hash=item48e92a2b56:g:IR8AAOSwULhfEG5T)
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on October 11, 2020, 04:49:26 pm
OK it's time to ask the experts a question please.

I've been running my GPSDO for a while now with tc=200s and tempCoeff=0 just to put some aging on the OCXO, which was sold as unused. The first graph shows what happened over a three week period.

Regarding the time constant, I thought 200s would be a reasonable number to start with, but I've now started a run at tc=4s to determine the optimum value. The second graph shows the current result but I will leave it running to improve the accuracy.

Here's the question. With tc=200s it loses lock, then recovers, several times every 24 hours. How do I determine the cause?

Mike

Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on October 11, 2020, 06:23:46 pm
Mike,

You can't tell that from the MDEV chart.
You'll need to store the report from Lars' program over a 24hr period and use Excel to chart the ns, DAC and OCXO temperature values to try to make sense out of what's going on. Can you publish those graphs, or post the excel file with the report?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: nealix on October 11, 2020, 08:29:50 pm
But I could not locate any supplier of a breakout module board with the M8T on it
for anywhere less than $100 USD.    Where do you guys find a timing module on a breakout board that can actually be used without
doing your own wave soldering and PCB design?   

You like it accurate, so you have to pay. If you need just a "frequency" you can set a cheap $US15 UBlox module output with UCenter.
I do not understand why you want to use an "High End Lars-Board" with the lowest quality pulse generator.  :rant: :-// :-// :scared:
Contradiction in terms
See att

https://www.ebay.com/itm/1x-Ublox-LEA-6T-2-000-50-channel-15ns-1pps-Timing-GPS-module-WD22UGRC/313149500246?hash=item48e92a2b56:g:IR8AAOSwULhfEG5T (https://www.ebay.com/itm/1x-Ublox-LEA-6T-2-000-50-channel-15ns-1pps-Timing-GPS-module-WD22UGRC/313149500246?hash=item48e92a2b56:g:IR8AAOSwULhfEG5T)

RE:  I do not understand why you want to use an "High End Lars-Board" with the lowest quality pulse generator.

:-) :-)  If you read a little higher, you may notice that I purchased both a Skytraq Venus838LPx-T Timing GPS module breakout,
AND the U-Blox M9N.   The M9N is a very good enough receiver for hobby level work on my projects, and got here in days,
so I could play and learn while the Skytraq takes one month to arrive.

Some of us are "time-nuts" {tm}, but I am not.    My personal goal for this project is to learn more about how a GPSDO
really works, learn time lab and lady heather, and compare the result  to my $175 commercial GPSDO.   If I wanted or
needed "Aerospace" level accuracy, I could indeed choose to rip the wallet wide open and spend spend spend.  But I like
the idea of seeing if my parts spend can be less than or equal to the commercial unit, yet match or exceed it's performance.
Each person has a different reason.  :-)

As far as accuracy for the $50 Skytraq Venus838LPx-T Timing GPS module:

The Venus838LPx-T module will provide PPS quantization error correction messages, allowing you to remove the quantization
error present on the PPS output. Without correcting this error, the PPS will have approx. ±6 ns of jitter.

Back to the non-timing and typically fake eBay U-Blox Neo-6 modules;  They are more than good enough for
my GPS disciplined Wall Clock projects, where a human can't tell if you are half a second off;

https://nealix.zenfolio.com/img/s/v-10/p4012064259-4.jpg (https://nealix.zenfolio.com/img/s/v-10/p4012064259-4.jpg)
https://nealix.zenfolio.com/img/s/v-10/p4012064258-4.jpg (https://nealix.zenfolio.com/img/s/v-10/p4012064258-4.jpg)

https://nealix.zenfolio.com/img/s/v-10/p4012064260-4.jpg (https://nealix.zenfolio.com/img/s/v-10/p4012064260-4.jpg)
https://nealix.zenfolio.com/img/s/v-10/p4012064255-4.jpg (https://nealix.zenfolio.com/img/s/v-10/p4012064255-4.jpg)

and finally, when I receive the Skytraq Venus838LPx-T Timing GPS module and can build Lars/PaulV's schematic,
this is what I wish to compare results to (The simple China BG7TBL GPSDO that uses FLL instead of PLL):

https://nealix.zenfolio.com/img/s/v-10/p4012055982-4.jpg (https://nealix.zenfolio.com/img/s/v-10/p4012055982-4.jpg)
and yes, accurate to half a Hertz is more than good enough for my amateur hobby needs.

So anyway, thanks again for putting up with another newbie here.  But I am learning from you guys and having fun
at the same time.  For that, huge thanks!

Cheers,

Neal
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on October 11, 2020, 09:38:23 pm
Mike,

You can't tell that from the MDEV chart.
You'll need to store the report from Lars' program over a 24hr period and use Excel to chart the ns, DAC and OCXO temperature values to try to make sense out of what's going on. Can you publish those graphs, or post the excel file with the report?

Thanks Paul, here's a 24 hour extract.

Mike
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: nealix on October 11, 2020, 10:15:37 pm
Does anyone here know where can I find  a datasheet for the CTi OCXO model OSC5A2B04 ?

Thanks,

Neal
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on October 11, 2020, 10:22:24 pm
Does anyone here know where can I find  a datasheet for the CTi OCXO model OSC5A2B04 ?

Thanks,

Neal

I think they share the pin-out of all the other OCXOs with the same size and footprint. Or what else did you haven in mind looking for in the datasheet?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: nealix on October 12, 2020, 12:54:31 am
Does anyone here know where can I find  a datasheet for the CTi OCXO model OSC5A2B04 ?

Thanks,

Neal

I think they share the pin-out of all the other OCXOs with the same size and footprint. Or what else did you haven in mind looking for in the datasheet?

I am trying to decide which OCXO to use for my first build here.   
For square wave, I have the CTi and the ISOTEMP.
For Sine, I have an 8663, a pair of Morion MV85, a CMAC, and a couple of Bliley 1282's.

Any opinions or favorites re which one I should build my first unit with?

Cheers
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on October 12, 2020, 06:02:34 am
@Mike

Attached are the charts based on your 24hrs Lars' report on your Vectron.

From the ns chart, it seems your GPS signal is too noisy. It really should be within +/- 20ns.
I would investigate why this is so by analyzing the NEO performance with u-center. If you didn't already put it in stationary mode, I recommend you do that. Also, do you limit the reception to better than 20dB? How many sats do you then have, and which constellations do you receive. Is your view of the sky OK? All these questions can be answered by u-center. I should point out that many of my own earlier strange GPSDO behavior were caused by the poor results coming from the NEO. By using an M8T timing version due to my poor reception, all my troubles melted away like snow in spring.

What is strange is that nowhere are your ns values going beyond +/- 100ns, so this is not the reason for loosing the lock.
If you look at the filt output, it follows the lock status. I cannot find a reason for loosing the lock based on the control loop of the system.

If you look at the DAC data, it seems that it is still settling. The curve is slowly moving down.
I also included the 3 hr averages from the status report. You can clearly see the settling of the OCXO in the curve. Your 3 hr OCXO temperature has a lot of movement.

Your temperature reports seem a bit off. If you use temp for the OCXO, that seems a bit low, and it varies quite a bit. I also looked at the temp1 data, and it is around 29 degrees but varies the same way. Is that sensor measuring the inside of the enclosure? Is the enclosure really closed, or do you have the lid open? I suggest you close it.

This was with a TC of 200. I think you are now running with a TC of 4? This will really show the components because there is no filtering taking place.

If you can, post that TC 4 run as well.

Can you also post the f2 and f4 reports together with the status reports?

I'm puzzled by the frequent lock losses though.
One suggestion I have is to clear the EEPROM with e22, restart the program and input only the required values like gain, TC and temp sensor type (11), then save them with s1.

Good hunting!
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on October 12, 2020, 07:32:35 am
For Sine, I have an 8663, a pair of Morion MV85, a CMAC, and a couple of Bliley 1282's.

The MV85 is definitely my favorite of the day. Beware of fakes, though.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on October 12, 2020, 08:03:28 am
Attached are the charts based on your 24hrs Lars' report on your Vectron.

Paul, many thanks for looking at this for me. I have trouble producing those graphs because I use LibreOffice Calc and it is very slow and crashes frequently on large files. I also have Excel 2003 but that has a limit of 65k rows and 32k points for a chart.

You could be right about the satellites. I can't receive any at all with a puck antenna even on the window sill. My active outdoor antenna is mounted on the house wall facing east and usually sees 10-12 satellites. My U-Blox is a NEO-7N.

It will take me a while to respond to all your suggestions. I'd like to leave the tc=4 run for a bit longer before trying anything else.

Mike
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on October 12, 2020, 09:19:28 am
Mike, when you have about a day's worth of data for the TC 4 run, upload that file, but also post the f2 and f4 reports.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on October 12, 2020, 10:02:02 am
Paul, many thanks for looking at this for me. I have trouble producing those graphs because I use LibreOffice Calc and it is very slow and crashes frequently on large files. I also have Excel 2003 but that has a limit of 65k rows and 32k points for a chart.

Mike, take a look at Matlab or Octave (free Matlab clone). It's definitely worth it and gets things done much faster than messing with apreadsheet. Takes some getting used to, but handles big data sets much easier than Excel/Calc.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: cdev on October 12, 2020, 02:57:36 pm
Quote from: Mike99
You could be right about the satellites. I can't receive any at all with a puck antenna even on the window sill. My active outdoor antenna is mounted on the house wall facing east and usually sees 10-12 satellites.

A GPS patch antenna should always be facing up, or close to up or be pointing at the clear patch of sky -with an elevation mask set! the elevation mask will then reject odd order reflections, which are polarity reversed.

An elevation mask is always a good idea with a patch antenna.

Also, it sounds like you may be using it without a ground plane. A patch antenna doesnt work properly without a flat piece of metal beneath it. Ideally it should be aligned with the horizon, really.
Thats an integral art of the antenna. It doesnt responate properly without it. At the minimum you should use something like a junk CDRom or ideally a piece of steel the magnet can adhere to. A piece of PCB will do fine too. The bigger it is the better it will work!  I also put a small ferrite on the coax coming from them to decouple the feedline. That usually makes a small but meaningful improvement in the pattern.

I recently got a NanoVNA and its obvious when sweeping the passinve GPS antennas I have why the groundplane is essential and why it should be larger. They clearly come from the factory tuned to a large GP, like the roof of a car. There is a very noticeable dip at the resonant frequency and if you use a passive GPS antenna with the factory's minimal ground plane you can see how radically it shifts with a small versus large ground plane.

They come just as the ceramic element with a peg, to connect it, the equivaent of having an antenna supplied just as a whip, and a PCB pattern, the device, not the antenna - manufacturer ususally provides their own PCB and it is the groundplane.

Basically, the groundplane makes the antenna.  So you cant just put a puck antenna on your windowsill and expect it to work. What I would do is take a junk CG and using any available means, attach that to your puck's bottomside.  They are cupposed to magnetically affix to an automobile roof.  Thats how they are supposed to be used.

But just a CD/DVD will give you just enough GP to get it to work. A bit larger would be better. 20 cm or more, several wavelengths, would be ideal if its practical. It will improve your performance a lot.  Anything flat and conductive will do it.  Put some copper tape on your windowsill.

A lot of people make this mistake.  The same appllies in any rover, UAV, etc. situation.

Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on October 12, 2020, 03:30:59 pm

If you can, post that TC 4 run as well.

Can you also post the f2 and f4 reports together with the status reports?


Here are the requested reports.

I believe the temperature readings to be accurate. The Vectron OCXO runs much cooler than my Trimble. The ambient sensor is positioned next to D1. The board is in an enclosure (same as yours) with the lid on.

Mike
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on October 12, 2020, 03:36:03 pm
Also, it sounds like you may be using it without a ground plane.

Not so sir. I placed the puck on a sheet of copper clad PCB but it would still only receive satellites when outside the house. When you consider that the GPS module and puck together cost 7 UK pounds I'm happy to consign that antenna to the bin.

That's why I gave up with the puck and mounted an active antenna on the house wall.

Mike
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on October 12, 2020, 05:46:03 pm
I would investigate why this is so by analyzing the NEO performance with u-center. If you didn't already put it in stationary mode, I recommend you do that. Also, do you limit the reception to better than 20dB? How many sats do you then have, and which constellations do you receive. Is your view of the sky OK? All these questions can be answered by u-center. I should point out that many of my own earlier strange GPSDO behavior were caused by the poor results coming from the NEO. By using an M8T timing version due to my poor reception, all my troubles melted away like snow in spring.

My NEO-7 was in Portable mode. I changed it to Stationary mode and captured the attached images. However as my module is an M suffix it appears that I am unable to save configuration changes? I couldn't find where to limit the reception to >20dB.

Mike
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on October 12, 2020, 05:49:32 pm
Disable SBAS. It doesn't typically help the stability of the timing signal.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: bingo600 on October 13, 2020, 06:17:46 pm
Paul, many thanks for looking at this for me. I have trouble producing those graphs because I use LibreOffice Calc and it is very slow and crashes frequently on large files. I also have Excel 2003 but that has a limit of 65k rows and 32k points for a chart.

Have a look at gnuplot

/Bingo
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: cdev on October 13, 2020, 08:40:40 pm
Also, it sounds like you may be using it without a ground plane.

Not so sir. I placed the puck on a sheet of copper clad PCB but it would still only receive satellites when outside the house. When you consider that the GPS module and puck together cost 7 UK pounds I'm happy to consign that antenna to the bin.

That's why I gave up with the puck and mounted an active antenna on the house wall.

Mike

Is the GPS antenna's normal up pointing sideways?  Thats what I am getting at.  It may work fine, but I would put it on a 90 degree bracket and groundplane.

and if there is still enough sky view that it still works, set an elevation mask perhaps. Ive lived in lots of flats at various times where the only sky view is  up an air shaft.  I'd be surprised if that worked well but as long as the GPS can see a few sats at once it should woirk enough to get a lock. Newer GPS receivers are pretty sensitive.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on October 14, 2020, 09:41:58 am
@Mike

I looked at your TC4 results.
The graphs I made from your data in Excel look pretty good. The 1PPS has the expected noise level, so your GPS is not the culprit. The ns band is significantly below +/- 20ns, with only a wobble in the middle of the data, which is acceptable.
The DAC follows the 1PPS jitter lead, but the excursions are a little high.
The temperatures look very stable too.
So this looks very good, and offers no explanation for loosing the lock at higher TC's.

However, when you look at the DAC values in TimeLab, it shows a very different story.
Look at the MDEV chart. The curve looks great, but look at the left axis. This is rubbish.

Note that to import the DAC data into TimeLab, you have the convert the DAC values back to frequency. You do that by dividing 1E-9 by the gain. In your case, with a gain of 590, that results in a value of 1,69492E-12 and that is used to convert the DAV values inside TimeLab.

I suspect that there is something not quite right with the way you calculated your gain, or the method that you used to obtain it. Otherwise your hardware that drives the OCXO adjustment has issues. This would explain the weird loss of locks at higher TC's, and also the weird TimeLab results.

The way I adjusted my OCXO's was by setting the DAC at mid-range (h32767) and while looking at the Lars' report, adjust the OCXO DAC by a trimmer so the diff_ns reads an average of 0ns over a page of data or so.
Now set the DAC to the minimum with h1 and again look at the diff_ns report for a page of data. Take the average of that data and write it down.
Now set the DAC to the maximum with h65535 and again look at the diff_ns report for another page of data. Take that average too and write it down. One of them will be below 0, and one above. Add the two averages together without using the sign.
Divide 65535 by that result and that is your gain.
 
If the gain is significantly below 500, adjust the trimming resistors for the DAC adjustment to make it larger. If it's significantly above 1.000, make it a bit smaller. I suggest a range between 600 - 900, but in the end, it all depends on the drift and aging of your OCXO.

If your OCXO has aged enough and the DAC results are no longer drifting up or down over a longer period, replace the trimmer with fixed resistors to remove temperature effects.

I hope this helps...





Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on October 14, 2020, 11:12:51 am
Paul, thanks for looking at that for me but I think something went wrong with your MDEV chart. Here is what I get from the same data, and the parameters I used to import it.

I replaced the trimmer pot with fixed resistors before starting my aging run. My resistor values are:

R104 = 20k, R105 = 5k1, R110 = 2k7, R111 = 12k, R109 = 100k.

The diff_ns values averaged over a page of data were 51.6 for h1 and -59.5 for h65535, so a total of 111ppb. 65535/111 = 590 and 1E-9/590 = 1.6949E-12 so I think I got that right.

Mike
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on October 14, 2020, 01:28:34 pm
Well I'll be d...
I tried to import your data several times with the same results, even after closing and restarting TL.

I just tried it three more times, same results.
I de-installed TimeLab en re-installed it.
Same result.  :-//

Tried earlier data from one of my own GPSDO's, same bad results.  :-// :-//
 :wtf: is going on?

De-installed TL again and removed all remnants I could find.
Installed it again.
Tried my own data, works!
Tried your data, works!

|O

The net-net is that it seems your GPSDO is (now?) working as expected. Why don't you try to increase the TC and see if it stays locked after getting a lock?
Be on the watch-out for the swings in the ns values. If you see it starting to drift slowly and regularly, it means that your TC is getting too high.

Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on October 14, 2020, 02:29:37 pm
The net-net is that it seems your GPSDO is (now?) working as expected. Why don't you try to increase the TC and see if it stays locked after getting a lock?
Be on the watch-out for the swings in the ns values. If you see it starting to drift slowly and regularly, it means that your TC is getting too high.

Thanks I will do that.

Glad you got TL sorted!

Mike
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Yannick99 on October 15, 2020, 03:24:12 pm
Have a look: https://www.instructables.com/id/GPSDO-YT-Disciplined-Oscillator-10Mhz-Reference-Fr/ (https://www.instructables.com/id/GPSDO-YT-Disciplined-Oscillator-10Mhz-Reference-Fr/)
Any comments?

These GPSDO work with a FLL not with a PLL. The lock is very fast and stable. Are there any further experiences with this type? Unfortunately there is no source code from the project.

Hi 0xFFF0,

I just released my code on github https://github.com/YannickTurcotte/GPSDO-YT (https://github.com/YannickTurcotte/GPSDO-YT)

 If the pps is accurate, yes it's fast and very stable.

Regards

Yannick
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on October 15, 2020, 07:32:33 pm
Yannick was so kind to develop a special counter version of his own GPSDO project for me, to tailor it to GPSDO's in general.
I have extensively tested it over the past couple of weeks, and it works really well.

The latest version has a programmable gate time that can be set to 1.000s with 3 decimal digits of resolution, or 10,000s for a 4 decimal digit resolution and it sends the results to a serial port. It does not need an LCD display and needs only a few components.

Just displaying the result on a display has little benefit with high precision and stable OCXO's, but logging the results to track them over time does. As a minimum, it's a poor mans high resolution counter that gives you another look at the GPSDO precision and stability.

I will post my development for the Lars project on my own blog to not pollute this one too much.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Yannick99 on October 15, 2020, 11:56:07 pm
Yannick was so kind to develop a special counter version of his own GPSDO project for me, to tailor it to GPSDO's in general.
I have extensively tested it over the past couple of weeks, and it works really well.

The latest version has a programmable gate time that can be set to 1.000s with 3 decimal digits of resolution, or 10,000s for a 4 decimal digit resolution and it sends the results to a serial port. It does not need an LCD display and needs only a few components.

Just displaying the result on a display has little benefit with high precision and stable OCXO's, but logging the results to track them over time does. As a minimum, it's a poor mans high resolution counter that gives you another look at the GPSDO precision and stability.

I will post my development for the Lars project on my own blog to not pollute this one too much.


It was a pleasure Paul.

Source code for this counter available here: https://github.com/YannickTurcotte/GPSDO-Counter

Like Paul said, more info on his blog.

Yannick
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on October 16, 2020, 02:41:23 pm
I need some more help please guys.

I've been running my GPSDO with tc=100s and it has lost lock three times in under 24 hours. The out of lock periods are remarkably consistent: 525s, 523s and 514s.

I've posted some pictures and the log. Any ideas what's going on please?

Mike
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on October 16, 2020, 05:45:54 pm
Did you do the TIC linearization?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on October 17, 2020, 08:55:38 am
Did you do the TIC linearization?

No I haven't done that. Is it essential to maintain lock?

Mike
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on October 17, 2020, 09:24:34 am
Did you do the TIC linearization?

No I haven't done that. Is it essential to maintain lock?

Mike

I haven't analyzed your data, but if you have discontinuities between the fine and coarse TIC parts, that will cause jumps in the phase measurements. Remember you changed the resistor in the interpolator part, so 1 microsecond might not correspond to 1000 fine TIC units. It also didn't with the original resistor value since you got overruns, remember? The "10MHz missing" messages...

I'd say, doing the TIC linearization is essential for a Lars GPSDO.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on October 17, 2020, 09:39:21 am
@ Thankfat:
Quote
I'd say, doing the TIC linearization is essential for a Lars GPSDO.

I searched this forum for "TIC linearization" and can only find references to that use in TimeLab.

Can you please enlighten us on how to do what your asking us to do?

Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on October 17, 2020, 09:57:54 am
I haven't analyzed your data, but if you have discontinuities between the fine and coarse TIC parts, that will cause jumps in the phase measurements. Remember you changed the resistor in the interpolator part, so 1 microsecond might not correspond to 1000 fine TIC units. It also didn't with the original resistor value since you got overruns, remember? The "10MHz missing" messages...

I'd say, doing the TIC linearization is essential for a Lars GPSDO.

You have a good memory! However, the resistor change was in my first GPSDO, which followed the Lars design.

My current experiments are with Dbldutch's modified design, which didn't have that problem.

Mike
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on October 17, 2020, 11:26:04 am
I decided to eliminate possible problems with the satnav signal by replacing the Chinese U-blox NEO-7M with a genuine M8T (curse this addiction  :'().

I'm running it again at tc=100s. After gaining lock, it unlocked 95 minutes later then locked again after 547 seconds (same interval as before). It's still locked 8 hours after that. You can see the DAC value taking a dive when it lost lock.

Is it OK to feed the 3.3V logic level from the U-blox to the 5V HC4046 without a level shifter?

Mike
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on October 17, 2020, 12:30:21 pm
Mike, you are supplying a 3V3 level output signal to a 5V input, so there will be no smoke and the 3V3 is safely above the 5V signal threshold level.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on October 17, 2020, 01:21:26 pm
@ Thankfat:
Quote
I'd say, doing the TIC linearization is essential for a Lars GPSDO.

I searched this forum for "TIC linearization" and can only find references to that use in TimeLab.

Can you please enlighten us on how to do what your asking us to do?

Page 12 in Lars original documentation.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on October 17, 2020, 01:25:09 pm
I decided to eliminate possible problems with the satnav signal by replacing the Chinese U-blox NEO-7M with a genuine M8T (curse this addiction  :'().

I'm running it again at tc=100s. After gaining lock, it unlocked 95 minutes later then locked again after 547 seconds (same interval as before). It's still locked 8 hours after that. You can see the DAC value taking a dive when it lost lock.

Is it OK to feed the 3.3V logic level from the U-blox to the 5V HC4046 without a level shifter?

Mike

What is the "ppb" graph?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on October 17, 2020, 02:19:16 pm
What is the "ppb" graph?

It's the diff_ns readings.

Mike
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on October 17, 2020, 02:29:02 pm
@ Thankfat:
Quote
I'd say, doing the TIC linearization is essential for a Lars GPSDO.

I searched this forum for "TIC linearization" and can only find references to that use in TimeLab.

Can you please enlighten us on how to do what your asking us to do?

Page 12 in Lars original documentation.

Yes I read that when I started out, but I didn't understand it and I thought it was only needed when using the first method to get optimum tc.

Am I right that the TIC offset should be 500? For some odd reason mine is 68.

Mike
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on October 17, 2020, 02:58:09 pm
The TIC offset should be 500, yes, because that puts it smack center in the most linear region of the ADC, and provided you did the TIC linearization properly, you should have +/- 500ns of "drift space" before the fine TIC wraps.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on October 17, 2020, 03:05:54 pm
@ Thinkfat:

The second paragraph on page 12 is confusing to say the least, at least for me.

However, I looked again at the data Mike provided earlier, the one where he used a TC of 4, and there his filtx10 values are in a band of about 570-800.
I looked at a run of my Trimble also with a TC of 4, and there the filtx10 values are centered around 5,000 +/- 100 which seems to be more correct.

I looked at his provided f2 and f4 data and I totally missed his offset, which is indeed wrong.

Sorry Mike!



Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on October 17, 2020, 03:12:02 pm
@ Thinkfat:

The second paragraph on page 12 is confusing to say the least, at least for me.

However, I looked again at the data Mike provided earlier, the one where he used a TC of 4, and there his filtx10 values are in a band of about 570-800.
I looked at a run of my Trimble also with a TC of 4, and there the filtx10 values are centered around 5,000 +/- 100 which seems to be more correct.

I looked at his provided f2 and f4 data and I totally missed his offset, which is indeed wrong.

Sorry Mike!

I'm glad some of the experts find it confusing too! I have no idea why my TIC offset was 68. I have never set a value for it so I presume it loaded as a default when I erased the EEPROM and saved the data? Anyway it is now 500 and locked again so we'll see what happens. I'll play with the linearisation when (if) I undrestand how to do it!

Mike
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on October 17, 2020, 03:14:52 pm
@ Thinkfat:

The second paragraph on page 12 is confusing to say the least, at least for me.

However, I looked again at the data Mike provided earlier, the one where he used a TC of 4, and there his filtx10 values are in a band of about 570-800.
I looked at a run of my Trimble also with a TC of 4, and there the filtx10 values are centered around 5,000 +/- 100 which seems to be more correct.

I looked at his provided f2 and f4 data and I totally missed his offset, which is indeed wrong.

Sorry Mike!

Well, the linearization is necessary for using the GPSDO electronics for timestamping, however, for all the graphs to make sense, you need to make sure that the interpolator values are indeed covering a range of 1000ns. For this, you need to see where the ADC wraps, find the min and max and provide this input to the software.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on October 18, 2020, 08:46:54 am
@thinkfat:

I must admit that I never bothered to deal with the linearization, because I didn't understand it, nor the implications.

Please help us to understand.

For both my OCXO's, the f2 reports shows the TIC_offset = 500, the TICmin = 12.0, the TICmax = 1012, Square comp = 0.100
I believe these are the default values.

Below are the graphs for the filtx10 and the DAC values.

How do I figure out the values to set the min/max parameters for the linearization correctly, and what is the intended effect?
 
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on October 18, 2020, 09:09:15 am
@thinkfat:

I must admit that I never bothered to deal with the linearization, because I didn't understand it, nor the implications.

Please help us to understand.

For both my OCXO's, the f2 reports shows the TIC_offset = 500, the TICmin = 12.0, the TICmax = 1012, Square comp = 0.100
I believe these are the default values.

Below are the graphs for the filtx10 and the DAC values.

How do I figure out the values to set the min/max parameters for the linearization correctly, and what is the intended effect?

You need to set the points where filtx10 wraps. Otherwise you have no correspondence between raw ADC values and phase difference in nanoseconds. How you do that is explained on page 12 of the manual.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on October 18, 2020, 09:32:38 am
@Thinkfat

Sorry, I don't understand what you mean with "wraps".

Do you mean the "band" around the mean? This would mean for the Trimble +60 and -90 and for the Bliley +30 and -30?
Does this mean a min of 90 and a max of 60 for the Trimble and 30:30 for the Bliley?

If I understand Lars, we need to set the right span of the TIC. Which is linearization min and max.
With the command "l" min can be set with values 0.1-50 and max can be set with values 800-1023
So how does that work with above values?



Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on October 18, 2020, 09:56:33 am
@Thinkfat

Sorry, I don't understand what you mean with "wraps".

Do you mean the "band" around the mean? This would mean for the Trimble +60 and -90 and for the Bliley +30 and -30?
Does this mean a min of 90 and a max of 60 for the Trimble and 30:30 for the Bliley?

If I understand Lars, we need to set the right span of the TIC. Which is linearization min and max.
With the command "l" min can be set with values 0.1-50 and max can be set with values 800-1023
So how does that work with above values?


It's not about the "band" around the mean. It's about the raw ADC range covered by the phase difference range of the interpolator.
Please, read the instructions on page 12 and recall how the interpolator works. Think about the phase difference range it can display with its 1MHz input frequency.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on October 18, 2020, 11:30:02 am
Paul, my understanding of what Lars wrote is that you set the TIC Offset to 1,000 and watch the variation in the filtx10 values. Mine went from a minimum of 9810 to a maximum of 10220 over a short period. I used the l command to store these as 98 for TICmin and 1022 for TICmax. The default values I had were 120 and 1012.

I have no idea what the "squared" value is or how to establish it.

Mike
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on October 18, 2020, 12:29:34 pm
Hi Mike,
I have set the TIC offset to 1,000 for both of my units as well.

In the first sentence of the 3rd paragraph on page 12, Lars wants you to set the TIC offset from 500 to 1,000 when the system is locked, but when you do, you loose the lock immediately. Which makes sense because the ns values go down by 500. What does not make sense to me is what numbers from the filtx10 column to take, and when.

My filtx10 values are jumping up and down, but also steadily going up. I'm not sure if you can just take the min/max out of whatever number of minutes your sample is, or if you have to wait for the unit to lock again.

My min max numbers out of the first 7 minutes were 5450 and 6650 for the Bliley.
Because these are unfiltered values (no lock), you should take off the last digit, so that would be 545 and 665. However, the maximum number for the min setting is 500 (to get 50). So I still don't get it if that's the procedure.

My units are getting closer to a lock now (ns < 100) and the min/max values for the Trimble are now 10590 and 10960, so I still can't make heads or tail out of these numbers.

I'm waiting for a lock to see what the filtx10 numbers will report then.
Unfortunately, it will take a while for my units to lock because of the long tc's of 800 and 1,500.

Stay tuned, we'll figure it out somehow unless somebody gives us clearer instructions.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on October 18, 2020, 02:43:27 pm
With the TIC_offset at 1,000, it's never locking, even with a tc of 4.

No matter what I do, I can't get it to produce viable numbers.  |O
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on October 18, 2020, 03:02:51 pm
I set my TIC offset to 1,000 with a tc of 4s and didn't lose lock. I don't have any numbers I can show you but the filt10x value cycled up and down repeatedly between the minimum and maximum in a fairly short time.

I'll try and capture some numbers later to show you.

Mike
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on October 18, 2020, 05:57:52 pm
Paul, my understanding of what Lars wrote is that you set the TIC Offset to 1,000 and watch the variation in the filtx10 values. Mine went from a minimum of 9810 to a maximum of 10220 over a short period. I used the l command to store these as 98 for TICmin and 1022 for TICmax. The default values I had were 120 and 1012.

I have no idea what the "squared" value is or how to establish it.

Mike

Another (better) way would be to go into "hold" mode and then set the DAC to a value that slowly lets filtx10 drift upwards (or downwards), then record filtx10. The slower the drift the better, like 1 digit per second so that you can see what is going on. At a point it should "jump" from 10000-ish to (I think?) 9000-ish, then look for the highest and the lowest value you find and enter that as min/max.

Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on October 18, 2020, 07:27:11 pm
I set my TIC offset to 1,000 with a tc of 4s and didn't lose lock. I don't have any numbers I can show you but the filt10x value cycled up and down repeatedly between the minimum and maximum in a fairly short time.

I'll try and capture some numbers later to show you.

Mike

OK I was wrong about losing lock, but it appears to work. The attached log shows filt10x moving between high and low values 1 minute after setting TIC_Offset to 1,000. I'd run it for longer and take averages.

Mike
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on October 19, 2020, 09:16:28 am
Let's first stick to the procedure Lars described and see if we can figure out what he meant.

In principle, he is trying to create a better linearization for the ADC TIC input values.

I think that the first part of the procedure should be to set the tc to 4, the TIC_offset to 500 and wait until you have a lock. I think that the tc at 4 is important because it eliminates the filtering in the control loop. A tried a higher tc but that takes hours to settle.

Now set the TIC_offset to 1,000.
I think this means that the ADC will now be forced to work at the top of its 8-bit 1,024 max range, rather than in the middle (at 500).
The ns data will therefore jump from around 0 to -500, the inverse of the additional offset from +500.
The controlling loop will now try to get the ns numbers back to around 0 again.

Wait for the ns and filtx10 data to stabilize. With a tc at 4, this should not take more than a minute or so.
The ns values should on average be around 0 again, and the filtx10 should now be around 10,000. (1,000 x 10)

Save the data from a minute or so after the data stabilized and put it in a spreadsheet.

Lars writes that "With a TIC_offset of 1,000, the GPSDO will go between min and max if the max ADC is less than 1,000. The filtx10 values will give you the min and max."

I interpreted that as follows.
Record all numbers below 10,000 (the min) and all numbers above 10,000 (the max).
These numbers are at the highest range of the ADC, and so in the most linear region.

Obtain the average of the two sets.

In my case for the Trimble, the average number below 10,000 was 9,889, for my Bliley 9,878
The average of the numbers above 10,000 was 10,181 for the Trimble and 10,146 for the Bliley.
I calculated Mike's numbers to be 9895 and 10194.
So far so good I think.

The challenge is to convert these numbers to the valid min and max values.
The min values can only be between 1-500 to become 0.1 to 50.
The max values can only be between 800-1023.

I tried it several ways, but I can't figure it out how to massage the obtained numbers so I can put them in as min/max.

Because filtx10 is multiplied by ten when there is no lock, you could divide the numbers by 10. This would than be a true representation of the ADC input at an offset of 1,000. However, the min numbers will already be divided by 10.
The Trimble number for min would then become 988, but you can't input that.
The max number would become 1,018 and that would only just fit.

You could take 10,000 as the mid point, in which case the min numbers become 10,000 - 9889 = 122.
The max number would then be 10,146 - 10,000 = 146, but that number cannot be used.

Another thought (very far fetched!) I have is that Lars maybe meant to get the min value with a TIC-offset of 500. The lowest filtx10 value would then always be below 500, which is the valid min range. You should then only obtain the max value with a TIC_offset of 1,000, in which case the max will always be in the valid max range.

Anybody?  :-//
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on October 25, 2020, 11:23:31 pm
I'd like to echo Paul's request - has anyone succeeded in establishing a value for TIC_min?

In the meantime I'm using the TIC values in Lars' report (120 and 1012) and have done a few short runs with time constants up to 1,500s and had no problems with locking.

I've attached some plots below. Any comments on the performance please? Any obvious issues?

Mike
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on October 26, 2020, 12:54:14 pm
I found this on time-nuts. Does it shed any light on how to get the min and max TIC values?

https://www.mail-archive.com/time-nuts@lists.febo.com/msg00947.html (https://www.mail-archive.com/time-nuts@lists.febo.com/msg00947.html)

Mike
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on October 26, 2020, 01:13:17 pm
I don't think so Mike, but thanks for digging this up.
There is some interesting stuff in this thread.

Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on October 29, 2020, 01:08:27 pm
My M8T does not have the required firmware and although I found it and tried, I can't load it due to communication errors with the device. Upgrading the fw for the M8T apparently is not without risks. In any case, that's why I don't have access to Galileo.

Paul, are you sure it's because you weren't exceeding the maximum number of satellite systems the M8T can track? If you already had three selected then it would deselect Galileo.

Mike
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on October 29, 2020, 01:51:59 pm
Hi Mike,
No that was not the problem. My M8T had old firmware that would not let me select Galileo.
I finally figured out where to find the new version and how to upload the new firmware and that solved the problem.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on October 29, 2020, 03:41:37 pm
Finding the min and max should be really easy if you supplement the logging, printing the raw ADC values in addition, then setting up the GPSDO like described in the time-nuts posting.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on October 30, 2020, 03:08:11 pm
Well, with the hint from thinkfat, I finally figured it out. Although the time-nuts postings did not help or clarify.

I indeed added a column in the status report to show the "raw" ADC-TIC values. When you apply the offset of 1,000, this extra column reveals what Lars had in mind with the filtx10 data. Unfortunately he did not elaborate what to do with the numbers which had us totally confused.

First of all, I used the procedure I outlined in my post just above. Set TC=4, wait for a lock. Then set the offset to 1,000 and wait until the ns numbers stabilize about around zero again. This will only take a minute but there will be no lock indication. In my software, this is shown as "****" in the sample below.

Now remember that when there is no lock, filtx10 shows the numbers x10. So the offset of 1,000 becomes 10,000 in the filtx10 column.

If you now look at the filtx10 data, all values above 10,000 "represent" the minimum value. To get that value so you can enter it into the system, you need to subtract 10,000. So as an example, if the value is 10,120, take off 10,000 to get 120. When you enter this value into the system, it will be divided by 10 to become 12 which is the intended value.

All values below 10,000 are the maximum values, divided by 10. So as an example, if the value is 9,950, the maximum value is 995.

I would capture at least a page or so of data in a spreadsheet and then calculate the average of the min and the max values.

These values can now be added into the system with l120 for min and l995 for max and then saved with s1 in the EEPROM.


The numbers in the added column with the ADC TIC values, are spot on to those calculated numbers above, so that must be it!
Here is a small abbreviated sample of my modified log: (excuse the formatting, I did my very best...)


Code: [Select]
Timestamp                ADC   pwm     time      ns        dac   temp   status   diff_ns   filtx10   
15:31:20.015 -> 995 134 4283   -6 35478 50.4   **** 10   9950
15:31:20.994 -> 997 135 4284   -3 35873 50.4   ****   2   9970
15:31:21.977 -> 995 138 4285     -6 35328 50.4   **** -2   9950
15:31:23.007 -> 994 141 4286   -7 34990 50.4   **** -1   9940
15:31:23.989 -> 12 132 4287     14 39274 50.4   **** 21 10120
15:31:25.018 -> 992 138 4288   -9 34614 50.4   **** -23   9920
15:31:26.006 -> 989 141 4289 -13 33731 50.4   **** -3   9890
15:31:26.987 -> 32 132 4290   31 44028 50.4   **** 44 10320
15:31:27.973 -> 16 142 4291   17 40721 50.4   **** -14 10160
15:31:29.002 -> 10 139 4292   12 39556 50.3   **** -5 10100
15:31:29.984 -> 991 130 4293 -10 35102 50.3   **** -23   9910

Mystery solved.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on October 30, 2020, 09:49:02 pm
Mystery solved.

Nice work sir! I would never have figured that out.

Now, can I raise the enthusiasm to get hold of a PD26 to calculate x2?

Also, what is "k" and how is it entered? Lars has a value of 6 in his example while mine is 63.

Mike
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: billy_gr on October 31, 2020, 06:50:27 am
Also, what is "k" and how is it entered? Lars has a value of 6 in his example while mine is 63.

Mike
k is the Now acquiring value: of the Three hour averages: TIC+DAC+temp
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti on October 31, 2020, 10:20:42 am
My M8T had old firmware that would not let me select Galileo.
I finally figured out where to find the new version and how to upload the new firmware and that solved the problem.

Can you post some info about this? I have a bunch of M8Ts that I would like to upgrade and I can’t find the FW. 
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on October 31, 2020, 11:39:51 am
Miti,
That process was described in post 482 on page 20.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti on November 01, 2020, 12:54:51 pm
Miti,
That process was described in post 482 on page 20.

Great, thanks! I have over 20 genuine M8T modules. If anyone is interested, I offer some for sale. They are salvaged from boards that were not working properly (other issues, not GNSS issues) but were conformal coated so hard to repair, and were scraped.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti on November 01, 2020, 10:53:10 pm
It worked like a charm! And it did take about 30 - 40 seconds for me. I can see Galileo now but my question is, and I bet it is answered somewhere here but TLDR, does it have any benefit in the GPSDO? I'm very pleased with my Lars GPSDO, it stayed locked since spring and actually all I need is a reasonably accurate 10MHz source, and I think it does this. My time/volt nutness is still under control.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Dbldutch on November 02, 2020, 08:56:04 am
Hi miti
I'm glad it worked!
The only benefit I see is that if you have a limited view of the sky, the additional constellation(s) and satellites will help to get a more stable 1PPS, and that will reflect directly on the GPSDO stability and precision. This worked sort of miracles in my particular situation.

What do you charge for an M8T?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti on November 03, 2020, 12:59:56 am
Hi miti
I'm glad it worked!
The only benefit I see is that if you have a limited view of the sky, the additional constellation(s) and satellites will help to get a more stable 1PPS, and that will reflect directly on the GPSDO stability and precision. This worked sort of miracles in my particular situation.

That's my case as well. I have a small magnetic patch antenna that's installed in my basement window on top of a biscuits box to have a ground plane, so I only see sky on the west side of the house. Upgrade may help a bit.

What do you charge for an M8T?

As Italians would say, tutto mezzo prezzo. Half price of what it is in Mouser, Digikey, etc. so $45 + shipping, tested and upgraded.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on November 03, 2020, 08:11:22 am
Hi miti
I'm glad it worked!
The only benefit I see is that if you have a limited view of the sky, the additional constellation(s) and satellites will help to get a more stable 1PPS, and that will reflect directly on the GPSDO stability and precision. This worked sort of miracles in my particular situation.

That's my case as well. I have a small magnetic patch antenna that's installed in my basement window on top of a biscuits box to have a ground plane, so I only see sky on the west side of the house. Upgrade may help a bit.

What do you charge for an M8T?

As Italians would say, tutto mezzo prezzo. Half price of what it is in Mouser, Digikey, etc. so $45 + shipping, tested and upgraded.

Is it a bare module, or mounted on some breakout board?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti on November 03, 2020, 11:35:50 am
Just the module. As I said, salvaged from some boards.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: nealix on November 04, 2020, 04:33:21 am
Newbie Question:

I received my Skytraq Venus838LPx-T timing PCB from Tindie, and I have finally put up my outdoor GPS antenna on a mast with
a 360 degree sky view.  The GPS module puts out NMEA sentences and after a short time gets lock and starts blinking the PPS LED.

When I see you guys talking about jitter and stability of the GPS module, what are you using to measure the 1 PPS output?
Are you using Timelab?  (The home page does not say anything about docs, but I assume they get installed when you install
the software?)  Or, is there any point in trying to measure the GPS module, rather than the full GPSDO project stability?

Or are you using some other method to look at the stability of the GPS module output?

Also, are there specific settings that should be made to this GPS timing module using the GNSS Viewer Software?

(I realize I am kind of circling around the edge of this project, sort of starting in parallel with my GPS receiver module
and also with the wiring of the OCXO unit.   The middle will fill in after I learn more about these edge parts.)

Thanks for any guidance/mentoring,

Neal
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on November 05, 2020, 01:40:42 pm
Paul, many thanks for looking at this for me. I have trouble producing those graphs because I use LibreOffice Calc and it is very slow and crashes frequently on large files. I also have Excel 2003 but that has a limit of 65k rows and 32k points for a chart.

Mike, take a look at Matlab or Octave (free Matlab clone). It's definitely worth it and gets things done much faster than messing with apreadsheet. Takes some getting used to, but handles big data sets much easier than Excel/Calc.

I just found a great open source program for plotting my GPSDO graphs:

https://veusz.github.io/ (https://veusz.github.io/)

It's easy to use (just follow the 5 minute tutorial) and handles large csv files easily. Here's an example.

Mike
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on November 06, 2020, 06:02:58 pm
My GPSDO will lock with tc=1500s (eventually!) and remain locked, but that's too long for my purposes so I've been doing some 24 hour tests with shorter time constants. Do the plots of diff_ns with increasing tc look a bit odd?

Mike
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti on November 07, 2020, 03:05:33 am
Newbie Question:

I received my Skytraq Venus838LPx-T timing PCB from Tindie, and I have finally put up my outdoor GPS antenna on a mast with
a 360 degree sky view.  The GPS module puts out NMEA sentences and after a short time gets lock and starts blinking the PPS LED.

When I see you guys talking about jitter and stability of the GPS module, what are you using to measure the 1 PPS output?
Are you using Timelab?  (The home page does not say anything about docs, but I assume they get installed when you install
the software?)  Or, is there any point in trying to measure the GPS module, rather than the full GPSDO project stability?

Or are you using some other method to look at the stability of the GPS module output?

Also, are there specific settings that should be made to this GPS timing module using the GNSS Viewer Software?

(I realize I am kind of circling around the edge of this project, sort of starting in parallel with my GPS receiver module
and also with the wiring of the OCXO unit.   The middle will fill in after I learn more about these edge parts.)

Thanks for any guidance/mentoring,

Neal

There are multiple ways to see the jitter in the 1PPS. I'm using the DSO, one way is to trigger from 1PPS on one channel while looking at a 10MHz signal from a GPSDO on another channel. Set the trigger mode to Normal, turn persistence to maximum and you'll get 1.png after awhile. Another way is to set the PPS output to 10MHz, trigger one channel from the GPSDO 10MHz output while the second channel displays the 10MHz from the GPS module, see 2.png. The jitter is the same in 1PPS and in 10MHz. I'm not sure if your GPS module can output 10MHz on the PPS though, Ublox can. Of course, both, the GPSDO and the GPS module under test, must be locked, otherwise they will drift.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on November 09, 2020, 11:15:41 am
Quote from: Miti
The jitter is the same in 1PPS and in 10MHz.

Are you sure about that? 10MHz is not an exact division of the u-blox clock frequency, doesn't that introduce additional jitter?

Mike
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on November 09, 2020, 11:18:04 am
Quote from: Miti
The jitter is the same in 1PPS and in 10MHz.

Are you sure about that? 10MHz is not an exact division of the u-blox clock frequency, doesn't that introduce additional jitter?

Mike

Lots of that, yes. But of course you can use the 10MHz as a reference input to a PLL to clean up the jitter.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti on November 09, 2020, 11:48:09 am
Quote from: Miti
The jitter is the same in 1PPS and in 10MHz.

Are you sure about that? 10MHz is not an exact division of the u-blox clock frequency, doesn't that introduce additional jitter?

Mike

If your reference is a stable, in phase, GPSDO 10MHz, you don’t see that jitter, which is basically a pulse of a significantly  different length every now and then. Or if you’re unlucky and your scope triggers exactly when that pulse happens, you’ll always see it (I guess, to be validated) but the edge jitter that we’re talking about is the same. See my scope screen shot or try it yourself.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: cncjerry on November 09, 2020, 06:54:17 pm
I spent a lot of time with this circuit as well as another that changed out Lars' simple DAC for a two stage DAC system and used a TDC7200 for the TIC.  But prior to going that route, I had a number of issues that were pretty basic.  Your mileage may vary.

1) Make sure your PPS isn't overdriving the 4046.  If it is, and probably will be, use a simple voltage divider or variable resistor to bring it down below the 5V (if using 5V logic) and then use a 100 ohm resistor to help reduce the ringing.  There is usually a big spike on the 1PPS signals a that slew from zero to 5V pretty quickly.  That helped a lot for me.

2) Same thing with your 10Mhz input.  Square it up if needed using a two-transistor or other circuit from Wentzel.  Go here https://wenzel.com/library/ (https://wenzel.com/library/) and search for squaring circuits.  I've always used the two-transistor as it was called.  You can also look at the TAPR TADD or TADD-2 or TADDD-2, can't remember all the 'D's in it, ha, input schematic.  Again. make sure it isn't under or overdriving your logic. This is on the return signal coming from the oscillator.

3) On circuits like Lars that use saw-tooth correction, again, make sure you have the logic levels correctly in phase and aren't overdriving the Arduino.  I had to use a voltage divider again.

4) Breadboards that have been used a few times start to loosen-up.  After a lot of prompting, I changed most of my little colored jumpers to single strande, tinned, 20 gauge wire.  I then doubled-up the key connections.  This took a lot of little jumps out.

5) One of the tests it to put it in hold so that initially the TIC is counting around 400 and then watch the output.  It should smoothly go or or down with the tic_max and tic_min close to tic_average.  ( I think Lars exposes these fields).  You can see the jumps caused by poor PPS conditioning, poor Oscillator return, etc pretty easily.  Bang on the table a little to see if it jumps.  Better yet, if you don't have a PCB, get a few of the solder-type breadboards from Amazon, EBay, Ali, etc and use them.  I think Lars circuit costs less than $20 so if you solder it up and need to throw it away a few times, so what. It's easier than fighting breadboard noise and ground loops.

6) If still using a breadboard, take a 20gauge wire, strip it off and slip it down the center channel.  Then mark where you need grounds, solder little wires to it, pull the chips, put the wire in the channel and use that as a single point of ground. 

7) Alternatively, take a piece of PCB stock and pull the stickum off the bottom of the breadboard on the ground channels.  Mark and solder the channels to the PCB.  You might need to put little solder bumps on the PCB to lift the channels up so you can keep the stickum on the rest of the breadboard.  You can do this for the ground runs from the bus lines as well.  Then put the breadboard back onto the channels for the rest of the circuitry.  You can also do this with a solder type board.   The large ground plane will help while maintaining flexibility.

8) Use a good oscillator or it really isn't going to work well.  Something that floats  all over the place is just never going to do much for you.  The GPS and TC can only do so much.  I used an HP 10811 and X72 Rubidium successfully and it took just a few hours to get the first lock and then a couple of weeks to keep it locked.   

9) You need bypass caps everywhere.  Especially diagonally across the 4046, HC390 and any other chips. The diagonal was a great idea from a friend.

10) back to the oscillator return.  Use an isolation transformer like an MCL T1-6T.  You don't ground the input side to anything.  You can bend the pins on one side and stick it down in a breadboad (if using one).  Make sure the input ground isn't grounding to the rest of the circuitry.

11) Power supply.  I had one for the GPS, another for the oscillator, another from the PC USB driving the Arduino, etc.  This is a bad idea and I had ground loops all over the place.  Some GPS have a 5v output but you need to minimize the number of supplies.  The isolation transformer helps with the oscillator because you need a ground to the EFC and if you have a long wire coming back from the oscillator output, that can cause a ground loop.

12) Wrap the oscillator in styrofoam to keep air currents from causing sudden shifts.

Hope it helps.

Jerry
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: bingo600 on November 09, 2020, 07:35:33 pm

https://wenzel.com/library/time-frequency-articles/waveform-conversion-part-i-sine-to-square/
(https://wenzel.com/wp-content/uploads/diffsqr.gif)

/Bingo
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Johnny B Good on November 09, 2020, 10:09:13 pm
 Some sine wave OCXOs produce a distorted (and jittery) output if you don't terminate them right across the output and ground pins with a resistor that approximates to their output impedance as I eventually discovered with a set of CQE 10MHz OCXOs (DOC1478 - exactly the same as used by Symmetricom).

 I'd previously run a very basic impedance test on the 6 spare ones I had to hand and 'measured' Zo values ranging from a low of 74 to a high of 90 ohms. I compromised and soldered a 100 ohm resistor across the output pins which cured the peculiar jitter on the output of the 74HC14 Schmidt trigger gates I'd not been able to eliminate by adjustment of the 5K bias trimpot feeding the input via a 33K ohm resistor.

 Once I'd added the 100 ohm terminating resistance, I was able to get a jitter free 1:1 ratio square wave to feed the divide by 100 stage feeding the PLL and the buffer circuit driving the LPF feed to the 10MHz out BNC socket.

 I'd only noticed this 'distorted sine wave' output from the OCXO itself when I probed it with my DSO. I'd checked it and its siblings early on and hadn't noticed this issue the first time round (AFAICR, they'd all looked like perfect sine wave outputs) but when I retested the rest of my "Fleet", they all showed the same effect. I can only assume I must have had some sort of resistive loading in circuit the first time round. :palm:

 Coincidentally, I'm testing the Vref voltages on my spares right now to pick a replacement for the one in my updated James Miller version GPSDO after seeing the EFC voltage wandering up and down between a low of 2.282 and a high of 2,287 volts over the past week or two with an unexpected excursion to 2.288 volts and a sudden plummet to 2.243 after drumming my fingers on top of the GPSDO just prior to inverting it to apply the full 2G tipover treatment. The output shifted some 2 or 3 cycle's worth against my RFS before the PLL output caught up and restored stability, eventually settling at 2.2865v where it had been hovering about +/- 0.5mV an hour or so earlier.

 Despite it responding as expected to the next 2GT effect test with no weird response to my finger drumming vibration test, I've decided to change it out since its ageing trend has been so dominated by these up and down excursions, it's been impossible to determine whether it is following an ageing trend of any sort.

 The 13MHz CQE OCXO I'd used in my MK I had exhibited a positive EFC aging trend of around 1mV per week within the power off/power on induced retrace events where the EFC would slowly drop to a mV or two below the previous high tide value before getting back on track and resume its upward trend a day or two later.

 Although I'm mindful of the possibility of it being an intermittent fault elsewhere, I'll go after the most likely culprit and swap out the OCXO first before trying to prove the existence of an intermittent fault that may or may not actually be present. It's not the easiest of components to swap out but I have to start somewhere. :(

John
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on November 09, 2020, 10:42:38 pm
Some sine wave OCXOs produce a distorted (and jittery) output if you don't terminate them right across the output and ground pins with a resistor that approximates to their output impedance as I eventually discovered with a set of CQE 10MHz OCXOs (DOC1478 - exactly the same as used by Symmetricom).

 I'd previously run a very basic impedance test on the 6 spare ones I had to hand and 'measured' Zo values ranging from a low of 74 to a high of 90 ohms. I compromised and soldered a 100 ohm resistor across the output pins which cured the peculiar jitter on the output of the 74HC14 Schmidt trigger gates I'd not been able to eliminate by adjustment of the 5K bias trimpot feeding the input via a 33K ohm resistor.

 Once I'd added the 100 ohm terminating resistance, I was able to get a jitter free 1:1 ratio square wave to feed the divide by 100 stage feeding the PLL and the buffer circuit driving the LPF feed to the 10MHz out BNC socket.

 I'd only noticed this 'distorted sine wave' output from the OCXO itself when I probed it with my DSO. I'd checked it and its siblings early on and hadn't noticed this issue the first time round (AFAICR, they'd all looked like perfect sine wave outputs) but when I retested the rest of my "Fleet", they all showed the same effect. I can only assume I must have had some sort of resistive loading in circuit the first time round. :palm:

 Coincidentally, I'm testing the Vref voltages on my spares right now to pick a replacement for the one in my updated James Miller version GPSDO after seeing the EFC voltage wandering up and down between a low of 2.282 and a high of 2,287 volts over the past week or two with an unexpected excursion to 2.288 volts and a sudden plummet to 2.243 after drumming my fingers on top of the GPSDO just prior to inverting it to apply the full 2G tipover treatment. The output shifted some 2 or 3 cycle's worth against my RFS before the PLL output caught up and restored stability, eventually settling at 2.2865v where it had been hovering about +/- 0.5mV an hour or so earlier.

 Despite it responding as expected to the next 2GT effect test with no weird response to my finger drumming vibration test, I've decided to change it out since its ageing trend has been so dominated by these up and down excursions, it's been impossible to determine whether it is following an ageing trend of any sort.

 The 13MHz CQE OCXO I'd used in my MK I had exhibited a positive EFC aging trend of around 1mV per week within the power off/power on induced retrace events where the EFC would slowly drop to a mV or two below the previous high tide value before getting back on track and resume its upward trend a day or two later.

 Although I'm mindful of the possibility of it being an intermittent fault elsewhere, I'll go after the most likely culprit and swap out the OCXO first before trying to prove the existence of an intermittent fault that may or may not actually be present. It's not the easiest of components to swap out but I have to start somewhere. :(

John

That's very interesting. I've been looking at the output of my GPSDO with my DSO running an FFT, I use a sine wave OCXO (brand new Taitien NA-10M-2503 bought via Digikey) and I generate the 10MHz output by first squaring up the OCXO, then feeding it into a 74AC04 and from there into a low pass filter to get back to a sine wave. I noticed a very, very slight "hump" in the spectrum, at +/- 1.6MHz off of the carrier and down around -95dBc. At first I suspected an amplitude modulation through the power distribution network, but it turned out it came out of the sine-to-square block already, so it was a phase modulation, not AM, in other words jitter.

The OCXO is not terminated properly, its output more or less goes directly into a tank circuit and from there into a biased inverter gate. Now that you mention jitter I'll try adding some termination resistor on the PCB, the OCXO data sheet says the output impedance is 50 Ohms, so that's what I'll add. I'll see if that noisy hump is gone afterwards.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on November 10, 2020, 08:38:51 pm
Gave it a try and soldered a 49.9 Ohm resistor between ground and OCXO output. It did improve the situation somewhat, the phase modulation is attenuated a bit more, it's now almost down in the noise. The output gained a few more harmonics, though, but that is not really a concern.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Miti on November 11, 2020, 03:09:08 am
Well, I was partially wrong about how the 10MHz is generated in the Ublox modules but I think the statement that the jitter is independent of the output frequency, is valid, but please correct me if I'm wrong. The 10MHz is made of three types of pulses, all multiple of the 20.833ns, the period of the 48MHz internal clock of the module. One is 5 x 20.833ns with a duty cycle of 60%, a 5 x 20.833ns with a duty cycle of 20% and one with 4 x 20.833ns with a duty cycle of 50%, at least that's what I see on the scope. These must be combined in such a way that in the end, there are 10 million pulses in a second. So since the source of the jitter is the same for the PPS and for the 10MHz, the jitter of the rising or falling edge must be the period of the 48MHz clock. Is my logic correct?
Also, 1MHz and 100KHz seem to follow the same logic, the jitter seems to be the same. In my case it is about 22ns, probably the signal level is not ideal.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: cncjerry on November 11, 2020, 07:11:39 am
Some ocxos cant drive 50 ohms directly; some require it.  Good example is my HP 10811.  It likes a 50 ohm load.  I get a larger signal with a high impedance load but the signal is cleaner with 50ohms.

Check your DSO setting If you see a large change when probing to make sure you dont have it in 50ohm mode with a high impedance probe on it. 

Something else to consider.  If you are using an oscillator that has 1PPS output in addition to 10Mhz, some Rubidiums are like that, make sure it is divided down from the oscillator if you plan to use it in timing, as it will be more stable, generally.  At least that is my findings.  I tested my X72 PPS output vs the 10Mhz divided down with a wentzel two transistor followed by a PICDIV chip. So if you plan to provide 1PPS output from your GPSDO package, I suggest you divide it down from the disciplined oscillator like that.  Or provide both.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on November 11, 2020, 07:30:04 am
Some ocxos cant drive 50 ohms directly; some require it.  Good example is my HP 10811.  It likes a 50 ohm load.  I get a larger signal with a high impedance load but the signal is cleaner with 50ohms.

Check your DSO setting If you see a large change when probing to make sure you dont have it in 50ohm mode with a high impedance probe on it. 

Something else to consider.  If you are using an oscillator that has 1PPS output in addition to 10Mhz, some Rubidiums are like that, make sure it is divided down from the oscillator if you plan to use it in timing, as it will be more stable, generally.  At least that is my findings.  I tested my X72 PPS output vs the 10Mhz divided down with a wentzel two transistor followed by a PICDIV chip. So if you plan to provide 1PPS output from your GPSDO package, I suggest you divide it down from the disciplined oscillator like that.  Or provide both.

50 Ohm for this particular OCXO might be a bit too harsh, though the data sheet says the output impedance is 50 Ohms, the signal quality definitely isn't great. The data sheet specifies the 3rd harmonic with < 30dBc, it still keeps this spec, but that's not very demanding.

Regarding the 1PPS output: not enough to just divide down the 10MHz, you also need to align the pulse to UTC top-of-second.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on November 11, 2020, 09:51:35 pm
Same thing with your 10Mhz input.  Square it up if needed using a two-transistor or other circuit from Wentzel.

For those who like to experiment, here are a couple more ways to do it:

http://www.ko4bb.com/getsimple/index.php?id=clock-shaping (http://www.ko4bb.com/getsimple/index.php?id=clock-shaping)

Mike
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Johnny B Good on November 12, 2020, 09:24:01 pm
Gave it a try and soldered a 49.9 Ohm resistor between ground and OCXO output. It did improve the situation somewhat, the phase modulation is attenuated a bit more, it's now almost down in the noise. The output gained a few more harmonics, though, but that is not really a concern.

 I'm glad to hear my observation regarding the need to terminate some types of OCXO came in useful for you. :)

 From my own experiments with frequency injection locking with my collection of CQE 10MHz OCXOs, I'm guessing that most of these sine wave output types are unbuffered, presumably to keep phase noise performance as high as the end user can achieve with careful design of the circuitry it will be driving into. Appealing to the OCXO manufacturer on the basis of "It's not our problem chum, it's yours! (to deal with as you see fit)".

 Trying to figure out the best route to inject my reference frequency into these OCXOs eventually proved to be via the output pin rather than via the Vref or EFC pins (I had even considered the Vcc pin) in the hope that sufficient energy would 'pollute' the oscillator circuit in order to obtain a result that's often all too easy to achieve by accident of bad circuit layout. ::)

 In my case, I suspect the absence of the expected loading had caused the oscillator to overdrive itself into saturation and recover every other cycle, hence the distinct 2ns jitter on the edges before and after the triggered edge (and every alternate edge before and after).

 I never did ever track down any datasheets for any of the CQE OCXOs, hence my playing safe with my very first 13MHz cmos square wave acquisition by powering it off a 5 volt rail on the off chance of it being a 5 volt only part that would otherwise emit its magic smoke when subjected to a 12v rail. When I purchase my first three of the 10MHz units of the seven in total I landed up buying, I felt I could afford to risk a fiver's worth of OCXO on a 12v test.

 Although the original 13MHz unit looked physically identical (and drew the same 280mA initial warm up current which for the 12v 10MHz units remained the same regardless of whether they were being powered from a 5 or 12v rail), I decided to stick with a 5v setup in the very first (MK I) GPSDO just to keep to a single power rail and prove I could create a 10MHz GPSDO using a 13MHz OCXO 'just because I could'.

 Anyway, the upshot of all that being that I can only guess that the recommended loading impedance, despite my basic output impedance testing showing a range from 74 to 90 ohms for the 10MHz units, is likely to have been the classic 50 ohm figure. The output of a signal source in a unidirectional system is more or less irrelevant with regard to matching a load provided the load matches whatever the chosen impedance of its connecting length of transmission line happens to be.

 In the absence of any meaningful length of transmission line, the choice tends to be a little more arbitrary and since the "transmission line" in my case consisted of 15mm or so of a wire link, largely comprised of a 1nF capacitor and 150 ohm resistor in series, I compromised by using a 100 ohm resistor directly across the output pins in order not to bog down the 1.5v pk-pk sine wave output feeding the input of a 74HC14 inverter driving the 74HC390 and another inverter driving the remaining 4 inverters feeding the 10MHz LPF through 150 ohm resistors.

 They were all dc coupled so I could use the one bias trimpot to optimise the effective switching threshold for the 10MHz output buffer stage which was ac coupled to the LPF. I'd added an extra 1.6uH 10MHz peaking inductor across the middle cap in the classic 5 element Butterworth LPF which also neatly ties the filter to the ground reference point.

 BTW, I did swap the OCXO out that evening and had it up and running for initial tests after checking the 'other usual suspects' I'd had in mind as possible contenders for the sudden EFC transient and 3% phase shift in the PLL's 100KHz input that I'd provoked with my finger tapping test.

 However, after letting the EFC voltage settle to its new value of 2.4210, I did another finger tapping test and got an unpleasant surprise as it suddenly shifted half a cycle or so at 10MHz before stabilising. It hasn't responded to the many vibration tests  over the past two days since, so I suspect I may simply have relieved some pent up stress in the "Stress Compensated Cut" crystal inside my "NOS" OCXO. I guess only time will tell but apart from that little 'surprise', it seems to be behaving itself just fine.

 The EFC has dropped another 8mV and I'm expecting it to come to a halt and start going up again based on my previous experience with the 13MHz unit. I'm assuming that the 13MHz unit's retrace behaviour is typical - it may well not be. I'm just going to have to keep my eye on the EFC voltage (as I normally do) for the next few days and see what happens before I start running any power cycle tests.

John
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Johnny B Good on November 18, 2020, 05:32:24 pm
 Just a quick update on my OCXO swap out "repair".

 In the intervening 6 days since my previous post, the EFC has dropped by another 3mV with still no sign of it "bottoming out". It's now hovering around the 2.4097 to 2.4100 volt mark. The reducing EFC trend has slowed down but there is still no sign of any reversal as I'd experienced with the 13MHz "Five Volt" OCXO (which btw, did well and truly prove itself to be a 12 volt unit after all!).

 I could simply be observing an upward frequency ageing effect (reducing EFC voltage) that will continue unabated, albeit one that gets slower and slower over time. Also worth noting is that thus far, I've not been able to provoke any more frequency jumps with my finger tapping vibration tests - so far, so good (until it isn't). ::)

John
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: MIS42N on November 19, 2020, 10:42:59 pm
I wished I'd looked at this forum some years ago. I have designed a low cost GPSDO, really to see just how basic a functional system can be. The cost of the prototype was less than $20 AU (excluding power supply - from the bit box). I use a different approach to most designs, basically (1) the microprocessor uses the oscillator output as its clock (2) the output PWM providing the control voltage is dithered (mark/space ratio varied by 1 bit) every 250uS which, averaged over less than a second gives equivalent of 24 bit DAC (3) correction to the control voltage is calculated and applied at intervals, small deviations of the input 1ppS have no effect. The results of the prototype are modest, to be expected as it is a very basic circuit making no attempt at refinement. However the software is written to be dynamic and my next prototype will try to use the same software in a more sophisticated circuit to prove the point. Software is written in PIC assembler, not sure if it could be done any other way but my bent is writing software. The averaging algorithm uses 32 bit signed arithmetic to calculate a linear least squares fit of the 1ppS information to derive an average. The minimum averaging period is 5 seconds, the maximum is 2048. Correction is applied if the average deviation exceeds a dynamic limit (the more measurements made, the more reliable the average becomes. It is actually beneficial to work with a GPS having some jitter!)

The actual performance varies between about 3 x 10^9 frequency deviation to 3 x 10^10. There are a number of factors - (1) poor viewing - the GPS doesn't see much of the sky (2) the power supply is a switch mode 5V supply of unknown quality, originally powering a superseded piece of equipment (3) the oscillator was chosen on price rather than performance. The next prototype will address all of these - (1) using an external antenna to acquire a better signal (2) control voltage to be derived from a MAX6350CPA+ Voltage Reference (3) oscillator to be a Morion MV89. Items on order at the moment.

I've attached the circuit. It omits the 5V supply and 2 bypass capacitors. The actual circuit has the 3 active components, power supply, 6 capacitors, 4 resistors, 1 LED. Can it be simpler than that?
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on November 20, 2020, 11:42:47 am
I'm confused and need some advice please  :-//.

I have aged my "new old stock" Vectron OCXO for 2 months, improved the location of my outdoor GPS antenna and surveyed-in the accuracy of my NEO-M8T to 0.75 metres.

Now I'm trying different time constants for the GPSDO and when I plot the MDEVs they appear to be upside down compared to what I've seen on here. The stability is gradually getting worse.

Here's one such plot, together with graphs from the log. Time is measured in seconds from when it acquired lock.

Any suggestions please?

Mike

Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on November 20, 2020, 11:53:32 am
There are a number of factors - (1) poor viewing - the GPS doesn't see much of the sky

This is crucial, as I discovered. I bought an NEO-M8T timing receiver thinking I would get a stable 1pps with my active antenna on the house wall under the eaves. It was facing north and could see less than half the sky, but I thought having 12 good satellite signals would be OK - wrong! The best positional accuracy I could get was 8 metres and the M8T requires 1 metre or better for a stable timing signal.

I extended the mounting bracket to give the antenna an overhead view of the sky and the difference was dramatic. It didn't bring in many more satellites but the accuracy improved to 0.75 metres.

Here are pictures of the before and after antenna mounts.

Mike

 
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: thinkfat on November 20, 2020, 01:01:34 pm
I'm confused and need some advice please  :-//.

I have aged my "new old stock" Vectron OCXO for 2 months, improved the location of my outdoor GPS antenna and surveyed-in the accuracy of my NEO-M8T to 0.75 metres.

Now I'm trying different time constants for the GPSDO and when I plot the MDEVs they appear to be upside down compared to what I've seen on here. The stability is gradually getting worse.

Here's one such plot, together with graphs from the log. Time is measured in seconds from when it acquired lock.

Any suggestions please?

Mike

There's still a fair amount of drift visible in the DAC data. The MDEV result reflects that. Your TIC data looks good, though. Nothing to worry about.

You have roughly one day of data in your logs (close to 80,000s ?)  What you see might be a diurnal effect due to temperature changes. Plot the temperature data alongside and see if there's a correlation.

Apart from that, let me repeat: the DAC data tells you a lot about your overall system, and only very little about your output stability and accuracy.

The only independent reference you have is the GPS, so plot the TIC data instead, properly scaled (times 1e-9), imported into TimeLab as phase data. For larger "tau" you'll see it approaching the 1e-13 ranges. You have enough data to see tau=20000. MDEV should approach and maybe cross the 1e-12 line and maybe even get into high 1e-13 territory.

There are a number of factors - (1) poor viewing - the GPS doesn't see much of the sky

This is crucial, as I discovered. I bought an NEO-M8T timing receiver thinking I would get a stable 1pps with my active antenna on the house wall under the eaves. It was facing north and could see less than half the sky, but I thought having 12 good satellite signals would be OK - wrong! The best positional accuracy I could get was 8 metres and the M8T requires 1 metre or better for a stable timing signal.

I extended the mounting bracket to give the antenna an overhead view of the sky and the difference was dramatic. It didn't bring in many more satellites but the accuracy improved to 0.75 metres.

Here are pictures of the before and after antenna mounts.

Mike

 

If you're on the northern hemisphere, an antenna facing north is the worst option. The further north you are, the less satellites you will have available. Find a spot with at least some visibility towards the south. A window facing to the west or east is not too bad in a pinch.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Gerhard_dk4xp on November 20, 2020, 01:13:05 pm

This is crucial, as I discovered. I bought an NEO-M8T timing receiver thinking I would get a stable 1pps with my active antenna on the house wall under the eaves. It was facing north and could see less than half the sky, but I thought having 12 good satellite signals would be OK - wrong!

Free sight to the north does not bring a lot. Looking at the map displayed
by Lady Heather, you see that the sats don't go that far north.

http://www.ke5fx.com/heather/readme.htm (http://www.ke5fx.com/heather/readme.htm)

cheers, Gerhard
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on November 20, 2020, 02:50:15 pm

There's still a fair amount of drift visible in the DAC data. The MDEV result reflects that. Your TIC data looks good, though. Nothing to worry about.

You have roughly one day of data in your logs (close to 80,000s ?)  What you see might be a diurnal effect due to temperature changes. Plot the temperature data alongside and see if there's a correlation.

Apart from that, let me repeat: the DAC data tells you a lot about your overall system, and only very little about your output stability and accuracy.

The only independent reference you have is the GPS, so plot the TIC data instead, properly scaled (times 1e-9), imported into TimeLab as phase data. For larger "tau" you'll see it approaching the 1e-13 ranges. You have enough data to see tau=20000. MDEV should approach and maybe cross the 1e-12 line and maybe even get into high 1e-13 territory.

Thank you, that's just the nudge I needed to make some sense of it  :-+.

Here are the plots you suggested. The GPSDO is enclosed in a box but the OCXO is not insulated yet and I'm not using temperature compensation (understanding that will be another question later on  ;)).

Mike
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Mike99 on November 20, 2020, 02:59:28 pm

Free sight to the north does not bring a lot. Looking at the map displayed
by Lady Heather, you see that the sats don't go that far north.

http://www.ke5fx.com/heather/readme.htm (http://www.ke5fx.com/heather/readme.htm)

cheers, Gerhard

Apologies I suffered from a brain fade. The antenna is facing east.

Mike
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: dl6lr on November 20, 2020, 03:01:13 pm
If you're on the northern hemisphere, an antenna facing north is the worst option. The further north you are, the less satellites you will have available. Find a spot with at least some visibility towards the south. A window facing to the west or east is not too bad in a pinch.

Yeah, this is my coverage, still a test setup and has to be improved with a timing antenna mounted in a better position.
[attach=1]
The satellites dont go much further north, this is 53.7N
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: MIS42N on November 21, 2020, 02:19:03 am
Yes I found the view of the sky is important. This is not my first GPSDO, the previous one had an external antenna, but lived in the garage. If I had to update the software the CPU was pulled out, put in the programmer in the house, then back out to the garage. This one is still being refined but I am using in circuit programming permanently connected to the computer so it is in the house running off an antenna next to a window. Wonderful for rapid development but woeful for stability. I think I've nailed the control system, the refinements are to the "user interface" i.e. what the one LED is doing, and what gets logged via the serial port. I am trying for the most basic system that is still usable. So far the LED does single flash at startup, external oscillator working. Fast flashing at startup, running off internal oscillator because no external oscillator. If on external oscillator will go dead until NEMA messages are being decoded (usually a second or two) then at two second intervals flash the satellites in view. One long flash, none. One short flash, 1-3. Two flashes 4-9, three flashes 10 or more. Once the NEMA messages says the data is valid then the system enters run mode, which is where the current refinement is needed. At present it is a short flash for each valid 1ppS (received and NEMA says valid) but no indication of lock. Getting there.
Title: Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
Post by: Johnny B Good on November 21, 2020, 08:37:52 am
Yes I found the view of the sky is important. This is not my first GPSDO, the previous one had an external antenna, but lived in the garage. If I had to update the software the CPU was pulled out, put in the programmer in the house, then back out to the garage. This one is still being refined but I am using in circuit programming permanently connected to the computer so it is in the house running off an antenna next to a window. Wonderful for rapid development but woeful for stability. I think I've nailed the control system, the refinements are to the "user interface" i.e. what the one LED is doing, and what gets logged via the serial port. I am trying for the most basic system that is still usable. So far the LED does single flash at startup, external oscillator working. Fast flashing at startup, running off internal oscillator because no external oscillator. If on external oscillator will go dead until NEMA messages are being decoded (usually a second or two) then at two second intervals flash the satellites in view. One long flash, none. One short flash, 1-3. Two flashes 4-9, three flashes 10 or more. Once the NEMA messages says the data is valid then the system enters run mode, which is where the current refinement is needed. At present it is a short flash for each valid 1ppS (received and NEMA says valid) but no indication of lock. Getting there.

 An unobstructed all round sky view is very important for getting the best results out of any GPSDO setup. ::)

 The first 5 images, attached below, show a series of u-centre sky maps after upgrading my best M8N fake module to a genuine M8T. The first is the last of a series where I'd followed the perceived wisdom of sticking to just a single constellation (GPS in this case) with the remaining four showing the GPS and Galileo constellations after I'd run tests to compare the discrepancy of the time-pulse arrival times (indirectly in my case) between the GPS and the Russian Glonas (18ns) and then the European Galileo (2 or 3 ns) constellations.

 Whilst the Russian SVs offer an extra 2dB boost over the GPS signal strengths and shrink the hole in the northern sky, the larger discrepancy in the timepulse does seem to compromise the performance of the GPSDO (a modern respin of the James Miller design BTW), the Galileo constellation having more closely aligned time pulse seemed to offer an improvement so I decided to leave it setup that way for a day or two before deciding whether to stick with the perceived wisdom of using only a single constellation for best results or carry on and gain more reliable coverage out of an increased elevation filter mask  angle of 30deg.

 After finally getting the M8T to complete a survey in operation (I'd had to slacken my optimistic 10cm variation setting to 17cm to force it to complete the process), I'd finally been able to prove I could still get valid timing data from just a single SV alone and had initially set the elevation filter mask to 42 deg. However, with just GPS SVs, I could be left with only a single SV above the elevation mask angle setting which was a little worrying since the M8T could land up seeing only a single GPS SV that could quite easily be one marked out of service, hence a loss of 'lock' and my lowering the elevation mask setting to 30deg to avoid such an eventuality.

 Adding the Galileo SVs into the mix considerably reduces the risk of having only out of service SVs above the elevation mask angle setting. Since there doesn't seem to be any degradation of timing stability over that of using only the GPS SVs alone, I've stuck with that configuration ever since.

 One of the main issues with using a navigation centric GPS module like the M8N in a DIY GPSDO (whether it's a "basic" James Miller design or a properly built and configured Lars type) is the subsonic (3mHz or so) 30 to 50ns phase modulation due to the effects of the ionosphere on propagation delay. Switching to the M8T reduced such subsonic phase modulations by around an order of magnitude (a 5 to 7 ns pk to pk phase shift around the nominal 10MHz out