NT7S / Si5351

Library for the Si5351 clock generator IC in the avr-gcc environment
GNU General Public License v3.0
33 stars 11 forks source link

ms calculation & precision improvements using continuous fractions #15

Open n6gn opened 7 months ago

n6gn commented 7 months ago

Jason, First thank you so very much for all your effort in providing the si5351c library. This has been extremely helpful to me as I modify the 'all band' 0-2 GHz disciplined transverter I'm working to make available on my Open Source Hardware Pages and the 2nd gen general purpose disciplined reference extracted from it using the Si5351 C. 1st gen is already in TAPR's hands for production and deployment for HamSci and other uses which have already netted important new insights into the ionosphere and propagation within amateur radio through FST4W spectral spreading measurements. In moving from the A to C I immediately went to your library which saved me a great deal of time. I apologize that I haven't yet been able to fully read your documentation or comments on this forum yet, things worked so well and so soon that I have been able to address HW and other issues for these devices I'm making.

I'd like to offer a suggestion that I think would greatly improve the C implementation. That is to use Continued Fraction techniques to obtain far more precision than simpler frequency setting techniques. These presently limit resolution to approximately SI5351_PLL_INPUT_CLKIN/10^6 which amounts to about 40 ppb for a 25 MHz source.

The new measurements and discoveries we are achieving with high precision even on HF require small-mHz accuracy to measure ionospheric characteristics and Doppler shift in the small mHz or few-ppt (parts per trillion) precision. The current library can not provide this but I think there may be a direct way to improve it. Franco Venturi K4VZ has already written code to calculate these new values which I think can provide about six orders of magnitude improvement in precision. While I haven't yet tried it I have confidence that it will work.

If your library could be revised to use this technique, borrowing from Franco's code as is useful, I think the results could be phenomenal. The present few kHz setting errors currently produced at microwave frequencies could drop to a few mHz (milli-Hz) in situations where the Si5351 is providing reference clocking. Of course this improvement would apply to all the user outputs on the 2nd generation reference I now have prototyped and operating.

While I think I am able to extend your library to make the ms calculation accessible myself, you are a far better coder than I am and undoubtedly much more proficient than I and the improvements would then be directly available to everyone using your efforts. Having wide geographic area very high precision transmitters and receivers can allow high precision time of flight measurements, propagation study, geopositioning and other benefits to amateur radio and even radio science in general.

If it could help you, I am willing to provide you prototype hardware on which to develop and test these modifications. It does require a test set up with very high GNSS, OCXO or local 10 MHz disciplining such as rubidium standards. If you contact me directly I think I can provide Franco's code if you are interested in pursuing this. Again thank you so much for what you've done and the great contribution it is.

Glenn Elmore n6gn Fort Collins, CO

n6gn commented 7 months ago

A good place to find the CF code to play with it is the 'si5351-experiments' repository (https://github.com/fventuri/si5351-experiments). If you look at the examples in the README (https://github.com/fventuri/si5351-experiments?tab=readme-ov-file#si5351-experiments) it should be easy to see how you can run it.

NT7S commented 7 months ago

Thanks for the really detailed feedback!

I definitely became aware of the weakness in the library of calculating fractional Hz parameters when I tried using it to generate WSPR and FT8 for higher HF bands and VHF. I'm definitely interested in pursuing this, and follow up on a bunch of the other issues and PRs that have accumulated. I was without a workbench for a few years and have only recently been able to set up a modest new bench, which has stopped me from doing any real work on this library.

I do have a GPSDO, and I'm going to be using the Si5351C in my new "Project Yamhill" board so I should be able to do this if I can get that GPSDO set up again. Give me a few weeks or so to finish up some other things and I'll take a look to see if I can accomplish this. I think it would make me and a lot of people happy.

n6gn commented 4 months ago

Since writing here earlier this year, using Franco's code I've made useful progress in applying continuous fractions (CF) to the NT7S Si5351 library in the context of an Arduino IoT33 rather than simply the Uno.

Not only do CF work very well in greatly improving the frequency precision but the use of the CLKIN pin has allowed better phase noise performance. Precision can now be so good that some of the special effort previously needed can be avoided if they are used with a truly double precision float environment. All this has ended up unearthing several issues in the library and with the application of the si5351 20-QFN C version part.

Though I'm not finished with these efforts, because they may be useful to others here, I'm attaching a first draft describing some of what I've found useful in case it may save others time and effort.

Glenn n6gn

Si5351 NT7S notes.pdf