Open Joel-Mckay opened 3 years ago
Thank you for the kind words. Sorry for the delay in responding.
I am glad crystalweb is working for you for batch quantification. Indeed batch use is why I designed it in the first place!
Regarding the issues you reported:
1) I fixed the first error you reported: the TypeError that gets thrown. So instead of crystalweb throwing an error now and breaking when it cannot find the series resonant frequency (line 176), it prints a gentle error message to the terminal.
2) I also added a --batch option to crystalweb making it repeat the measurement over and over, each time incrementing the part number and pausing before each measurement. (Use --part-number to continue an interrupted batch measurement)
3) As for your last issue, are you asking for an option like --ppm -100 which will adjust the frequency sweep range within the python code by multiplying it (but not the range sent to the firmware) by .9999?
This is a great little utility, and perfect for sorting though bins of xtals. Any tips on the error would be helpful. =)
As far as I can tell, the NanoVNA-H does not have a ppm offset setting, and would require rebuilding the firmware to correct the error. Perhaps, I thought it would make sense to add the +-ppm offset to the xtal profile tool instead, but am unsure how well these devices vco are made.
Firmware: https://github.com/hugen79/NanoVNA-H.git NanoVNA-H_20210130.dfu
My 10MHz hc49 xtal scan example: 9.997225MHz series peak 10.017400MHz parallel dip
crystalweb Error seems to occur as peak scan window is narrowed a few times:
scanning sample label X0... TITLE: X0 RL = 50.0 ohm fs = 9997132 Hz Rm = 30.44 ohm Traceback (most recent call last): File "/home/.../crystalweb_ladder_filter_designer/crystalweb/crystalweb.py", line 256, in main stray=args.stray, title=args.title) File "/home/.../crystalweb_ladder_filter_designer/crystalweb/crystalweb.py", line 185, in analyze_crystal sweep(fs - bw_df / 2, fs + bw_df / 2) TypeError: unsupported operand type(s) for /: 'NoneType' and 'int'
And thus line 176 in crystalweb.py is never true:if not np.isnan(bw): bw_df = df
My test script to sort my parts bin: