28

Home · will127534/RaspberryPiAtomicNixieClock Wiki · GitHub

 2 years ago
source link: https://github.com/will127534/RaspberryPiAtomicNixieClock/wiki
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Raspberry Pi Atomic Nixie Clock

68747470733a2f2f692e696d6775722e636f6d2f4b38784b7a44622e6a706768747470733a2f2f692e696d6775722e636f6d2f766e37364f77622e6a7067

Sys Arch

68747470733a2f2f692e696d6775722e636f6d2f7a7246677779522e6a7067

Atomic Clock

Introduction

The core of the project and the main reason I started this project is this miniature atomic clock I picked up from eBay a couple of years back. This is the atomic clock I can integrate into my nixie clock in a reasonable power (~5W) and size (51mm x 51mm) requirement. What's better is that it is designed as pin to pin replacement for existing OCXO, so it is easy to just use a standard OCXO for testing.
68747470733a2f2f692e696d6775722e636f6d2f4157494b454f672e6a7067

I collected two of them, but unfortunately, the first one doesn't reliably lock, so I tear it apart, and this is what the internal component looks like:
68747470733a2f2f692e696d6775722e636f6d2f6857466b6333322e6a7067

You can see the VCO, PLL, ADC, DAC, and output DDS.
68747470733a2f2f692e696d6775722e636f6d2f52354d414b64752e6a7067

And this is the laser + physics package.
68747470733a2f2f692e696d6775722e636f6d2f6963377657485a2e6a7067

Not surprisingly, this type of Rb clock (Coherent Population Trap*1) doesn't perform as well as other "standard Rb based Atomic clock," 3x10E-11 (1s), 1.6x10E-11 (10s), 8x10E-12 (100s). But I still have the bragging right to claim this is an atomic clock, and thankfully my second SA.31m is working just fine.
68747470733a2f2f692e696d6775722e636f6d2f6e42546d5079352e6a7067

Although it should be an easy integration, heat dissipation is an issue. On my testing board, if there is no additional airflow or heatsink, this clock can go all the way to 60-degree range, which is far too close to the limit of 70 operation limit. For the longevity sake and to make it cooler, I've got a CNC heatsink, and it is contacting the atomic clock through the cut-out underneath and Thermal Conductive Pads.
68747470733a2f2f692e696d6775722e636f6d2f673046716d415a2e6a7067

I also placed a TMP117 between the board and MAC to ensure the temperature measurement is accurate. But to be sure the heat dissipation is enough, I leave a cut-out for a Fan.

Also, as the first image show, I have an aluminum enclosure; the goal for the outline is to get closer to the "Divergence Meter" in the animate "Steins;Gate."

GPS discipline

68747470733a2f2f692e696d6775722e636f6d2f4d796c5a5476792e6a7067

The GPS module providing the PPS is NEO-M8T, a specialized timing series but smaller than traditional LEA modules. I did look into the latest and greatest ZED-F9T, but I don't have the board space left nor my pocket.

I want to prevent DAC or ADC measurement temperature coefficient issues, so instead of doing the discipline in the analog domain, I used TDC7200 to measure the time directly. The interface is connected directly to iCE40 FPGA. Time measuring in a high-level structure is similar to TICC. The PPS output is the Start, and FPGA will output Stop after 300,000 cycles. The reading is then captured by FPGA and send back to RPI. After correcting the GPS PPS sawtooth error, the data is then sent to the calibration module.

Here is the resulting plot of the uncorrected and corrected PPS duration measurement.
68747470733a2f2f692e696d6775722e636f6d2f53376b76686b502e6a7067

The discipline algorithm currently is a simple error accumulator and sends the FEC adjustment digitally to MAC.

Here are some of the results: ADEV, MDEV plot of the PPS. Calculated and plotted by Matlab script provided by M. A. Hopcroft *2
68747470733a2f2f692e696d6775722e636f6d2f6c576e566446542e6a7067
68747470733a2f2f692e696d6775722e636f6d2f4b3753764a75672e6a7067

Issues

The main issue I have right now is the discipline algorithm. Initially, I'm using a PID loop, but it turns out a simple error accumulator works better...
68747470733a2f2f692e696d6775722e636f6d2f4938746a3556342e6a7067
The second issue is that PTP support is not complete on Raspberry Pi 4 Compute Module. I have the PTP input connected to FPGA, but I am still can't use it as my PTP main clock.
https://github.com/raspberrypi/linux/issues/4151

Thirdly, while researching discipline algorithm, jackson-labs LNRB manual indicated the lousy phase noise profile this atomic clock has. It is bad enough that they even placed an OCXO just to filter out the noise.

Lastly, it's more of a conceptual question I have. GPSDO can correct frequency error, but how should I synchronize with the UTC accurately? i.e., how can I make sure the PPS output is aligned with UTC? Since every GPS PPS contains the noise, it seems like there is no way I can tell what it is the actual PPS.

AC waveform monitor because why not

Structure

The structure is simple, an AC transformer provides a low voltage AC waveform, and an ADC8681 16bit ADC is sampling it directly at a 50Khz rate. The data is then going through FPGA internal FIFO and processed by Raspberry Pi. The timing comes from the atomic clock to ensure the frequency accuracy of the mains voltage.

Calibration

Calibration is done by comparing the AC mains Vrms measurement from 34410A and simple linear regression. The voltage does span about 6V during a day (interestingly, higher voltage when low power demand in the region and vice versa, maybe the resistance in the power line is causing this?)
68747470733a2f2f692e696d6775722e636f6d2f42495357594c482e6a7067
68747470733a2f2f692e696d6775722e636f6d2f6a7155736559752e6a7067

Some interesting result

California doesn't have a reliable power grid, thanks to PG&E, so I did capture some power outage waveform. 68747470733a2f2f692e696d6775722e636f6d2f5470476e7558312e6a7067
68747470733a2f2f692e696d6775722e636f6d2f3551424b5165512e6a7067

Nixie Tube

This might be the least interesting part, so I'm just going to say that the brightness control is a PDM signal generated by the FPGA to maintain the display under low brightness cause I don't want to add additional light bulbs in the dark while I'm sleeping. Nixie tube has a minimum on-time requirement for the digit to turn on entirely, so typically, when people using PWM, it's either you accept the low PWM frequency or the brightness can't go down to a certain degree. But by using PDM instead of PWM, the brightness can scale down further. Here is a comparison using PDM and PWM. (Camera setting is the same.)
68747470733a2f2f692e696d6775722e636f6d2f434f4f576448432e6a7067

The high voltage switch IC is HV5623, and it is also controlled directly by the FPGA.

  • The WiFi antenna is on the top board.
  • Input power filtered by common mode choke and EMI filter. But I have a wrong sch for the eFuse.
  • There is a programmable PLL (Si5351c) output just in case someday I want to replace the crystal on CM4.
  • FPGA Source Code and PCB files are on Github
  • Higher resolution internal images for the atomic clock are on Flickr

*1 Symmetricom. A COMMERCIAL CPT RUBIDIUM CLOCK. (https://www-users.york.ac.uk/~jke1/Atomic_Clocks/Papers/Commercial%20CPT.pdf) Retrieved September 4, 2021.

*2 M. A. Hopcroft (2021). allan (https://www.mathworks.com/matlabcentral/fileexchange/13246-allan), MATLAB Central File Exchange. Retrieved September 4, 2021.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK