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

0 Members and 2 Guests are viewing this topic.

Offline iMo

  • Super Contributor
  • ***
  • Posts: 4670
  • Country: nr
  • It's important to try new things..
Re: Lars DIY GPSDO with Arduino and 1ns resolution TIC
« Reply #50 on: October 03, 2018, 09:17:57 am »
The C1 must be a quality foil capacitor. What type do you use?

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

Offline Miti

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

C1 is a foil capacitor, not sure the exact type, and I do get a pulse between 0 and 1us and if you look at my scope screen shots, if I disconnect the circuit from the uC ADC, the result is as expected. Only when I connect them together I see that DC level, that's what puzzles me.
Fear does not stop death, it stops life.
 

Offline iMo

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

Offline metrologist

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

Thanks again Lars. Hope you are feeling well.
 

Offline 9aplus

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

Offline metrologist

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

Offline larsTopic starter

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

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

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


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

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

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

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

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

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

Another question: You are using a Pro Mini board?

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

Lars

 

Offline larsTopic starter

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

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

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

Lars

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


 

Offline Miti

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

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

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

PS: If I can get it to work properly, with your permission, I intend to design a board. All SMT with Atmel and Ublox on the board. BTW, do you know what settings I need to do to take advantage of the timing features of Ublox NEO-M8T?
« Last Edit: October 04, 2018, 03:47:14 am by Miti »
Fear does not stop death, it stops life.
 

Offline metrologist

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

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

Offline 9aplus

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

Offline metrologist

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

Offline texaspyro

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

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

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

Offline metrologist

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

Offline texaspyro

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

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

 
The following users thanked this post: cdev

Offline Miti

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

I've got LH to work with Lars GPSDO as an extra input device but it keeps resetting the statistics. Every few seconds it flickers and the graph starts from zero again. It doesn't happen if I see only the GPS. Also, I cannot see the ADEV on the graph and I tried /ga.
It doesn't work for me as the main receiver or I don't know how to configure it. What commands do I have to send?
Fear does not stop death, it stops life.
 

Offline texaspyro

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

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

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

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

Offline metrologist

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

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

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

 

Offline Miti

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

@texaspyro

I don't know why but whenever I connect the GPS module to LH SW, its sensitivity is greatly affected to the point where it doesn't get a fix anymore. The sensitivity stays low until I connect with U-Center and do a "Revert to default configuration" when it comes back to life again.
Fear does not stop death, it stops life.
 

Offline metrologist

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

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

So much more to read.  :-+

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

Offline Miti

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

Offline iMo

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

Offline Miti

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

Offline Miti

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

Offline iMo

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


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf