Author Topic: NanoVNA Custom Software  (Read 524706 times)

0 Members and 3 Guests are viewing this topic.

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11715
  • Country: us
Re: NanoVNA Custom Software
« Reply #1475 on: December 25, 2021, 07:27:41 pm »
Plotting the sweep time for the two VNAs.  Both set to 401 points, 150-300MHz.  I would imagine the stability and averaging are not very important to the antenna analyzer group.  For our friend attempting to do their radar experiments, maybe its a bit more critical. 

I did try changing the process to realtime but as expected, no effect. 

So I set the average back to 2 and the system is stable.  It could be a problem with my software.  Hard to say. 

Where are you storing the firmware?   I would be willing to have a look at the new version that supports the narrow band measurements. 

Offline DiSlord

  • Regular Contributor
  • *
  • Posts: 108
  • Country: ru
Re: NanoVNA Custom Software
« Reply #1476 on: December 25, 2021, 08:16:11 pm »
I made firmware for self (but send last code to Hugen, he additionally checks it on his devices and assembles the firmware)

I don't have the latest hardware revision, just a couple of engineering samples (2.8 inch version and very old 4 inch board)

Official page here:
https://zeenko.tech/litevna

I can build my last code
LiteVNA 62 for 2.8 inch devices (i test it on my sample)
LiteVNA 64 for 4 inch devices (must work but not test)

Fixed update power setting in CW mode for both SI and MAX
Added more trace/marker types
Added USART connection support

>narrow band measurements
If i correct calculate 1xavg give 2kHz bandwidth on > 400kHz frequency (

On < 400kHz used 12k IF on less 20k use 6k IF so measure on this range slow (very slow).
Min frequency = 1.6k but in this range Lite have very bad dynamic (i allow use it only for tests LiteVNA Specifications 50kHz ~ 6.3GHz).

All V2 (and LiteVNA) on ~ < 1Mhz not good.
H4 up to ~100MHz work more better then any V2 variant include LiteVNA
« Last Edit: December 25, 2021, 08:25:46 pm by DiSlord »
 

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11715
  • Country: us
Re: NanoVNA Custom Software
« Reply #1477 on: December 26, 2021, 01:03:06 am »
I have the 4 inch version.   No problems installing the firmware.  The only thing I had to do was calibrate the touch screen (so I could check the version).   Measuring a crystal, I get the same values as I did with the previous firmware.   Yes, very slow at lower frequencies.   I'll try out the power level settings.


Offline DiSlord

  • Regular Contributor
  • *
  • Posts: 108
  • Country: ru
Re: NanoVNA Custom Software
« Reply #1478 on: December 26, 2021, 09:01:25 am »
On serial crystal measure i get better results if select x5 or x10 avg

LiteVNA (as H/H4) have crystal measure calculator (see MEASURE->SERIES XTAL)
I use Phase Shift Measurement https://www.mikrocontroller.net/attachment/473317/Crystal_Motional_Parameters.pdf method for calculate
For get better results on limited points count i use bilinear interpolation on search

Here it results for 10MHz serial xtal connection
NanoVNA-H (101 points)
1359824-0
Here some measure on LiteVNA (1001 points allow better search resonances and phase shifts):
1359830-1
V2Plus4 not allow made this measure (it use additional processing for get better dynamic, so results look strange):
1359836-2

But any V2 not good in XTAL measure, due to used measure mode (first measure reference, second refflect, second thru), H/H4 measure (reference / reflect and reference / thru in some time, and this allow see correct XTAL responce)

Lower frequency XTAL better measure on bigger avg settings (results look better)
« Last Edit: December 26, 2021, 09:09:03 am by DiSlord »
 

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11715
  • Country: us
Re: NanoVNA Custom Software
« Reply #1479 on: December 26, 2021, 03:33:16 pm »
I've not tried to use any of the built-in features for the NanoVNAs.    It may be of interest to compare the LiteVNA against my original NanoVNA.

What do you require for a test fixture?  I see the paper you provide has a few.  I made a few different fixtures but didn't obtain very good results.  The last fixture I constructed  seemed to get me very close results when compared with other methods:

https://www.eevblog.com/forum/rf-microwave/fun-with-crystal-filters/msg3076877/#msg3076877

I have a couple of crystals that I had collected data for but was never able to get my hands on a reference standard. 

Offline DiSlord

  • Regular Contributor
  • *
  • Posts: 108
  • Country: ru
Re: NanoVNA Custom Software
« Reply #1480 on: December 26, 2021, 04:41:40 pm »
I use cheap fixture like this, just for test
For this fixture need set Rl = 50 Om
1360652-0

Also i see this variant:
For this need set Rl = 12.5 Om
https://www.ph2lb.nl/blog/index.php?page=xtal-adapter-for-nanovna

I have H / H4 / V2Plus4 / LiteVNA / modded V2Plus from V2 / LibreVNA
Also have v3.6 board H variant (last board revision show very good results)

PS i try add in firmware all features as on CPU side, for stand alone use
 

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11715
  • Country: us
Re: NanoVNA Custom Software
« Reply #1481 on: December 26, 2021, 06:10:54 pm »
I tried it but was lost.  For starts, the terms you use do no match the paper you provided.  I'm not sure what equations you use.  Q for example could mean different things.   If I used the simple fixture, cal the VNA, the software will not detect the crystal.  I have to manually zoom in.  Eventually it starts to show some numbers.  As I continue to zoom in, these change a fair amount.   I would need some sort of written procedure before I could evaluate it. 



Offline DiSlord

  • Regular Contributor
  • *
  • Posts: 108
  • Country: ru
Re: NanoVNA Custom Software
« Reply #1482 on: December 26, 2021, 07:50:05 pm »
Yes, need manually (this measures semi automatic) select range for good see both resonances on screen (on calculation i search resonances/phase shifts on current measured data), i use bilinear interpolation for get data between poins so bigger points count reduce errors (also selecting good range allow get more closest results)
Also better select bigger avg settings (Display->AVG = 10 for example)

w2aew made video:


How i made calculations:
I search Max linear value in S21 (k = |S21| at this point) value and get Fs frequency
k - linear value (not in dB, for dB value Rs = 2*Rl * (10^((S21 in dB)/20) - 1)
Rs = 2*Rl * (1/k - 1)
Reff = 2*Rl + Rs

Next i search pase shift -45 degree and get frequency f2 and pase shift +45 degree and get f1
After i correct measured Fs frequency by made geometry average
Fs =sqrtf(f2*f1)
dF = f2 - f1
Ls = Reff / (2 * Pi * dF)
Cs = dF / (2 * Pi * Fs * Fs * Reff)
Q =  2 * pi * Fs * Ls / Rs not remember why, need search (look like Need use Reff? not Rs, in this case Q = Fs / dF)

After i search min linear value in S21 and get Fp frequency
Cp = (C0 + Cstray)
There C0 is the holder capacitance, Cstray - shunting capacitance of the test fixture

Cp = Cs * Fs / (2*(Fp - Fs))

PS SHUNT LC measure allow measure XTAL connected as shunt, need also manually select range for see peak (this measure critical to good calibration)
1360808-0

PS need rename Rs to Rm, Ls to Lm and Cs to Cm

PS you store calibration in 0 slot (better use DONE in RAM for temporary calibrations, calibration reset after power off, if you change range calibration data interpolated), this slot loaded on startup and apply to sended to CPU data. After all experiments better clear all calibrations by CONFIG->EXPERT SETTINGS->CLEAR CONFIG. This reset device to default state.
I made this (apply internal calibration on sended to CPU data) as option on next.
« Last Edit: December 26, 2021, 09:37:34 pm by DiSlord »
 

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11715
  • Country: us
Re: NanoVNA Custom Software
« Reply #1483 on: December 26, 2021, 10:53:48 pm »
>PS need rename Rs to Rm, Ls to Lm and Cs to Cm
Right, I wasn't sure if you had used the paper you linked because of this. 

> (look like Need use Reff? not Rs, in this case Q = Fs / dF)
According to the paper you linked yes.   I used Chris Bowick RF Circuit Design.

>... this slot loaded on startup and apply to sended to CPU data.
Good to know.  Normally, I would just leave them calibrations blank and assumed the CPU would just send the raw no matter if I used them or not. 

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11715
  • Country: us
Re: NanoVNA Custom Software
« Reply #1484 on: December 27, 2021, 04:10:13 pm »
Rs = 2*Rl * (1/k - 1)
Reff = 2*Rl + Rs
Q =  2 * pi * Fs * Ls / Rs not remember why, need search (look like Need use Reff? not Rs, in this case Q = Fs / dF)

Looking at my software, I also use Rs for Q.   I warn people about my software possibly not being correct.  I find a lot of errors in published papers and sometimes it is difficult to determine which are correct.   We could both be wrong!  This was one reason I tried to procure a standard crystal to perform some sort of sanity test. 

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11715
  • Country: us
Re: NanoVNA Custom Software
« Reply #1485 on: December 27, 2021, 04:18:53 pm »
From another paper, again confirming your calculation.   I suspect it's just a mistake in the paper you linked. 

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11715
  • Country: us
Re: NanoVNA Custom Software
« Reply #1486 on: December 27, 2021, 04:34:04 pm »
When looking at my software, I saw that I had names it Serial Freq.   WTF is serial?  The person who had first asked me about using the NanoVNA to make  a crystal filter was planning to use the DISHAL software.   I ended up using that software to double check my software (not that it is right).   

To try and make it easier for that person to follow along, I used the same name. 

Offline galileo

  • Contributor
  • Posts: 45
  • Country: cs
Re: NanoVNA Custom Software
« Reply #1487 on: December 29, 2021, 08:44:23 pm »
now i got your point. about Hugen tries to monopolized the market thats the problem, not that he copied your design... but i guess similar happened to outsides countries such as US with China. US businesses have become unsustainable due to competition and low production cost of China, i cant imagine how many businesses in US have to close or scaled down due to this. now the fight has become domestic within China itself ;D how about bring this kind discussion to the NanoVNA 6GHz thread i have no problem with you over there and leave this thread to its original intention ;) and i'm sorry to say you wont be able to stop people from buying what they want. like me for example, i need cross compatibility with NanoVNA-QT i told you, and LiteVNA is the only option for me now and no other else afaik. cheers.

No one put a gun to USA manufacturers and forced them to move to China.
The rest is a claim, repeated a thousand times, by a single person without any evidence.
 

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11715
  • Country: us
Re: NanoVNA Custom Software
« Reply #1488 on: December 31, 2021, 01:29:15 am »
For the few of you who come to EEVBLOG for the tech rather than the politics...


Offline DiSlord

  • Regular Contributor
  • *
  • Posts: 108
  • Country: ru
Re: NanoVNA Custom Software
« Reply #1489 on: December 31, 2021, 12:41:40 pm »
V2Plus4 not have CW output mode as i remember.
Output switch for measure reference signal, in this case output off.

You can see this on oscilloscope as output switch on/off

In last V2 firmware added special cw mode, in this case output not switch (can enabled in sweep settings).
LiteVNA also have this mode (auto enabled on user select cw)

About square output, for measure used IF frequency  (use mixer for switch F to IF frequency, value depend from device and measure range, anyway IF < 150kHz), and filter IF from harmonics after go to ADC and made DSP.
« Last Edit: December 31, 2021, 01:01:02 pm by DiSlord »
 

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11715
  • Country: us
Re: NanoVNA Custom Software
« Reply #1490 on: December 31, 2021, 05:36:52 pm »
V2Plus4 not have CW output mode as i remember.
Output switch for measure reference signal, in this case output off.

You can see this on oscilloscope as output switch on/off

Yes, you can see it in this video and we have discussed it here a few times. 


In last V2 firmware added special cw mode, in this case output not switch (can enabled in sweep settings).
LiteVNA also have this mode (auto enabled on user select cw)

I noticed that and was going to ask you if the firmware you created for the V2+4 also works this way? 

About square output, for measure used IF frequency  (use mixer for switch F to IF frequency, value depend from device and measure range, anyway IF < 150kHz), and filter IF from harmonics after go to ADC and made DSP.
Yes, I remember the poor performance of the H4 at lower frequencies.   When we purchased the LiteVNA, this was my biggest concern.   I have not gone back to look at the low frequency performance after installing the firmware you linked above.   The original firmware supplied (sadly not archived from what I see and I blew it away) seems to perform well.  Actually, overall the firmware for that product has worked well. 

After making that video, someone commented about problems with the square wave drive.  I wonder if any of the members who have access to a commercial grade VNA have experienced problems when using it due to the square wave drive.   

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11715
  • Country: us
Re: NanoVNA Custom Software
« Reply #1491 on: December 31, 2021, 06:27:18 pm »
Looking at the LiteVNA P1 with my vintage LeCroy 5GHz WaveMaster (w/ SSD that was going to fail after a few weeks and added Ethernet that wasn't going to improve data rates.  As I said, lots of misinformation).     Lite first set to swept mode, then to CW.  Finally, setting the VNA to 500MHz and looking at the edges. 

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11715
  • Country: us
Re: NanoVNA Custom Software
« Reply #1492 on: December 31, 2021, 06:28:37 pm »
Showing the V2Plus4 set to 500MHz CW.

Offline DiSlord

  • Regular Contributor
  • *
  • Posts: 108
  • Country: ru
Re: NanoVNA Custom Software
« Reply #1493 on: December 31, 2021, 06:57:40 pm »
Sorry. In last code i add power change option in cw mode, and made typo - apply power option for max/adf synthenizer for si5351. I found and fix it later.

I work on use calibration standart coefficients on LiteVNA calibration. This can improve measure quality if use known standarts.
Main problem, how made this calculation more simple for allow real time calculations on device (need calculate 3 complex variables for calibrations, and use additional 3 measured data in huge size formulas).


 

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11715
  • Country: us
Re: NanoVNA Custom Software
« Reply #1494 on: January 01, 2022, 01:00:55 am »
Is the new version released on the official site? 

If you find a good book on calibration, let me know.  Outside of learning how little I know, I haven't made much progress.

I blew the dust off of my old 7200.   

Online gf

  • Super Contributor
  • ***
  • Posts: 1308
  • Country: de
Re: NanoVNA Custom Software
« Reply #1495 on: January 01, 2022, 11:35:26 am »
I work on use calibration standart coefficients on LiteVNA calibration. This can improve measure quality if use known standarts.
Main problem, how made this calculation more simple for allow real time calculations on device (need calculate 3 complex variables for calibrations, and use additional 3 measured data in huge size formulas).

Even if the known S parameters of the calibration standards are not specified directly, but in parametric form, isn't it still possible to pre-calculate the 12 (?) error terms for each frequency point, and apply the pre-calculated error terms as usual to the measurements? Then only the pre-calculation of the error terms is affected by the higher computational complexity (whenever start freqency, stop freqeuncy, or #ponts are changed).

Edit: Or do you also have a memory shortage, so that you can't afford a pre-calculated table?
[ I remember, when I compiled the NanoVNA V2 firmware from github for a V2.2 device, there was not too much RAM free. I have not yet tried your firmware variant. I think I need to try when I find some free time. ]
« Last Edit: January 01, 2022, 11:50:35 am by gf »
 

Online gf

  • Super Contributor
  • ***
  • Posts: 1308
  • Country: de
Re: NanoVNA Custom Software
« Reply #1496 on: January 01, 2022, 12:15:47 pm »
If you find a good book on calibration, let me know.  Outside of learning how little I know, I haven't made much progress.

A helpful resource for implementing VNA calibration is IMO scikit-rf. It supports various VNA calibration methods.
This toolkit is written in Python, but it should not be too difficult to transcribe the NumPy stuff to Matlab.

Edit: Sorry, I think I mixed it up -- you are using LabView, not Matlab, right?
Anyway, I guess it should be possible to transcribe the implemented algorithms.

Docs for the calibration module:
https://scikit-rf.readthedocs.io/en/latest/tutorials/Calibration.html
Edit: More details are in the API docs:
https://scikit-rf.readthedocs.io/en/latest/api/calibration/index.html

Git repository:
https://github.com/scikit-rf/scikit-rf

The core of the calibration-related stuff is located in this module:
https://github.com/scikit-rf/scikit-rf/blob/master/skrf/calibration/calibration.py
« Last Edit: January 01, 2022, 12:42:32 pm by gf »
 
The following users thanked this post: hash

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11715
  • Country: us
Re: NanoVNA Custom Software
« Reply #1497 on: January 01, 2022, 04:54:18 pm »
The last book I purchased was not helpful.  While Dunsmore's book dedicates a chapter to calibration and error correction, Bonaguide & Jarvis have only a few pages.    Both books would make a very good reference and I wish I had them when I was first introduced to a VNA. 

Offline Alextsu

  • Contributor
  • Posts: 42
  • Country: ru
Re: NanoVNA Custom Software
« Reply #1498 on: January 01, 2022, 05:11:30 pm »
The last book I purchased was not helpful.  While Dunsmore's book dedicates a chapter to calibration and error correction, Bonaguide & Jarvis have only a few pages.    Both books would make a very good reference and I wish I had them when I was first introduced to a VNA.

Hi, Joe,
Wish You Happy New Year!
Trying a very basic search with the "Unknown Through Calibration" gives some hits

http://www.microwave.fr/publications/149.pdf

http://coppermountaintech.com/wp-content/uploads/2018/05/Conducting-Calibration-with-the-SOLR-Unknown-Thru-Method.pdf



There's much more, of course


« Last Edit: January 01, 2022, 05:42:35 pm by Alextsu »
 

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11715
  • Country: us
Re: NanoVNA Custom Software
« Reply #1499 on: January 01, 2022, 07:19:59 pm »
Hello Alex.  Most of my searches didn't yield very useful information (at least for me).  Some of the better papers will talk about the need for different approaches depending on the hardware.  Dunsmore's book glosses over this and you may find equations during your searches not covered.   You can try terms like "VNA delta match" to narrow your search.   The best resource I have found have been patents.  Sadly, what is obvious to one skilled in the art is not so obvious to me.     

I've contacted others who have wrtiten their own software but have not ran across anyone who has implemented anything beyond the 12-term model on something like the NanoVNA. 

The only reason I started to look into it was OWO had mentioned the V3 supporting it along with other advanced calibration techniques.  This made me wonder if it could even be done with the hardware and if so, would there be any advantage.   My old PNA supports unknown thru and TRL but it's a four receiver system.  While I use them, I know very little about how they work.  Even if these were well documented,  the Nano's hardware isn't the same.   

https://nanorfe.com/nanovna-v3.html

Its been an interesting rabbit hole.   
« Last Edit: January 01, 2022, 08:06:13 pm by joeqsmith »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf