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

0 Members and 1 Guest are viewing this topic.

Offline cdev

  • Super Contributor
  • ***
  • Posts: 3855
  • Country: 00
  • We're glad you made it, welcome to the future!
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #125 on: November 05, 2018, 12:26:41 am »
The NavSpark Mini can be bought in a pack of six for $35 plus a few dollars shipping. They may also still be giving away one free if you pay shipping, So you can get seven for around $40.

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

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

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

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

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

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

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

« Last Edit: November 05, 2018, 12:33:51 am by cdev »
"What the large print giveth, the small print taketh away."
 

Offline PT_Dreamer

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

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

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

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

Thanks,

José
 

Offline imo

  • Frequent Contributor
  • **
  • Posts: 598
  • Country: 00
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #127 on: November 07, 2018, 07:00:38 am »
timer_us = timer_us + 50000 -

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

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

You do modulo 50000 therefore (an example)

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

« Last Edit: November 07, 2018, 07:24:01 am by imo »
 
The following users thanked this post: PT_Dreamer

Offline texaspyro

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

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

Offline PT_Dreamer

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

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

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

You do modulo 50000 therefore (an example)

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

Hi,

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

Offline Satbeginner

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

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

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

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

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

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

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

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

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

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

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

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

To be continued, thanks for now,

Un saludo,

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

Offline Miti

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

Offline cdev

  • Super Contributor
  • ***
  • Posts: 3855
  • Country: 00
  • We're glad you made it, welcome to the future!
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #132 on: November 12, 2018, 12:38:12 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.
"What the large print giveth, the small print taketh away."
 

Offline Miti

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

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

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

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

Offline cdev

  • Super Contributor
  • ***
  • Posts: 3855
  • Country: 00
  • We're glad you made it, welcome to the future!
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #134 on: November 14, 2018, 12:11:13 am »
True position?

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

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

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

It works but its a visual embarrassment.

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

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


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

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

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


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


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


« Last Edit: November 14, 2018, 12:39:17 am by cdev »
"What the large print giveth, the small print taketh away."
 

Offline texaspyro

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

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

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

Offline cdev

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

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

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

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

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

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

Offline texaspyro

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

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

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

 

Offline cdev

  • Super Contributor
  • ***
  • Posts: 3855
  • Country: 00
  • We're glad you made it, welcome to the future!
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #138 on: November 14, 2018, 07:19:53 am »
I suppose a display could be dimmed to extend its life.

My main concern is display and GPSDO longevity.


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

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


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

Offline texaspyro

  • Frequent Contributor
  • **
  • Posts: 926
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #139 on: November 14, 2018, 07:29:24 am »
I suppose a display could be dimmed to extend its life.

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

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

Offline JTDolan

  • Newbie
  • Posts: 2
  • Country: us
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #140 on: November 14, 2018, 07:20:39 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

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


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf