Author Topic: DIY GPSDO project w/ STM32, TDC7200  (Read 42405 times)

Johnny B Good and 2 Guests are viewing this topic.

Offline Miti

  • Super Contributor
  • ***
  • Posts: 1341
  • Country: ca
Re: DIY GPSDO project w/ STM32, TDC7200
« Reply #175 on: February 04, 2020, 12:18:52 pm »
Make R15 49K series with a 5K trimmer. I experimented with this squarer an the DC bias needs to be adjusted for a 50% duty cycle.
Fear does not stop death, it stops life.
 

Offline thinkfatTopic starter

  • Supporter
  • ****
  • Posts: 2154
  • Country: de
  • This is just a hobby I spend too much time on.
    • Matthias' Hackerstübchen
Re: DIY GPSDO project w/ STM32, TDC7200
« Reply #176 on: February 04, 2020, 01:05:39 pm »
I would use the R6=50-100ohm as I recommended in past. And remove R14.

Hm. R14 is to force the input impedance to 50\$\Omega\$, that's what the LPRO expects to see at its output.

I probably misunderstood what R6 in your recommendation was supposed to be: I thought it's the output impedance of the signal source, and since the LPRO has 50\$\Omega\$ there, I replaced it with a bridge.

Make R15 49K series with a 5K trimmer. I experimented with this squarer an the DC bias needs to be adjusted for a 50% duty cycle.

OK, worth a consideration. But wouldn't using a lower impedance for the voltage divider also be effective?
Everybody likes gadgets. Until they try to make them.
 

Offline thinkfatTopic starter

  • Supporter
  • ****
  • Posts: 2154
  • Country: de
  • This is just a hobby I spend too much time on.
    • Matthias' Hackerstübchen
Re: DIY GPSDO project w/ STM32, TDC7200
« Reply #177 on: February 04, 2020, 01:13:17 pm »
PS: the choice of the inductor is important. In ltpsice lib I can see 0805 10uH with 2ohm series and 980ohm parallel eq resistance. That would not work. On the other hand there is a 1210 one with 0.5ohm series and 19k parallel eq. resistance which simulates nice (and it will work fine). With properly tuned LC (and say 1Vpp input) you have to see "almost squared" rail-rail signal at the input of the HC14.

The inductor is a TDK MLF2012E100KT. Datasheet: https://www.tme.eu/Document/7c2ace17599f4cca5c72e8cba8620a08/mlf2012.pdf
Everybody likes gadgets. Until they try to make them.
 

Offline iMo

  • Super Contributor
  • ***
  • Posts: 4897
  • Country: vc
Re: DIY GPSDO project w/ STM32, TDC7200
« Reply #178 on: February 04, 2020, 01:18:12 pm »
The adjusting the R divider with the pot trimmer is not important. It is needed only when your LC tank is low Q and the entire circuit works as a squarer "without LC".  With good LC and tuned your signal at the input of the HC14 is rail-rail with 1Vpp input.
Let R14 there but add the R6=50.
 

Offline thinkfatTopic starter

  • Supporter
  • ****
  • Posts: 2154
  • Country: de
  • This is just a hobby I spend too much time on.
    • Matthias' Hackerstübchen
Re: DIY GPSDO project w/ STM32, TDC7200
« Reply #179 on: February 04, 2020, 09:31:43 pm »
Awright. I think I have to postpone the LC tuning a bit. I'm pretty sure I don't have Q enough in the tank to really drive the signal into a square wave, besides, even with 10 Vpp from the wavegen the input of the inverter doesn't saturate. No input protection diodes? Adding a series resistor (R6=50\$\Omega\$) didn't bring any improvement.

I have a few other loose ends to tie, the new PCB has a temperature sensor now and a small EEPROM which I'll use to store some parameters. So, temperature compensation and persistent storage next.

For the LC tank I'll probably have to prototype it separately. The small-ish PCB doesn't give itself easily to probing and changing components.

PS: it's surprisingly difficult to find a high-Q fixed inductor with sufficiently high SRF. Will I really end up winding enamel wire around a core?
« Last Edit: February 04, 2020, 09:34:40 pm by thinkfat »
Everybody likes gadgets. Until they try to make them.
 

Offline iMo

  • Super Contributor
  • ***
  • Posts: 4897
  • Country: vc
Re: DIY GPSDO project w/ STM32, TDC7200
« Reply #180 on: February 04, 2020, 09:58:10 pm »
With the worst inductor I've found and your 10Vpp input signal, and both R6 and R14 populated (the diodes do simulate the input clamping diodes of the HC14) you should see pretty saturated input of the HC14.
PS: be careful with large powers into the input - with 10Vpp input the currents via those diodes are 5-10mA p-p based on the quality of L.
« Last Edit: February 04, 2020, 10:08:41 pm by imo »
 

Offline thinkfatTopic starter

  • Supporter
  • ****
  • Posts: 2154
  • Country: de
  • This is just a hobby I spend too much time on.
    • Matthias' Hackerstübchen
Re: DIY GPSDO project w/ STM32, TDC7200
« Reply #181 on: February 04, 2020, 10:27:35 pm »
With the worst inductor I've found and your 10Vpp input signal, and both R6 and R14 populated (the diodes do simulate the input clamping diodes of the HC14) you should see pretty saturated input of the HC14.
PS: be careful with large powers into the input - with 10Vpp input the currents via those diodes are 5-10mA p-p based on the quality of L.

Yep, I should, yet, I don't. No clamping action, even though the voltage is high enough for sure. It definitely exceeds Vdd. For now, postponed.

This is the inverter: https://www.tme.eu/Document/7b82005d5898e252126b82e3df8b07b1/NC7SZ04M5-DTE.pdf

No Schmitt trigger input, btw. Shouldn't matter.
Everybody likes gadgets. Until they try to make them.
 

Offline iMo

  • Super Contributor
  • ***
  • Posts: 4897
  • Country: vc
Re: DIY GPSDO project w/ STM32, TDC7200
« Reply #182 on: February 04, 2020, 10:34:41 pm »
What is DC voltage at the 04 input (no signal at input)?
Are your resistors of the right value?
Isn't your input capacitor shorted?
 

Offline thinkfatTopic starter

  • Supporter
  • ****
  • Posts: 2154
  • Country: de
  • This is just a hobby I spend too much time on.
    • Matthias' Hackerstübchen
Re: DIY GPSDO project w/ STM32, TDC7200
« Reply #183 on: February 04, 2020, 10:47:54 pm »
What is DC voltage at the 04 input (no signal at input)?
Are your resistors of the right value?
Isn't your input capacitor shorted?

Input voltage is 1.6V. Resistors check out OK, too. The input cap - I'll have another look. Might also play with C35. Maybe I'm just not hitting the resonance.

PS: still not getting why R6 should be there and 50\$\Omega\$. I checked the values with a RLC filter calculator (http://sim.okawa-denshi.jp/en/RLCtool.php), all R6 does is limit Q to about 12.
« Last Edit: February 04, 2020, 10:55:54 pm by thinkfat »
Everybody likes gadgets. Until they try to make them.
 

Offline iMo

  • Super Contributor
  • ***
  • Posts: 4897
  • Country: vc
Re: DIY GPSDO project w/ STM32, TDC7200
« Reply #184 on: February 04, 2020, 10:56:23 pm »
Also the mid of the resistor divider (creating those 1.65V DC) must be AC blocked (the 100nF capacitor) to GND. Otherwise the LC tank will not work.
 

Offline thinkfatTopic starter

  • Supporter
  • ****
  • Posts: 2154
  • Country: de
  • This is just a hobby I spend too much time on.
    • Matthias' Hackerstübchen
Re: DIY GPSDO project w/ STM32, TDC7200
« Reply #185 on: February 06, 2020, 10:00:49 pm »
No LT-Spice here on Linux, but KiCAD has a bridge to "ngspice". I've collected a model for an HC04 inverter, added two 1N4148 (model from Diodes Inc.) for input clamping and made up an inductor model from manufacturer data (TDK supplies all necessary values).

I agree, it should work. I don't see a strong influence of the series resistor, though (R6 in my schematic). It just limits Q of the tank. Best result (highest gain) with R6=0 Ohm. Spice library and netlist attached.

PS: I'm wondering if the 100nF AC block (C33 in my schematic) should better be something with a higher Q. I might replace it with a 1nF C0G/NP0.
« Last Edit: February 07, 2020, 09:41:56 am by thinkfat »
Everybody likes gadgets. Until they try to make them.
 

Offline iMo

  • Super Contributor
  • ***
  • Posts: 4897
  • Country: vc
Re: DIY GPSDO project w/ STM32, TDC7200
« Reply #186 on: February 09, 2020, 11:14:37 am »
A variant with an old school RF transformer. Good for galvanic decoupling of the source.
PS: an off the shelf "10.7MHz IF transformer" could be a good candidate in this case.
« Last Edit: February 09, 2020, 11:28:21 am by imo »
 
The following users thanked this post: Jacon, thinkfat

Offline thinkfatTopic starter

  • Supporter
  • ****
  • Posts: 2154
  • Country: de
  • This is just a hobby I spend too much time on.
    • Matthias' Hackerstübchen
Re: DIY GPSDO project w/ STM32, TDC7200
« Reply #187 on: February 09, 2020, 12:10:30 pm »
Thanks. Could you provide a Bode plot from 1MHz to 100MHz?
Everybody likes gadgets. Until they try to make them.
 

Offline iMo

  • Super Contributor
  • ***
  • Posts: 4897
  • Country: vc
Re: DIY GPSDO project w/ STM32, TDC7200
« Reply #188 on: February 09, 2020, 12:15:23 pm »
AC sweep.
PS: the L1 L2 C1 values are shown as an example, it could be a different value such it tunes at 10MHz (I would not go below 10uH).
Another option is a small Amidon Red toroid - ie. T30-2, 10uH=48t, 0.05uH=3t.
« Last Edit: February 09, 2020, 02:13:23 pm by imo »
 

Offline thinkfatTopic starter

  • Supporter
  • ****
  • Posts: 2154
  • Country: de
  • This is just a hobby I spend too much time on.
    • Matthias' Hackerstübchen
Re: DIY GPSDO project w/ STM32, TDC7200
« Reply #189 on: February 10, 2020, 04:41:45 pm »
I've been playing with the GPSDO simulator from LeapSecond.com. I'm lacking the oscillator data for a typical rubidium frequency standard, though.

Of course I can always "fake" it by assuming a "no drift, no jitter" oscillator, but that's probably not realistic enough?

The GPS data set is 400000 seconds long, so I though about creating an oscillator file that would just simulate the drift over 400000 seconds, like with the following matlab script:
Code: [Select]
for i=0:400000-1;
    osc(i+1) = (i/400000-1)**2 * -1e-13;
end

This would describe an oscillator that drifts -1e-13 Hz over 400000 seconds, on a quadratic slope. I don't know if that'd be close enough, but probably better than just assuming zero drift and jitter.

PS: got a data file from Tom van Baak (Leapsecond.com) from a PRS10. Should be fine to get me going.
« Last Edit: February 11, 2020, 08:11:17 am by thinkfat »
Everybody likes gadgets. Until they try to make them.
 

Offline thinkfatTopic starter

  • Supporter
  • ****
  • Posts: 2154
  • Country: de
  • This is just a hobby I spend too much time on.
    • Matthias' Hackerstübchen
Re: DIY GPSDO project w/ STM32, TDC7200
« Reply #190 on: February 15, 2020, 02:07:40 pm »
I'm often hearing about using a Kalman filter for a GPSDO, and while I can see a merit with GPS positioning and navigation, I can't quite see how it would be useful for a GPSDO. What's the general idea here? For a Kalman filter, you need a prediction model and multiple, preferably independent data sources.

For example, in positioning, the GPS computes a position, a velocity and a direction independently. Velocity and direction can be used to predict the next position, improving precision.

I don't quite see how this would work for a GPSDO, where my only input is the phase measurement. How would the prediction model look like? The only idea I have there is using the output of the control loop to predict the next TIC measurement.
Everybody likes gadgets. Until they try to make them.
 

Offline Theboel

  • Frequent Contributor
  • **
  • Posts: 278
  • Country: id
Re: DIY GPSDO project w/ STM32, TDC7200
« Reply #191 on: February 15, 2020, 03:38:03 pm »
 
The following users thanked this post: thinkfat

Offline thinkfatTopic starter

  • Supporter
  • ****
  • Posts: 2154
  • Country: de
  • This is just a hobby I spend too much time on.
    • Matthias' Hackerstübchen
Re: DIY GPSDO project w/ STM32, TDC7200
« Reply #192 on: February 16, 2020, 10:52:52 am »
Hi Mikael,

try this link :
https://slideplayer.com/slide/4128211/

OK, I understand better now: The input is not just the TIC measurements. The Kalman filter could also integrate other important factors, like frequency drift over time (aka aging) and other environmental effects as far as can be measured (temperature, for example, but also stuff like air pressure which significantly affects Rb oscillators). I'll need some time to grok that. If anyone has a practical example he could share, I'd appreciate it.

While experimenting with the platform I found a couple of key factors for good performance:
  • Keeping thermal equilibrium is most important. Temperature changes cause major disturbance. Probably not in the Rb oscillator itself, but the TIC measurements are affected by the temperature and also the DAC and the OpAmp have a temperature dependency which needs to be modeled for compensation. I'm currently trying to figure these out, but it's not really that easy without a stable reference to compare against. I know that I have about -1ns/K on the TIC measurement but to which part it is the TIC or DAC and OpAmp is not quite clear. I'll have to dig out the data sheets to get a ballpark figure for those.
  • GPS configuration: Don't use SBAS, don't enable multiple constellations. Both impact the stability of the 1PPS from the GPS negatively.
« Last Edit: February 16, 2020, 10:56:22 am by thinkfat »
Everybody likes gadgets. Until they try to make them.
 

Offline thinkfatTopic starter

  • Supporter
  • ****
  • Posts: 2154
  • Country: de
  • This is just a hobby I spend too much time on.
    • Matthias' Hackerstübchen
Re: DIY GPSDO project w/ STM32, TDC7200
« Reply #193 on: February 20, 2020, 05:50:06 pm »
Sneak peek: Beaglebone Black version of the GPSDO. Almost done!
935072-0
« Last Edit: February 20, 2020, 08:11:11 pm by thinkfat »
Everybody likes gadgets. Until they try to make them.
 

Offline texaspyro

  • Super Contributor
  • ***
  • Posts: 1407
Re: DIY GPSDO project w/ STM32, TDC7200
« Reply #194 on: February 21, 2020, 01:12:14 am »
Sneak peek: Beaglebone Black version of the GPSDO. Almost done!

Put some SMA connector footprints for EFC and OSC under the OCXO.  Makes it easy to connect/test different OCXOs.
 

Offline thinkfatTopic starter

  • Supporter
  • ****
  • Posts: 2154
  • Country: de
  • This is just a hobby I spend too much time on.
    • Matthias' Hackerstübchen
Re: DIY GPSDO project w/ STM32, TDC7200
« Reply #195 on: February 21, 2020, 09:56:01 am »
Sneak peek: Beaglebone Black version of the GPSDO. Almost done!

Put some SMA connector footprints for EFC and OSC under the OCXO.  Makes it easy to connect/test different OCXOs.

Done, good idea!

PS: PCBs launched!
« Last Edit: February 21, 2020, 07:45:55 pm by thinkfat »
Everybody likes gadgets. Until they try to make them.
 

Offline thinkfatTopic starter

  • Supporter
  • ****
  • Posts: 2154
  • Country: de
  • This is just a hobby I spend too much time on.
    • Matthias' Hackerstübchen
Re: DIY GPSDO project w/ STM32, TDC7200
« Reply #196 on: February 24, 2020, 04:20:52 pm »
While waiting for the TAPR TICC to be delivered and the various PCBs to arrive, I decided picking up the GPS simulator from Leapsecond.com again.

I reimplemented the simulation engine in Octave to have an integrated solution and tweaked it so that it matches my own STM32 code so that the parameters and results can be shared and compared between the simulator and the real hardware. Also, I'll use it as an experimentation platform for Kalman filtering.

Here's some interesting results from the simulator.

TIC filtering:
937574-0
Red: short timeconstant (40s)
Blue: long timeconstant (1000s)

Interestingly, with a longer filter constant you don't get a lot of advantage, for tau=300 you get a slightly lower sigma but you pay for it with a significant bulge at tau=3000

Next, PI loop gain:
937578-1
Higher gain gives a quicker decline above tau=2000s, but degrades sigma for tau < 2000s significantly. The red curve is probably optimal.

Next, OCXO vs. RB:
937582-2
Yellow trace is the PRS10 dataset I got from TVB with a PI integrator timeconstant of 2000s, blue is the OCXO dataset from leapsecond.com. Red is the same OCXO with timeconstant 200s.
Everybody likes gadgets. Until they try to make them.
 

Offline AE7OO

  • Regular Contributor
  • *
  • Posts: 65
  • Country: us
Re: DIY GPSDO project w/ STM32, TDC7200
« Reply #197 on: March 14, 2020, 07:01:37 am »
For single gate logics I like the OnSemi(they also have the Fairchild TinyLogics) low gate count devices.

Single inverter MC74VHC1G04 https://www.onsemi.com/products/standard-logic/buffers/mc74vhc1g04
Single inverter MC74VHC1G14  https://www.onsemi.com/products/standard-logic/logic-gates/mc74vhc1g14
Single NAND MC74VHC1G00 https://www.onsemi.com/products/standard-logic/logic-gates/mc74vhc1g00
Single NAND MC74VHC1G132  https://www.onsemi.com/products/standard-logic/logic-gates/mc74vhc1g132

I like the VHC line because they allow up to 5.5VDC input no matter what the actual VCC is.  They are fast, so watch out for the edges, or get a 2G part that has slower edges.

These are all SC-70-5 and/or SOT-23-5 packages, some are even UDFN6, so they are indeed TinyLogic.

Newark was having a sale and I picked up over 200 of the SN74LVC1G80DCKR which is a single flip-flop for 1/10th of a cent each, to join my collection of single gates.   >:D

I especially love the multi-function packages where you can configure it to do what you want.  If you have both a *57 and a *58 that covers almost all logic gates.  A *97 can do even more, but are little larger and more expensive.
 

Offline thinkfatTopic starter

  • Supporter
  • ****
  • Posts: 2154
  • Country: de
  • This is just a hobby I spend too much time on.
    • Matthias' Hackerstübchen
Re: DIY GPSDO project w/ STM32, TDC7200
« Reply #198 on: March 14, 2020, 01:03:50 pm »
Thanks for these references. I have only one single-gate inverter in the input squarer. I might try the MC74VHC1G04, seems like a good fit.
Everybody likes gadgets. Until they try to make them.
 

Offline thinkfatTopic starter

  • Supporter
  • ****
  • Posts: 2154
  • Country: de
  • This is just a hobby I spend too much time on.
    • Matthias' Hackerstübchen
Re: DIY GPSDO project w/ STM32, TDC7200
« Reply #199 on: June 16, 2020, 10:38:34 pm »
Just a quick update on the status of the GPSDO for the Beaglebone Black.
The project is not dead. In fact it is coming along very nicely and has seen a couple of interesting additions.

The most interesting addition is that I'm feeding UTC time and 1PPS timestamps from the GPS into "chrony" (NTP server) to create a stratum-1 time server. I'm also experimenting with PTP so that the device can act as a PTPv2 "Grandmaster" clock.

Picture attached shows the first working prototype.
Everybody likes gadgets. Until they try to make them.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf