Show by Label

Saturday, July 1, 2023

Building a 10MHz Master Clock

Even though I have a GPSDO, and in the procees to upgrade it, I still would like to build a 10MHz reference clock.

I have a spare Oscilloquartz 8663-XS OCXO that I wanted to use for my GPSDO, but the lack of room on the PCB stopped me in my tracks.

This OCXO is too good to not use, so I embarked on a little side project to put it to good use.

For a very long time, I already collected information from another user that built a frequency reference with that same OCXO, so I borrowed some of his ideas.

Here is the link to that design : https://www.circuitsonline.net/forum/view/126987/1

It's a Dutch forum but I take it you can either follow it, or use Google translate.

There are three areas where I'm going to deviate from that original design. First of all, I'm not going to create a separate power supply for it. The unit will be on 24x7 and I did not want a normal transformer to power the unit. I have a nice 12VDC 1A wall-wart that uses a transformer, so I'm going to use that. The stability and precision of the 12V is not that important for this design.

The other area I'm deviating is by using different output transformers. There was a large effort to create very special hand-made transformers, but I did not want to go that far. I'm going to use the commercially available transformers that I already use for several other projects.

Lastly, I'm not going to use the Oscilloquartz reference voltage to power the frequency setting circuit. It seems the logical thing to do, but this so called reference voltage is anything but a reference voltage. They are typically created by using a zener (reference) diode like the TL431, but that is simply not good enough as you will see.

During my work with the Reciprocal Counter, described in another post, I found to my dismay how poor that reference voltage really is. Have a look at that post and search for the following update: "Testing the counter (11-05-2023)" towards the end.

Here is a display of the vref output that shows what I mean:


This OCXO has been powered for many weeks 24x7 and is in a plastic container isolating it from drafts, but not the room temperature of course. It's easy to see that using the Vref of the OCXO will fall short when you really want a very stable 10MHz, because any variation in the Vref output will show-up as a change in the output frequency.

The Oscilloquartz is currently running while using the following circuit, put together after my "discovery". Here it is using a 10V reference I had in my stash already. This prototype is built on protoboard.



My plan is to use the above frequency setting circuit, but with a REF5050, which is a 5V reference.

Here is the schematic I decided on.



I only need two isolated 10MHz sine wave outputs.

Most of the resistor values are taken from the original design but could possibly change once I start to  test it on the PCB.

My intent is to put the circuit in a metal enclosure, but put all the electronics in an isolated foam box inside the enclosure so the OCXO will warm-up the inside far enough above the maximum room temperature, hopefully reducing the temperature dependencies of the components.

This is a side-project so may not get a lot of attention while I'm working on the GPSDO version 4 and the Reciprocal Counter.

[update July 2023]

I did manage to create a PCB layout.

The two long multi-turn trimmers top left are from my old part stash, even through they date back to the 70's, they are genuine and of good quality. The adjustments of these course and fine trimmers will protrude through the front panel, the same as the two SMA output connectors. The length is 125mm and the width of the board is 99.5mm so it will slide in the typical enclosures I use.





Because PCBWay is sponsoring my PCB's, I'll wait until I have another PCB ready to order, to save on the shipping costs. Maybe that will be the front panel for this instrument.


Stay tuned for more...

Paul


If you like what you see, please support me by buying me a coffee: https://www.buymeacoffee.com/M9ouLVXBdw




Saturday, June 24, 2023

GPSDO Version 4


While trying a few new ideas and test the changes with Version 3, described in another post, and the rather successful results, I started to incorporate everything in a new version 4. This version should be usable as a replacement for my main GPSDO and also to be used for the Reciprocal Counter also described in another post.

The major addition from the past versions for this version is to use a temperature controlled heater system to keep the components at the same temperature because that is the most critical element that influences a GPSDO. You can eliminate the heater section by simply not populating the parts.


What role does the temperature play?

The temperature generated by parts and the temperature inside the enclosure, influenced by the room temperature, change the relationship of the 16-bit "DAC" output values, actually the DUAL 8-bit PWM, that drives the frequency adjustment of the OCXO and therefore the 10MHz output frequency. Because most of us don't have expensive phase-measurement systems, we use the DAC output values as they are reported by the GPSDO script as a poor-men's alternative method in a program called Timelab to be able to generate ADEV and MDEV charts to look at the long term stability and precision of the GPSDO.

The problem is that when the DAC changes due to temperature effects, it is no longer representing the true 10MHz relationship and therefore renders the ADEV chart method as less precise, to put it mildly.

The challenge is to eliminate any temperature related effects on the DAC settings, so the DAC changes are only caused by the 1PPS from the GPS system, and hence create a 1:1 relationship between the two.


What are the circuits that play a temperature related role? First you have the effect of the temperature on several parts, most notably all the parts that are driving the f-adjust pin of the OCXO. This includes the whole dual 16-bit PWM circuitry, and then the Phase Difference TIC "pulse-to-voltage" circuit between the digital 74HC4046 output and the ADC of the Nano. The Nano ADC is referenced by the internal 1.1V supply and this also will be temperature dependent in some way. Keep in mind that temperature has an influence on all the propagation delays (specified at 25 degrees in the data sheets) of the chips involved.

Second you have the ever changing room temperatures that in my case differ through the seasons. Low at night in the winter, and pretty hot in the afternoon in summer. There are users that literally go through a burial process of their GPSDO in a bucket filled with sand and put it in the basement to reduce these effects. I tried my best by using a fan to try to keep the inside temperature constant for my version 1 GPSDO. That works really well, but unfortunately does not work well with the seasonal changes I have. The temperature difference between night time (not heating) in the winter, and warm summer temperatures during the day is too large for the design I made, so I always have to readjust the settings when the seasons change. I also don't like the noise the fan makes when at close to full speed, and I also want to eliminate the electrical noise it introduces so close to the other critical parts.

To reduce the temperature effects a bit, I already switched to using a Mica capacitor used in the Phase-diff circuit. Mica capacitors are very precise and stable and have extremely low temperature effects on the capacitance. Instead of the 1N5711 Schottky diode that Lars recommended, I'm now switching to a BAV199 (2pF) or a BAV99 (1.5pF) type. They are dual diode packages in the SOT23 form. I will only use one diode of course. The 1N5711 diode is a Schottky type and fine by itself, but I have to mount it upright to save space and that makes it more susceptible to drafts inside the enclosure.

Because these parts are in the controlling loop, I hope that the temperature effects of these new parts reduce the overall effects.

Much more temperature critical is the whole dual PWM DAC circuit all the way to the f-control pin of the OCXO. Minute changes due to temperature in the output of the DAC circuit will change the output of the OCXO. This is exactly what we want to avoid.

To eliminate or as a minimum reduce all these temperature effects, you can make the internal enclosure temperature very stable so there are no changes. You can do that if you can raise the temperature inside the enclosure above the normal seasonal maximum and keep it constant by regulation, and insulate the inside from room temperature changes as much as possible so active temperature regulation can do the rest. 

The alternative that is most commonly used is to use parts that are less susceptible to temperature changes. Unfortunately, anything low tempco is very, very expensive.

So the other solution and challenge is to raise the regulated temperature of the components high enough above the summer temperatures, while making sure that enough heat can be generated in the cooler winter period to keep the temperature at the same level during the seasons and without sudden fluctuations.


A heater design example

A friend of mine, Bud, who unlike me is a real designer, came-up with a heater circuit for his voltage reference. These circuits have exactly the same issues and challenges as I described above.

Here is more information about his design and the process he went through.

https://hackaday.io/project/165139-precision-voltage-and-current-reference

I built that circuit for my own voltage reference and have been monitoring the voltage and the temperature for several months now. It works great, so I was planning on using that heater technique for the GPSDO already quite some time ago.  Now is the time to put it to the test.

To heat-up the circuit, Bud uses a string of resistors and regulates the current through them to keep the temperature constant.

Based on his design, I made some small changes so I can incorporate it with the new GPSDO version. 






The nine sets of resistor strings are each current regulated by MOSFET's. The MOSFET's are driven by an Opamp that measures the PCB temperature and regulates against the desired voltage set by a few resistors. The feed-back components of the Opamp provide a "PID" type regulation.


Using the heater design with my GPSDO

Because I want to stay with the 12V supply I already have, I had to recalculate the values for the heating resistors. Because I want to use the already available 4.096V reference supply, I also had to recalculate the values for the temp setting resistors.

The temperature sensor I selected is a device with an output voltage of 10mV/degree C. I want to keep the temperature of the heater at 38 degrees, which is several degrees above the expected maximum temperature in my office, in the summer. The reference voltage is therefore set to 380mV.

During the cold start, the Opamp output will slam into the rail and may have troubles un-hugging again, so the Zener diode should prevent that and also limit the maximum current. With the 12V supply and the 68R resistor values, the total heat produced should be just over 3W. 

I've added a test pin connected to the temp sensor so that the temperature can be monitored by a DMM, and it also goes to the Nano so the GPSDO script can measure and include it in the report.

The heater resistors will be distributed on the bottom side of the PCB and the most critical GPSDO components are located on the top of the PCB above the heater.

Here are the other circuit elements that make-up version 4 of the GPSDO:


I switched back to using the 74HC4046 again, and I also added the ambient temperature sensor that is sitting close to the TIC parts. This allows me to monitor both the heater and the temperature close to the critical components.





This is the largely unchanged dual 8-bit PWM DAC circuit I have been using in the version 3 tests. These parts will sit on the top side of the board, above the heater components.

This is the power rail section. The 12V is used by the heater section and also feeds all voltage regulators.

There is a regulator for the 5V supply and it feeds the Reciprocal Counter, the optional fan and also the OCXO.

There are two other separate 5V supplies for the logic section and for the NEO board. Especially the NEO supply is fluctuating due to the 1PPS pulse and that effect I want to isolate as much as possible.

The 8V supply goes to the Arduino Nano, and I'll let it use it's own 5V regulator to supply the parts on the Nano board itself.


To the right hand side, you see an 8-pin connector. This is the interconnect that will go to the output board. This board is only used for the GPSDO version to provide isolated 10MHZ and 1PPS outputs for other instruments. 

The layout

This is the top side, with the most critical components sitting on top of the heater section. The heater temperature measurement sensor sits also on this side of the board.

Because this board will sit inside an insulated chamber made from foam, it has to be as small as possible to fit. It took me quite some time to get all the parts on the board. Unfortunately, the Oscilloquartz is no longer an option. It's too large, but I already have other plans for that OCXO.





And here is the bottom side (flipped horizontally) with the heater element resistor pads.


This is the most complex layout I've made, with quite a number of parts. It wasn't easy to get everything laid out with a 2-layer board. For this first version, I wanted access to everything so I can measure and make changes by cutting traces. 


How it will fit together.

To keep the heat trapped inside the enclosure, and minimize the effect of room temperature changes, the board needs to be encapsulated by a foam box. The 4 plastic stand-offs mounted in the mounting holes will raise the PCB a cm or so from the bottom insulation.

There are several additional steps I need to make to keep the heat inside and reduce leakage. Much to try and test, so time will tell.

I've ordered some 6mm and 8mm Styrodur foam sheets to be used as the insulation for the inside of the enclosure. I also ordered a special foam cutter that will allow me to cut precise sizes of the foam to reduce heat leaks. The foam cutter works great so I'm more confident that I can get my chamber made without too many leaks.


[Update June 8 2023]
 
The PCB's arrived and I have built one up. I had some problems getting it all to work. It turned out that I copied an earlier version of the schematic into this version, but forgot to include some of the changes I already made. I also lost quite a bit of time hunting an error in the heater circuit that turned out to be caused by a bad Opamp. In any case, it's working and I'm running the very first test of the whole system. After setting the loop parameters and turning it on, I got a lock pretty quickly and the automatic TC increased without issues to 500.

Here is a graph where I monitor the heater temperature sensor output (mV/degree C)  during the start-up period.
It takes quite some time to get the inside temperature to settle down. Although my initial goal was to have the heater settle on 39 degrees, the oven of the OCXO and the 5V regulator add to the inside temperature.


After the ramp-up, I started to track the sensor anew, to see what is going on in more detail.




Note the voltage scale.  We're looking at 46 degrees C with 1/10th of a degree or less resolution. The temperature is measured on the top of the PCB and is a function of the heater and the OCXO oven. I may need to raise the heater temperature a bit to get it closer or even above the OCXO oven temperature, or let some of the heat escape from the OCXO itself by adding a hole in the insulation right on top of the package. 

Right now, it seems that the OCXO oven is controlling the inside temperature and the heater may only function during the start-up. Either way, the temperature is nicely regulated for now. I'm letting the Lars' sketch track the temperature of the PCB in two places, so I can plot them over large time periods without using my DMM.


I will let the system run for 24 hours to give the OCXO some more time to settle. Right now you can see that the DAC values are still very slowly going down while the temperature has been stable. 


Note that the first 500 seconds of the run were left out when I plotted the above graphs.

After 22 Hrs, the DAC is now starting to settle down:


Just showing the last 1 Hr snap shot of the above data shows the tracking of the DAC to the NS data and is basically devoid of temperature changes (although we have a heat-wave at the moment):


The TC setting of 500 is probably a little too high for this CTI OCXO, but I'll continue this run with it.
After everything has stabilized, I'll do a new parameter setting exercise and then do a run to try to figure out what the TC should be by using an ADEV chart.

After 24 hrs, the OCXO seems to be happy and stable again in it's new home.



I broke-off this run, and redid the parameter selection of the gain and the DAC linearity. I also disconnected the power to the OCXO and changed the temp setting resistors to have a heater temp of 44 degrees, same as the OCXO seems to produce to the inside of the isolation box. Obviously, the OCXO metal can itself is a lot hotter. I then profiled the heater start-up again. 


I'm tracking the output voltage of the heater Opamp (U5) here. As you can see, it slams into the rail (I took the 6.2V zener (D1) out of circuit that's supposed to prevent that because I'm having some issues with it) and than gradually reduces the voltage/heater current while the temperature is still ramping up. The final temperature the sensor is reporting is now 449mV so 44.9 degrees C. Close enough, time for a next run.

While using my IR camera, I can see that the heater on the bottom of the PCB provides a very nice looking uniform temperature on the top side above it. I use a lot of strings with resistors, but that really helps to get a uniform heat pattern, without heating-up the individual resistors too much.

I really think we may have a very good solution to the issue, but time will tell. Right now we have a heat-wave and the temperatures at night hardly drop at all. So I will not declare victory yet.

I'm a little concerned about the temperature of the 5V regulator for the OCXO (U6), it reaches just above 60 degrees, and the electrolyte next to it (C21) gets too warm. The heatsink I use for the regulator is too small, unfortunately, it's all I have and I don't have enough room on the PCB to try something else. Initially, I wanted to use the extra heat from the regulator, especially during the warm-up period for the OCXO oven, but I now found that it is not really needed. I will relocate the regulator back to the enclosure again (on the back panel?), and simply use wires to connect to the original pin holes.

With things they are now, I'm glad that I will not need a fan so I'm going to remove all that from the next revision onwards.

I moved the main LM317 (U6) to the back panel and I'm running another test with all the changes. Apart from the missing front panel, everything is inside the foam box inside the enclosure as it will be eventually.

Judging from the temperature reporting, I don't need the two sensors at the two locations above the heater anymore. With the next revision I will move the one close to U14 and place it underneath the OCXO to keep track of that temperature.

Also judging from the heater Opamp output voltage, it takes about 45 minutes before it reaches a steady state. It takes that long to gradually get everything warmed-up to the set temperature of 45 degrees. The controlling loop works really well. Kudos Bud!

BTW, when everything is on temperature, the GPSDO draws an overall current of about 220mA at 12VDC. That's not too bad.

[update 10-07-2023]
I found another item of interest. 
Below is the current run with the new 44 degree PCB heater temperature setting. Luckily, I was pre-occupied with something else so I left it running for a longer period. When I looked at the latest data, I saw a disturbance I cannot really explain yet. I may have bumped the GPSDO when I moved it a bit.

After the glitch (bump?) everything went smooth again for several more hours.




After more than two days, the DAC seems to be slowly settling again...

Below are the same plots just with added data. For some reason, there are larger swings in the NS numbers. Why I don't know yet. Here is a new plot after another night, luckily no more disturbances, but the DAC is still going down :


I'm going to stop this run now and do a run with TC 4 to find the optimum time constant (TC) by selecting the fixed TC mode (x0) and then t4. The resulting trace can then be analyzed in TimeLab. It will need about 28 hrs (TAU of 100.000) to get enough data to reduce the uncertainty and see the cross-over point between the OCXO and the GPS.

Here are the results of 1 day and 12 hrs worth of data collection to determine the optimum TC.


There was a little bit of extra hash, most likely due to my less than ideal GPS reception, but after that, everything went back to normal. The extra hash will probably make the ADEV plot a little worse, but so be it. The PCB temperature is rock stable.

Here are the TimeLab ADEV plots. First the unfiltered plot (the vertical bars show the uncertainty):


Lars recommends to use the "subtract global linear frequency trend (drift line)", and that results in this plot:


Up until 4 seconds (TC = 4), we see the OCXO stability by itself, and after that the GPS takes over and the stability (not the absolute accuracy!) increases to about 1.66E-11 at 2,000 seconds.

This graph suggests that we can raise the TC to 1,200 (20 minutes) of averaging. This is the point where the downward going slope transitions into a flat or going up part.  A value of 1,200 is way better than I could expect from this quite simple OCXO. 

Lars reports that the TC range for an OCXO can be between 100-1,000 a rubidium between 2,000-10,000. Maybe the version 4 hardware is really making a big difference...

So the next run will be with a TC of 1,000 instead of 500 and we'll see what that does. 

[Update 13-07-2023]
Well, that didn't have the hoped for results...
Notice the wild swings in the NS plot. There must be something wrong with the hardware. I now see swings way beyond +/- 20ns. Maybe that glitch I saw earlier was a sign of something going bad.


Due to the increased filtering with the TC of 1,000, the NS gyrations got beyond 80, a value which I selected to cause a reset in the automatic TC code. The system could not recover quickly enough so it lowered the TC to start at a beginning of 4 again. The original code from Lars uses an NS value of 100 to determine the loss of a lock. Either way, a TC of 1,000 seems to be too aggressive with my less than ideal GPS reception.

The good news is that the temperature regulation does it's job. I now also need to plot the room temperature and figure out at what higher room temperature, the heater looses control.

I've started a new run with a TC of 800, which is still very respectable. I also switched from my Lab Supply to a good 12VDC wall-wart to supply the power to the GPSDO.

Running these very long term runs will allow me to start to work on the connections of the GPSDO to the outside world and a new revision (4.1) for the PCB with the changes/corrections and the aim to make it smaller so it can be used for the reciprocal counter as well. That's next on my list.

Although I was monitoring the results over several days, the performance got worse and worse due to the wild swings in the NS numbers. I even set the damping from 3 to 2 to no avail. The GPSDO is loosing the lock all the time due to NS numbers getting out of range.

[31-July-2023]
To get an idea of where the regular wild swings from the NS come from, I switched out the NEO and applied the 1PPS signal from my main GPSDO. It has a NEO M8T and should be better. Unfortunately, that did not improve anything. For some reason my setup has developed an issue that I need to further examine. The GPS reception itself is fine with plenty of satellites and good reception. PDOP is 1.5 and HDOP is 1.0. Hmmmm.

[1-Aug-2023]
I spent just about the whole day on the NEO issues. In the end, I found an issue with my M8T. It seems that it's not a real genuine chip, or something went bad. The hardware report no longer shows the version anymore, and I can't use the survey mode because of that. It may have been partially bricked. Luckily, I found a used M8T from a reliable source I used many times before so I will have a new chip somewhere in the early part of September. This is not a major problem because I'm going on vacation for two weeks anyway.

GPSDO Version 4.1

[ 27-July-2023]
After all the findings and improvements based on V4.0, I decided to update the design to new version. I also needed to reduce the size of the PCB so it would fit inside an isolated chamber, and do double duty for my main GPSDO and also use it for the Reciprocal Counter. The counter assembly needs more room than what the 4.0 PCB provides.

On top of that, the main GPSDO will also need an interface board to bring out the required signals, and electrically isolate all of it to avoid connection glitches and (grounding) issues.

Here are the circuit diagrams for this new revision.



The major changes are that a DS18B20 room temperature sensor is added. This sensor will be located outside of the enclosure and is monitored by the sketch. The other temperature sensor is now an LM45 SOT-3 version and is now located underneath the OCXO. The connectors that go to the interface board have changed and are now added here. I have broken them up to make the layout easier. Also note that I replaced the 1nF TIC capacitor from a Mica THT to an SMD NPO version. With the heater, the Mica version is no longer needed. I also changed the TIC diode back to a BAT 54C Schottky version to reduce the voltage drop. The few extra pF's (from 1.5 to 10pF) dwarf in relation to the 1.000pF capacitor value.



I've added the 100nF decoupling for the U3 Opamp and changed the VCC voltage to the 8V rail, same as for the Reference. The U2 reference can be switched out for a 5V (REF5050) or even a 10V (REF5010) version. Keep in mind that when you do, several resistors values have to be recalculated.


Note that I show a 4.7uF capacitor (C32) on the f-adjustment input of the OCXO. That value may be too high for the Opamp to drive, so you can reduce the value to as low as 10nF.

I've decided to no longer buffer the output from the OCXO's with a 74HC14 gate, but I did add the optional termination resistor R91, in case the OCXO needs it. And I've also isolated the OCXO signal with C35, and added two mid-rail setting resistors R81 and R82. 


I've added another SMD package for the Zener diode, the rest is largely unchanged.
The temperature sensor is now used to monitor the actual PCB temperature close to the TIC circuit and is recorded by the sketch.



The major change here is the move of the main LM317 for the 5V OCXO rail to the back panel. I also moved the interconnects to the Processor board. The Fan circuit elements are all removed.


The layout was the real challenge to reduce the size and accommodate all of the additions and changes.


Note that I made a small error with the silkscreen for the 74HC390. It is shown as a 74LS390 because KiCad does not have a symbol for the HC version, and I forgot the change the name. The 4046 is a 74HC4046 version.




Version 4.1 Interconnect board

I started working in this additional board quite some time ago, but kept making changes based on different ideas.

The goal behind the circuits for this board is to fully isolated all signals coming from and going to the GPSDO circuits. Ideally, I want nothing to disturb the fragile operation of the GPSDO. This board will only be used for the main GPSDO, the counter version does not need it, unless I want to feed it with the 1PPS from the main GPSDO. In that case, many components are not needed and can be left out.



In the end, I decided on having two isolated 10MHz outputs on the front panel, and one on the back panel.

The isolation for the 1PPS pulse provided on the back panel is a little differed because these low frequency signals cannot use a simple transformer so I decided to use an optical isolation switch. This configuration needs some power on the secondary output side so I use a small isolated DC-DC package. I prototyped this circuit and it works really well. The downside of this circuit is that there is a significant added propagation delay. Keep that in mind.

What I also wanted to add is a 1PPS input to the GPSDO. My main GPSDO has a genuine NEO M8T, which is the timing version that is supposed to be much better than the fake normal NEO's like the 6 or 8 that I'm using now. The idea is that the GPSDO for the Reciprocal Counter can use the 1PPS from my main GPSDO.


The serial interfaces for the Nano and the NEO also need to be fully isolated. In this case, I'm only optically isolating the TxD signals from the Nano and the NEO, because they go to the Raspberry Pi monitor. The RPi will supply the 3V3 power rail to the optical interfaces and create 3V3 levels for the RPi. Right now I'm only logging the Nano, but I want to also start logging some data from the NEO as I did before with the "simple" counter.

If I have a need to re-program the Nano or use u-center for the NEO, I can use an isolated USB TTL interface adapter that connects to the Nano USB serial or the NEO USB serial connectors. This will alleviate the glitch/jump issue when connecting a USB cable directly from my Laptop to the USB connector on the Nano. I reported about this weird glitch in the previous GPSDO blog post.

The interface board will slide upside down in the top slot of the enclosure, with the larger parts "hanging down" from the bottom of the PCB. What you see here is the Top side that is facing the top cover from the enclosure. There is only about 3.5 mm of space between the PCB and the top of the enclosure.

The two interconnects to the GPSDO board are on the left hand side, together with two 10MHz connectors that will use a braided cable to go to the connectors on front panel.

On the right hand side are the connectors that go to the outside of the enclosure via holes in the back panel. The 10MHz and 1PPS signals will have an SMA connector sticking through the back panel. 






This is the bottom side of the PCB with all the taller components.


Both the GPSDO and this board have been uploaded to PCBWAY by means of the added "button" in KiCad, which makes this process super easy. PCBWAY sponsor the production, shipping & handling for me of which I'm very grateful.


[1-Aug-2023]
Both the boards will arrive tomorrow, but I have a busy week because I'm going on vacation at the end of this week. I will most likely not have enough time to build them up and test them. 

[4-Aug-2023]
After a delay, the boards came in yesterday, and again I'm impressed with the quality. I did manage to find some time to solder the heating resistors on the GPSDO board. The rest will have to wait until I'm back from vacation.

[21-Aug-2023]
I'm back from vacation and started the population of the GPSDO board. It's done and running the first test. I changed the PCB temperature from 44C to 51C to isolate the board a bit more from the room temperature, which is pretty high at the moment. We have warm summer weather.  There is no ground plane underneath the OCXO anymore so there is a reduced heat transfer, which is better for the heater regulation.

During the building process, I noticed a few silkscreen hick-ups and I found that the 8V regulator is a bit too close to other parts so it's now moved a little sideways. My current version with the above corrections and changes is now V4.1a.


My genuine but used M8T also arrived so I have plenty of things to do...

[24-Aug-2023]
Replacing the fake M8N with the 8MT has not solved a strange glitch issue I'm having already for a long time. There is an example in the data below where the lock is in jeopardy and the TC needs to back-pedal to keep the lock. I'm now suspecting the 74HC4046 I'm using. I have moved it from prototype to prototype and it could be the root cause. When I power-down the unit, I will replace it. (It did not solve the issue)

I will still need a longer test period, but after almost 46 hours, everything seems to be OK and shows an improvement over V4.0. We're getting there at last...

I'm tracking the room temperature, the PCB temperature and the OCXO temperature. The OCXO temperature is measured by an LM45 SOT-23 placed underneath the OCXO and is connected by heat-sink paste to the metal can. After warm-up, that temperature stays within a small window while the room temperature fluctuated between 28.5 and 25.5 degrees. The PCB temperature is rock solid at 52.9 degrees without any fluctuations. The DAC has settled down after about 16 hours and is still fluctuating, as it seems only from the phase errors (NS), but now devoid of temperature related changes it seems. 

NB This is still without the top of the metal enclosure installed, so the OCXO can is still subject to the room temperature changes.

( I removed the first 1.000 seconds after the start-up from the graphs below to zoom in on the actual fluctuations)



Extracting the NEO 6/7/8 qErr data

The qErr is a prediction for the internal clock difference to the next 1PPS misalignment error, and produced by the NEO chips. The qErr number can be subtracted from the next NS value already used in the sketch, and thereby eliminate the clock errors due to the misalignments of the GPS 1PPS signal and the NEO internal 26MHz clock. In my setup, these "errors" are shown to be in the +/-10nS range. 

Be aware that I've heard that the qErr output is no longer available starting with the NEO 10-series, so stick to the 6/7/8 series.

Information about that interesting new feature can be found here: https://www.eevblog.com look for post #1065 from contributor UR8US.

UR8US provided the Lars' sketch he is using, but I wanted to experiment with a simple test program using a bare Nano and an M8N NEO to learn how to do it. I have now figured out how I can extract the qErr information from the NEO.  

Hardware details can be found here : NEO interface and here for the qErr report : Protocol 
Look for the UBX protocol section 32 starting on page 168 and for the report details on pages 432-433

This is what needs to be done hardware wise:
The SDA signal is available on pin 18 of the NEO chip, and goes to A4 on the Nano.
The SCL signal is available on pin 19 of the NEO chip, and goes to A5 on the Nano.
The NEO already provides the pull-ups, and the i2c/DDS interface is activated by default.
The A4 and A5 inputs on the Nano are currently not used so that's a simple modification.

I used two thin wires that I soldered directly to the NEO chip and then extended them to the Nano inputs.

After a bit of fiddling, my test sketch runs fine and I can extract the qErr result. Below is a sample of the output of the test sketch.

 

The next step is to make the hardware modifications to the V4.1 GPSDO and also make the changes to the main sketch. 

[26-Aug-2023]
The hardware changes are easy. All you have to do is to solder two thin wires to the NEO chip pins 18 and 19 and connect them to the A4 and A5 pins on the Nano board itself. The wires are floating in the air, so no PCB changes are required. That's it. The NEO already provides the pull-ups for the i2c bus and the bus is activated by default.

I had to make a few small changes to the sketch that UR8US provided because the initial "mValue" delay (he calls it Kounter) of 300 causes the loop timer not to increment anymore. This is likely due to the added code I have in my sketch. My assumption is that he uses this as a "delay" to fill out the 1 second loop time so there is enough time between the polling of the NEO and collecting the data. In my case, a value of 250 was borderline so I used 200, but even 0 seems to work well for me.

Lastly, I found that the qErr results were alternating with a zero value every loop, so I added a small fix to the code to eliminate that. Some of his code was not used by me, mostly the plotter code.

Here is a small sample of the result:


The qErr results are simply subtracted or added to/from the "raw" NS data, resulting in a "new" NS number that should be devoid of the NEO internal clock and the 1PPS alignment issues. These error numbers for my setup are in the +/-10nS range.

I also replaced the HC8046 chip to see if that will eliminate the strange glitches I'm having. These glitches are not due to the GPS antenna or GNSS constellation, because my main GPSDO, that uses the same antenna does not show any of the glitches. It is rock solid. (it did not)

[27-Aug-2023]
I've now started a long run with these changes. After a run of almost 21 hours, there was only one glitch, that I'm now suspecting is coming from the CTI OCXO. Other than that, the system is behaving very well. It seems I'm now well into the quality issue area of the used OCXO.

Addressing the Sawtooth effect

Now that I've been able to address the clock alignment errors, the next step will be to figure out a way to eliminate or reduce the sawtooth effect. The trick is to find the correct place in Lars's code on where to do it so it does not mess with his code and functionality. I also need to better understand more of the various filtering (IIR technique) he already uses.

Before I will embark on that adventure, I need to start a separate project to better understand his code.

[09/09/2023]
I did start on a better understanding of Lars' code and improved the comments in my sketch, but I have decided to not do the sawtooth "correction". There is already quite a bit of dampening in the original code and I don't want to disturb that at the moment. If it worked for Lars, it will have to do for me. There are other things I believe I can improve a bit.

It took a while before I could get back to the Blog. I was experimenting with a number of things, and I also got a few health issues that I'm slowly putting behind me. Nothing serious, just bothersome.

I started to build a second GPSDO 4.1 PCB so I could do some experimentation while I could leave the other one alone. In the meantime, I also got delivery of my second Bliley OCXO. At first when unwrapping the package, I got a scare because there is a large dent on one of the corners. It works despite that issue, so I put it in my second circuit and I'm running more tests.

One of the circuits that I looked into a bit more was the heater circuit. Long term analysis showed that the regulation was not as good as I had it earlier on the 4.0 build. After a large number of tests, I decided to swap the TL071 opamp with a OPA1641 and that improved things pretty dramatically. I now need to run some longer tests with this new board, and will leave the first one alone for the moment.

One of the other circuits I was not overly impressed with, when starting to look at the seemingly unstable performance, was the 16-bit DAC circuit. It turned out that the voltage going in to the Opamp was not very stable, and the output of the Opamp was pretty dismal. Here is what I found with the DAC set on hold with the value set around the sweetspot:

This is the output of the 16-bit DAC circuit, taking from C8:


It seems that the minimal loading of the Opamp inputs is already enough to cause these changes. 

This is the output of the Opamp and the compression circuit, taken from the f-adjustment test point:


This is pretty bad because the noise and swings are larger than several DAC steps. This will effect the OCXO output and will work against the controlling loop resulting a an unstable output.

I replaced the TL071 opamp with an OPA1641 and the changes are pretty dramatic:



The DAC output at C8 is no longer jumping around although there is quite a bit of noise. However, this is in the low micro-Volt range now. 



The output of the Opamp and the compression circuit is now also a lot cleaner, although could be better.
I'm now starting a new run with the second Bliley and see what it will do with the two improvements.
This second Bliley will need to be nursed back to a stable situation so this could take a few weeks.


[update 18-Sept-2023]
I have been busy finishing the Reciprocal Counter.


The counter is now measuring my main GPSDO. 
This was at the beginning of the first run, it is now showing a stable 10.000,000,000,00 MHz. Quite impressive.
The white box on top of the counter is a Raspberry Pi that I use to monitor the GPSDO inside the counter.

I also put together all parts for the new main GPSDO and finished populating the interface board. 


After verifying the correct operation, I created a front panel and back panel for the GPSDO, and they are in production at PCBWAY at the moment.





Right now the main GPSDO is lying open on my desk so I can still run some tests.


You can see the two grey and purple wires that go from the Nano pins to the NEO so I can use the qERR data. The interface board lies on top in the position it will eventually slide in the top half of the enclosure. The three wires on the output side (right side) go to the Raspberry Pi that supplies the 3V3 for the interface and monitors the sketch output. Above that is the cable that supplies the isolated 10MHz signal to the Reciprocal Counter.

Because the enclosure is still open, there are some temperature related changes that will be eliminated when the enclosure is closed.

Stay tuned, there will be more to come...

Tuesday, May 23, 2023

Sponsorship by PCBWAY


I am very proud to announce that PCBWAY has decided to start a Sponsorship arrangement for me based on the work I do on this Blog.

This means that from now on, they will sponsor all PCB production and shipments for the projects  I describe on this Blog. Wow!

Here is the link to PCBWAY : https://www.pcbway.com/

The marketing dept. from PCBWAY already offered to sponsor me for a project more than a year ago. At the time, we were building the Curve Tracer, and my partner Mark who did the schematic capturing and layouts for the Curve Tracer already used them for his University work, so I had no need myself. I was impressed however with the excellent quality of these boards, and Mark also used them to order quantities of populated boards with parts. 

At the time, I was under the impression they only wanted to sponsor a single project, and so I did not pursue it any further. 

However, after I started new and different projects, they contacted me again. This time I learned more about what it meant and took them up on their offer to let them sponsor my PCB needs!

I'm not only thrilled by their recognition of my activities, but it will also allow me to spend more of my limited hobby-pocket-money on buying the parts that I need to experiment with.


Referral Program

To even support even that expenditure some more for me, they also have a referral program.

https://member.pcbway.com/specials/referrals 

This means that when you order a PCB for yourself by using the link below, I get a small portion of the value of the order that I can use to spend on parts.

Here is the referral link : https://pcbway.com/g/4BNFFf
So if you want to support me in my efforts, feel free to use this link!


The PCBWAY and KiCad connection

The good news is that they also make it extremely easy to deal with them. This is open and available to anybody.

For about a year now, I'm using KiCad exclusively, and PCBWAY not only sponsors the KiCad organization, they also have a KiCad plugin module that makes the transfer of the design and production data extremely easy. By just pressing the button from within KiCad, it creates all the needed files, makes sure they adhere to their standard, and uploads all that data (Gerber files) and sends you to their website to finish the order.

Here is the link with more information about the plugin and the installation: https://www.pcbway.com/blog/News/PCBWay_Plug_In_for_KiCad_3ea6219c.html

And here is how you use it after the installation: 

While in the KiCad PCB Editor program, you can select the PCBWAY button, located in the far right menu. Pressing that will do all the work and will get you to their website with all data already loaded.





All you have to do now is select the options you want and finish the order.

Easy does it!

If you're interested to learn more about the details of  producing PCB's, PCBWAY has made a very nice series of videos that explain the steps. The whole process is a lot more involved when you get down to the details. Have a look here: The process


Monday, May 22, 2023

A new and improved GPSDO design V3

Based on my work with a very high precision and resolution reciprocal counter measuring my current GPSDO, it became apperant that I needed a much better GPSDO design to be used as the external clock for the counter.

I already had ideas to upgrade my current GPSDO a long time ago, just never got around to it.

With the required precision and accuracy for the reciprocal counter, I bit the bullit and designed a new GPSDO version that should accomodate both instruments.

Several of the baby-steps I took are described in the Reciprocal Counter Blog post, so please have a look there for more information.


GPSDO and Reciprocal Counter Version 3

Following are the schematics I have put together based on the work, tests and experiences so far for the Reciprocal Counter project, and my more than 2 year experience of using my current GPSDO.

This is actually another prototype to put all the circuits together, but is not the final board I will use. I'll explain the next steps I want to take below. They are depending on the succesful operation of this board.

Dual DAC and OCXO Circuit



[updated schematic - June-3]  After building up the PCB, I found that I needed to make some changes to some resistor values and change the OpAmp U8. R17 and R18 have new values because for some reason, the sweetspot for the CTI changed from 2.4V to 2.6V with this circuit. The TL071 Opamp could not provide the full 4V output with a VCC of 4.096V, so I first changed it to another type, and to be safe, also modified the PCB to give it a VCC of 5V by connecting it to the decoupled supply available at U7 pin 2.

I'll start with the most important circuit that has the best improvements based on the earlier version of the GPSDO.

This new design uses a special dual 8-bit PWM design that I found a some time ago. I already tested it during my reciprocal counter project, and I was impressed.

Details about this circuit can be found here:


After building and testing it, I found that I needed to add a buffer at the output because the output signal strength is too weak for the following Gain setting circuit, or even just driving an OCXO adjustment input.

The other improvement is with the reference voltage circuit, powering the 74HC14's used in the dual DAC circuit. I spend quite a bit of time taming this circuit and it is a lot better than the circuit I used in the previous GPSDO version.

The output of the buffered dual DAC circuit normally ranges from 0-4.096V, with the DAC steps going from 0-65535. This results in voltage steps of 62.5 micoVolt. This resolution is still too course and I use a set of resistors to reduce that further. I use a series resistor (R22) and a voltage divider created by R23 and R24. R23 and R24 are selected such that they will set the adjustment pin of the OCXO at the sweet-spot level. The series resistor R22 will reduce the effect of the DAC voltage swing from 0-4.096V to a few 100mV, in effect lowering the Volt/Step to much lower values.

In my case, using the CTI OCXO, setting the DAC to minimum results in a voltage at the adjustment pin of 2.26V, and at the maximum will result in 2.534V. So we go from a span of 0..4.096V to a span of 2.26..2.534V, or a mere 275mV. This is about a reduction of 14.5 times. This should result in about 420 picoVolt per DAC step and a Gain of 380 for the loop calculation.

Right now, by using my 6.5 digit DMM with a display of 10microVolt resolution, I can just about see these individual DAC steps.


What you see here are the individual steps and the longer term tuning of the OCXO frequency based on the GPS constellation.

I added a sweet-spot detection and burn-in feature around the RV1 trimmer. The assumption is that you set the J8 jumper on pos 1-2 so you can adjust the frequency of the OCXO to 10MHz, and then burn-in the OCXO for a while. This may need from days to weeks depending on the (mis)handling of the used OCXO's. They first need to settle in their new environment before you can really start to use them in the GPSDO setting.

The procedure should be to set RV1 at mid-point and select the R20 and R21 values such that the OCXO is close to 10MHz. The values I show here are for the CTI.

After you found a stable OCXO, you can work out the values for R18 and R19 by the setting of the trimmer in addition to R20 and R21. R17 can be selected during the tuning of the firmware with the OCXO in a working GPSDO setting, and that will determine the Gain for the main loop.

My assumption is that you don't keep the trimmer section in circuit (use J8) once you have determined the sweet sport for the value calculation of R17, R18 and R19. I found that the (cheap Chinese) trimmer have a very large temperature dependency and also can produce a jitter effect.

On this design, I really created the space for the Oscilloquartz OCXO, which is the one I'm planning to use for the main GPSDO. I also created placements for two other kinds of OCXO's like the Bliey and the CIT and IsoTemp kind of OCXO's. The latter have the same pinouts.

The sinewave output versions need a "squarer"circuit to improve the edge recognition for the follow-up circuits. I'm using the "tank" circuit that fellow EEVBLOG contributor "miti" propsed and I already used that in the previous version. It seems to work OK. If it produces output exceeding 5V, you need to use a clamping diode to a rail to protect U2F.

Power Section Circuit




Above is the power section for the various circuits. The idea is to separate the rails for the various noisy circuits as the Arduino Nano, the NEO and the OCXO's from the more sensitive parts.

I'm using LM317 regulators because they are an improvement over the typical LM7805 and LM7808 fixed voltage regulators. The 8Volt section for the Arduino Nano also powers the two 5V rails. One dedicated to the NEO and one for the logic circuits and the voltage reference.

The LM317 for the 5V OCXO needs to be mounted -insulated-! on the side of the enclosure for extra cooling. Especially during the warm-up period of the OCXO's it get too hot otherwise.
The LM317 for the 8V supply does not need any cooling, but it also can be mounted on the side of the enclosure.


Controller Section Circuit





Above is the controller section, following the Lars Walenius design with a few of my additions. 

The two open squares in the diagram are KiCad's way of producing placeholders for hierarchical sheets. They lead to the two sheets shown above.

In this prototype, I still use the dual 74HC74 FF to replace the 74HC4046, that seemed to work well earlier. However, on the "real" GPSDO, I'm going to switch back to the 74HC4046. My assumption is that the 4046 has special analog input circuitry (that is called the input conditioning circuit)  that you don't see on the data sheet, but I know and suspect is there. I don't want to miss out on that for the phase detection measurement. Also, the 74HC7046 that I ordered a very long time ago finally arrived. They are an improvement on the original by now very old design of the 4046 and I'm going to try them.

I'm only using one temperature sensor at the moment, because I found that using an additional one for the OCXO "oven" temperature has little added value. The ambient temperature is much more important because that has a rather large influence on some of the temperature critical components like the D2A circuit for the phase detector (D1, R24 and C15), and the dual DAC circuit components, in addition to the Gain setting resistors R17, R18 and R19. Much more about this issue will be in the next section.

The other addition is the isolated outputs for the 1PPS and 10MHz signals. I already added them to my earlier version, but it was time to add it to the same PCB. The electrical isolation is important because I found to my dismay that connecting BNC cables to other instruments kicked the GPSDO out of lock. This is due to the ground potential differences that you can have between floating or earth grounded instruments and the floating GPSDO. Be aware that the 1PPS output cannot use the transformer. I added it to have the possibility to add a second 10MHz output. For the 1PPS signal, you need to bridge the transformer with 1uF THT capacitors to get the required isolation. The input to the two 74HC14's need to be cut and connected to the 10MHz signal.
The 1M/100nF combination that ties the two grounds of the transformer together are optional.

Further to the isolation issue, you also need to be aware of the potentials for the RS232 connections. I now use an isolated serial to USB adapter when I connect my GPSDO to my laptop. 

Both the NEO and the Nano have provisions for connecting a Raspberry Pi to these serial ports to monitor the logging, as I normaly do. If the Raspi is connected to this circuit, there is no need for special isolation of the serial channels, which is why I didn't add them on this board.

I also added a connector for a fan, just in case I'm going to use that again. The actual driver circuit will have to be on another PCB, like before. There was no place on the board, and I also didn't want this noisy circuit closeby.


And here is a 3D rendering of the top side of the PCB:


The PCB dimensions for this board are such that it will slide in the slot of my enclosure, the same one as I used before. It will not fill the whole enclosure because I want to use the same board for the GPSDO and the reciprocal counter. I kept the board at a length of 130mm so I have 20mm space to move it back and forth inside the enclosure. The width is 100mm.

For the GPSDO version, I want the two SMA adapters and the Lock indicator LED to stick through the front panel and I want front-panel access to the USB adapter of the Nano. 

For the counter version, the board will slide all the way to the back because the counter and display itself will be mounted on the front panel, and there is no need for front panel access of the 10MHz and the 1PPS. The Lock LED can be mounted on the front panel and connect with short leads to the board. 

The board will be fixed in either position through a post and screw in the mounting hole that will also connect the enclosure to the main GND of the board. Besides that, the two LM317 also need to be mounted on the side of the enclosure.

I'm going to use the Bliley from my current GPSDO for the new GPSDO and for the counter I can choose between the IsoTemp or CTI OCXO's that I also have tried with the counter tests.


Update June 3:

The sponsored PCB's from PCBWAY arrived and I build one up. After turnung it on, I ran into a weird issue, and it turned out that was caused by an insuficcient supply for the OpAmp buffer for the dual DAC circuit. I also had to make two values changes for the ref-voltage setting of the CTI OCXO (described above where the Dual DAC & OCXO schematic is)

After obtaining the new parameters for the sketch, it is now running and "burning in", while still lying on my desk. 

Update June 4:

After using my FLIR camera to look for hot spots, I was a little concerned that the inductor that I'm using to filter the input to the 5V OCXO supply was going to get too hot. I already ordered 6A ferrites so I mounted one instead of the THT 100uH inductor.

While testing some more things, I also noticed that the LM45 temperature sensor was reporting wrong values. I ordered 6 a while ago, and when I tested them, they all turned out to be fake. My little device tester reports it as an NPN transistor with a Uf voltage of 666mV and a beta of 379. That's probably what it is, with a new and fake nomenclature on the package. Bummer. I have been mostly lucky and only seldom got fakes. I ordered some more from a more reputable source. They are still the TO-92 version. Eventually, I will use the SMD version for the "heater" project, see below.

I made a judgement error with the supply voltage for the buffer Opamp by feeding it with the reference voltage of 4.096V. It turens out that most Opamps will only work above 4.5V, so I modified the PCB to connect the Opamp directly to the input voltage for the reference. It is already filtered a bit from the 5V rail, so that will help. I also noticed another omission. I forgot a decoupling capacitor for the Opamp, so I added one Manhatten style.

I also experimented with a replacement for the 1N5711 diode that is used in the phase-shift conversion. This is a THT part and not so easy to get. Besides that, it is fairly temperature sensitive, especially when you mount it up-right as I do. Just touching the Kathode with a finger will already disrupt the locking. I have found two alternative diodes in the SOT-23 package that I have in stock. They are the BAV99 and the BAV199. I decided to use the BAV99. It's a dual diode package, but it was easy to lift pin 2 and solder pin 1 and 3 to the holes for the 1N5711. The capacitance at 25C is a mere 1.2pF and it is more stable with temperature. This package will also help with the "heater" project below.

Testing it out produced fine results with this diode so that's a keeper.

I also replaced the COG capacitor that I used for the phase conversion to a mica version. This 1nF capacitance should be much more temperature stable.

I'm monitoring the f-adjustment pin for noise and jitter and it is behaving very well. At this moment I'm only checking it against my main GPSDO by comparing the 10MHz outputs from both on the DSO.

While mounting the parts, I also noticed a few package issues (as an example, 1206 instead of 0805) that I need to fix. There are now enough changes to warrant a V3.1 layout and schematic, provided this version for the reciprocal counter is a keeper.

Update June 9:

The GPSDO board has been mounted inside the enclosure, but with a mock-up for the front panel. I designed one for the counter and LCD, but did not send it off to production yet. After the "real" LM45 temperature sensor arrived, I started to do some more longer term measurements.

Here is a show of what I'm trying to address with the "heater" version, described in GPSDO version 4:


You can clearly see that the DAC output is related to the ambient temperature inside the enclosure, which in turn is effected by the room temperature during the night and rises when the sun shines through the window of my office.

The temperature sensor is very close to the parts that turn the phase difference into a voltage. Even though I'm now using the BAV99 and a Mica 1nF capacitor, my guess is that the influence is also resulting from the double PWM circuit. As long is there is a temperature effect on the DAC output, it is not a true representation of the output frequency, and hence ADEV charts are not a good representation of the frequency and it's stability as I already described in my earlier GPSDO post.

While letting the system run it's course while in the enclosure, I'm testing a higher Time Constand as well. I'm currently running with a tc of 500, while up until now I used 250. This is the same tc my main GPSDO is running with. I still need to redo all the calculations for the sketch settings for this environment, and I think I can increase the Gain again. I also need to re-run the method to find the optimum tc for this OCXO now that it's in a more stable environment.


I will report back when I have more information about the measurements on this Version 3. In the meantime, I'm working on the layout for GPSDO Version 4. That development will be described in the GPSDO Version 4 posting that I just created to cut down on the length of this one.


Paul


If you like what you see, please support me by buying me a coffee: https://www.buymeacoffee.com/M9ouLVXBdw