Author Topic: NanoVNA Custom Software  (Read 527069 times)

0 Members and 7 Guests are viewing this topic.

Offline gf

  • Super Contributor
  • ***
  • Posts: 1314
  • Country: de
Re: NanoVNA Custom Software
« Reply #1500 on: January 01, 2022, 09:19:47 pm »
My understanding is that "unknown thru" is based on the 8-term error model for a full two-port VNA. So I have doubts, that it can be used with the 1.5 port NanoVNA (whose 2nd port cannot transmit and has no directional coupler). OTOH, the V3 was initially announced as full two-port VNA, in this case "unknwon thru" were an option. But in the meantime the actual features of the V3 seem to be not so clear any more.

With the NanoVNA as is, your options for S21 calibration are basically response normalization (suffers from both, source and load mismatch - both are not corrected), or Enhanced Response Calibration (which corrects source mismatch, but still cannot correct load mismatch). Enhanced Response Calibration is obviously supported by the NanoVNA V2 firmware and can be enabled in the menu.

I'm unsure whether Two Port One Path Calibration can be used with the NanoVNA. This calibration model enables full S11,S21,S12,S22 measurement and full error correction with a 1.5 port 3-receiver VNA, but the DUT needs to be flipped and measured twice. Therefore the DUT must have either two male, or two female connectors of the same type, in order that you can still insert the flipped DUT w/o additional adapters. My doubts regarding usability of this model is the switched receiver of the NanoVNA V2 (it does not have 3 receivers).
 


Offline rf-messkopf

  • Regular Contributor
  • *
  • Posts: 160
  • Country: de
  • Mario H.
    • Homepage
Re: NanoVNA Custom Software
« Reply #1502 on: January 02, 2022, 12:56:38 am »
My understanding is that "unknown thru" is based on the 8-term error model for a full two-port VNA. So I have doubts, that it can be used with the 1.5 port NanoVNA (whose 2nd port cannot transmit and has no directional coupler).

For true SOLR (aka "unknown thru") you do not only need a fully bidirectional two-port test set that can measure the full S-matrix (i.e. S11, S21, S12, S22), but actually a four receiver VNA.

There is no way around these hardware requirements. However, on a three receiver VNA, you can do a full two-port calibration (i.e. by a SOLT cal), and then determine certain parameters from the calibration data, the so-called switch terms. With the assumption that the switch terms are constant (this is usually a very good assumption), you can use them subsequently to do SOLR calibrations, even on a three receiver VNA. If I'm not mistaken this approach essentially is what Keysight calls "delta match method" which is available on their older or lower cost VNAs without four receivers.

A four receiver VNA has the ability to measure the switch terms directly. It does not need to assume that they are constant, and does not need to measure additional cal standards in a previous step to determine them.

Some more background about this: As you correctly say, SOLR is defined in terms of the 8-term error model. This model consists of two so-called error boxes at each port that correct for all imperfections. That means that it is assumed that the impedance of the physical VNA port does not change if it is switched from source to load configuration (the error boxes are constant and thus are unaware of the current port mode). The quantification of this model can be done in terms of measuring short, open, and load at each port, together with an unknown reciprocal thru. All that remains is a sign ambiguity, which essentially is due to the phase ambiguity in the thru of unknown length. Also, this step does not need a four receiver VNA. All of this is laid out in the original paper by Ferrero and Pisani which introduced the method ("Two-port network analyzer calibration using an unknown 'thru'", IEEE Microwave and Guided Wave Letters Volume 2, Issue 12, 1992).

To get rid of the assumption of a constant port match, commercial VNAs then transform the 8-term model to the conventional 12-term model (which is usually only a 10-term model by neglecting the crosstalk error terms which also do not exist in the 8-term model). The 12-term model has separate source and load port match errors for each direction. This of course, due to the larger number of unknowns, requires additional measurements: the switch terms.

The switch terms are defined as the ratio of outgoing wave and the incident wave at one port, while the other port is configured as a source. Notice that a three receiver VNA has no way of measuring them. On four receiver VNAs they are usually measured along with the thru.

An implementation of SOLR will therefore consist of several steps: First quantify the 8-term error model by measuring SOL at each port as well as the unknown reciprocal thru. Then measure the switch terms (or recall them from memory if unable to measure them on a three receiver unit). Finally convert everything to the 12-term error model. Then the DUT can then be corrected in the usual way. Unfortunately this requires a bit more implementation effort than just using a single formula.

The switch terms only depend on the test set and should not vary much over time, at least in commercial lab grade VNAs. I have checked that with my VNA, they seem to be indeed very stable.
« Last Edit: January 02, 2022, 12:59:56 am by rf-messkopf »
 
The following users thanked this post: JohnG, gf

Offline rf-messkopf

  • Regular Contributor
  • *
  • Posts: 160
  • Country: de
  • Mario H.
    • Homepage
Re: NanoVNA Custom Software
« Reply #1503 on: January 02, 2022, 01:30:11 am »
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.

As I already said in a private mail, I have it on my to do list to check Michael Hiebel's book ("Fundamentals of Vector Network Analysis", the German version from 2006 is titled "Grundlagen der vektoriellen Netzwerkanalyse").

Unfortunately, the most comprehensive and mathematically complete exposition on VNA calibration in textbook form that I know is in "Grundlagen der Hochfrequenz-Messtechnik" by Burkhard Schiek, and there is only the German original, with no English translation.
 

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11758
  • Country: us
Re: NanoVNA Custom Software
« Reply #1504 on: January 02, 2022, 01:39:25 am »
Hope you had a nice trip.  Outside of looking at that book I mention, I have not done anymore with the project.  I am hoping that walking away from it for a while will help.   You were correct about that particular book. 

Offline Alextsu

  • Contributor
  • Posts: 42
  • Country: ru
Re: NanoVNA Custom Software
« Reply #1505 on: January 02, 2022, 03:01:55 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.

As I already said in a private mail, I have it on my to do list to check Michael Hiebel's book ("Fundamentals of Vector Network Analysis", the German version from 2006 is titled "Grundlagen der vektoriellen Netzwerkanalyse").
This book does not cover the Unknown Thru method in details, as well.
Only basic information is provided
 
The following users thanked this post: rf-messkopf

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11758
  • Country: us
Re: NanoVNA Custom Software
« Reply #1506 on: January 02, 2022, 07:30:09 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.

As I already said in a private mail, I have it on my to do list to check Michael Hiebel's book ("Fundamentals of Vector Network Analysis", the German version from 2006 is titled "Grundlagen der vektoriellen Netzwerkanalyse").
This book does not cover the Unknown Thru method in details, as well.
Only basic information is provided

I suspect rf-messkopf was spot on when they wrote me about there being a market gap and it only being important to a handful of vendors and researchers.   I certainly fall into that category of just using the functions implemented in the VNA firmware.  The only tiny difference is that from starting out with such an old relic as the 8754A, there was no firmware which forced me to learn some of the basics. 

For the square wave drive, from W2AEW's comment "They do appear more and more sinusoidal above 1GHz. ",  using my old 1989, 68000 VME chassis LeCroy 7200,  I dug out a 720k floppy and sneaker net the data to the PC using CERNs software.   I wasn't sure if my USB floppy drive would read it, but no problem.   Shown is the output from the LiteVNA at 1.2GHz.  Not bad for a 32 year old scope.   :-DD

https://service-hpglview.web.cern.ch/service-hpglview/

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11758
  • Country: us
Re: NanoVNA Custom Software
« Reply #1507 on: January 04, 2022, 02:27:40 am »
...
To get rid of the assumption of a constant port match, commercial VNAs then transform the 8-term model to the conventional 12-term model (which is usually only a 10-term model by neglecting the crosstalk error terms which also do not exist in the 8-term model). The 12-term model has separate source and load port match errors for each direction. This of course, due to the larger number of unknowns, requires additional measurements: the switch terms.

The switch terms are defined as the ratio of outgoing wave and the incident wave at one port, while the other port is configured as a source. Notice that a three receiver VNA has no way of measuring them. On four receiver VNAs they are usually measured along with the thru.

...

The switch terms only depend on the test set and should not vary much over time, at least in commercial lab grade VNAs. I have checked that with my VNA, they seem to be indeed very stable.

I have included a snip from Agilent's patent 7,019,536 B1 which talks about the switch errors.     

To start, I have attached the transfer relay to the LiteVNA.   I then calibrated the unit over a range of 1-300MHz using the ideal standards and 12-term model.  After which I inserted the T-check and saved the Touchstone and calibration files.   Next I made a simple wrapper for the LabView files I sent you   allowing  me to run some basic checks without the VNA.   I have included a the snip of the switch error terms.

Also shown is a plot of the two switch terms.   

Again, I am totally clueless and there could be a lot of errors in what I have shown and the path I took for this first step.

****
It may not be clear but the reason for collecting the data for the T-Check is I expect to be able to switch from the 12-term error model to the unknown thru and get roughly the same result with it inserted.   
« Last Edit: January 04, 2022, 12:16:00 pm by joeqsmith »
 

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11758
  • Country: us
Re: NanoVNA Custom Software
« Reply #1508 on: January 04, 2022, 02:43:39 pm »
Two different Agilent patents vs Dunsmore's book.

Offline DiSlord

  • Regular Contributor
  • *
  • Posts: 108
  • Country: ru
Re: NanoVNA Custom Software
« Reply #1509 on: January 04, 2022, 10:46:26 pm »
nanoVNA-QT use libxavna

inside i found:
        if(matchedThru)
            return "Unknown thru calibration using 3 fully known one port standards"
                    " and a reciprocal thru standard. Thru standard must have "
                    "an electrical delay between -90 and 90 degrees, should be "
                    "well matched (or as short as possible), and have less than 10dB of loss. "
                    "Matching error of the two instrument ports is fully removed.";

So you can try research used Unknown thru calibration
https://github.com/xaxaxa-dev/vna/blob/master/libxavna/calibration.C
 
The following users thanked this post: joeqsmith, realfran

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11758
  • Country: us
Re: NanoVNA Custom Software
« Reply #1510 on: January 05, 2022, 12:07:18 am »
Using my test code, I tried to isolate where my problem/s are.   I suspect at least one of my problems is this one sentence from that patent.   If I use the ETF/R from the 12-term model,  I get something close to what I would expect.   

Not being skilled in the art or understanding it, coupled with errors in the various papers....   It's not all between the keyboard and chair.   

Offline rf-messkopf

  • Regular Contributor
  • *
  • Posts: 160
  • Country: de
  • Mario H.
    • Homepage
Re: NanoVNA Custom Software
« Reply #1511 on: January 05, 2022, 02:08:32 am »
Two different Agilent patents vs Dunsmore's book.

I've only been briefly looking again at Section 3.2.3 in Dunsmore's book, but the notation there seems to be consistent, and I cannot spot an obvious error in the equations.

The E00, E01, E12, E11 are the error terms of the error box at port 1 of the 8-term error model, and E22,, E23, E32, E33 of the error box at port 2, see Figure 3.3. When you want to convert from the 8-term model to the 10/12-term model, the load match errors are
\[
\begin{align*}
ELR&=E_{11}+\frac{E_{10}E_{01}\Gamma_R}{1-E_{00}\Gamma_R}=E_{11}+\frac{ERF\cdot\Gamma_R}{1-EDF\cdot\Gamma_R},\\
ELF&=E_{22}+\frac{E_{32}E_{23}\Gamma_F}{1-E_{33}\Gamma_F}=E_{22}+\frac{ERR\cdot\Gamma_F}{1-EDR\cdot\Gamma_F}.
\end{align*}
\]
That is simply equations (3.8 ) together with equation (3.11) and (3.12). So it is all there in Section (3.2.3) to convert between the 8-term and the 10/12-term model. Also, the conversion from the 10/12-term model to the 8-term model is spelled out explicitly, see equations (3.13) to (3.16).

The only notational glitch I see in that section is that Dunsmore switches between, e.g., \$E_{LF}\$ and \$ELF\$, etc., in equations (3.14) to (3.16).

Edit: I should have pointed out that \$E_{11}\$ of the 8-term error model actually is equal to \$ESF\$ of the 10/12-term model. But that is a result, not just a notational oversight. Similarly, \$E_{22}=ESR\$. See equations (3.8 ).
« Last Edit: January 05, 2022, 03:00:22 am by rf-messkopf »
 

Offline rf-messkopf

  • Regular Contributor
  • *
  • Posts: 160
  • Country: de
  • Mario H.
    • Homepage
Re: NanoVNA Custom Software
« Reply #1512 on: January 05, 2022, 02:40:47 am »
Attached are plots of the two switch terms of my VNA. Directly measured, and not calculated from the 12-term model after a full two-port calibration.

No idea what they would look like on a nanoVNA or similar kit.
 
The following users thanked this post: realfran

Offline jspencerg

  • Regular Contributor
  • *
  • Posts: 72
  • Country: us
Re: NanoVNA Custom Software
« Reply #1513 on: January 05, 2022, 05:39:40 am »
Perhaps this Agilent paper can corroborate the Equations? Paper also details a 16-term correction.  Is that a useful improvement here?
 
The following users thanked this post: Mechatrommer

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11758
  • Country: us
Re: NanoVNA Custom Software
« Reply #1514 on: January 05, 2022, 01:04:30 pm »
Two different Agilent patents vs Dunsmore's book.

I've only been briefly looking again at Section 3.2.3 in Dunsmore's book, but the notation there seems to be consistent, and I cannot spot an obvious error in the equations.

The E00, E01, E12, E11 are the error terms of the error box at port 1 of the 8-term error model, and E22,, E23, E32, E33 of the error box at port 2, see Figure 3.3. When you want to convert from the 8-term model to the 10/12-term model, the load match errors are
\[
\begin{align*}
ELR&=E_{11}+\frac{E_{10}E_{01}\Gamma_R}{1-E_{00}\Gamma_R}=E_{11}+\frac{ERF\cdot\Gamma_R}{1-EDF\cdot\Gamma_R},\\
ELF&=E_{22}+\frac{E_{32}E_{23}\Gamma_F}{1-E_{33}\Gamma_F}=E_{22}+\frac{ERR\cdot\Gamma_F}{1-EDR\cdot\Gamma_F}.
\end{align*}
\]
That is simply equations (3.8 ) together with equation (3.11) and (3.12). So it is all there in Section (3.2.3) to convert between the 8-term and the 10/12-term model. Also, the conversion from the 10/12-term model to the 8-term model is spelled out explicitly, see equations (3.13) to (3.16).

The only notational glitch I see in that section is that Dunsmore switches between, e.g., \$E_{LF}\$ and \$ELF\$, etc., in equations (3.14) to (3.16).

Edit: I should have pointed out that \$E_{11}\$ of the 8-term error model actually is equal to \$ESF\$ of the 10/12-term model. But that is a result, not just a notational oversight. Similarly, \$E_{22}=ESR\$. See equations (3.8 ).

I suspect the sprinkling of dots is an oversight but the use of terms changes for each revision.  I  tend to agree that Agilent had at least two patents that have errors.   

Maybe today I can figure out some of the art not covered by the book or the patents....

***
Actually, looking at the page you sent, your equation 3.31 is 3.36 from my copy (second edition). 
« Last Edit: January 05, 2022, 01:15:26 pm by joeqsmith »
 
The following users thanked this post: realfran

Offline realfran

  • Regular Contributor
  • *
  • Posts: 65
  • Country: gb
Re: NanoVNA Custom Software
« Reply #1515 on: January 09, 2022, 01:58:06 pm »
Yes with the new firmware Dislord has improved a lot the LiteVNA, I hope John resolve this important equation for the calibration on V3 software.
If test the new FW the noise is reduced successfully in the HI part of the frequency range.
 

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11758
  • Country: us
Re: NanoVNA Custom Software
« Reply #1516 on: January 09, 2022, 04:57:23 pm »
Sorry but I've had no luck getting the unknown thru to work.   I've thought about writing out the steps I took in layman's terms but based on the lack of responses, I doubt it would be helpful.  I've reviewed the patents and code with a few friends but it's the blind leading the blind.  The attached shows the latest software used to exorcise the calibration algorithms.   The software imports the calibration and uncalibrated touchstone files.   We can then run them through the 12-term or the unknown thru and compare the results.

I have not done any more with the Lite's new firmware as I wasn't sure where Dislord was storing it.   Now that we know that it defaults to a average where the V2Plus4 does not, it explains why it is slower and the noise may look better than what it is.   If you wanted to compare the two, you would need to consider these differences.   I also never figured out where the official archive was located.  So if I wanted  to reinstall the firmware that was shipped with the unit, today, I can't.     


Offline DiSlord

  • Regular Contributor
  • *
  • Posts: 108
  • Country: ru
Re: NanoVNA Custom Software
« Reply #1517 on: January 09, 2022, 05:43:46 pm »
Last official soft here (contain last official soft and fw):
https://zeenko.tech/litevna

My test blog on:
https://groups.io/g/nanovna-beta-test/topics

last week i also work under calibrations. Add calibration standard support (for OPEN C0,C1,C2,C3, delay, for SHORT L0,L1,L2,L3, delay, for LOAD Z0, L and C, delay, for THRU delay), not added only offset loss (due to difficult calculation for device, need use sqrt and lot of calculations) i think this not critical. I good optimize calculation and now all work in realtime.

Interesting know how you calibrate thru (i add ISOLN measure for correction, this give more good results)

Here my 70dB measure in Lite to 6.4GHz after changed calibtration alghoritm (look not bad i think, measure ~linear)
Also now i can see difference 90 (red) and 100dB (blue) attenuators on measure to 3GHz
Added work on harmonic, allow see to ~8-9GHz (yes dynamic on 8GHz not good, but possible see something)
One user test hi freq filters (see attach)
« Last Edit: January 09, 2022, 05:59:01 pm by DiSlord »
 
The following users thanked this post: Mechatrommer

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11758
  • Country: us
Re: NanoVNA Custom Software
« Reply #1518 on: January 09, 2022, 06:03:23 pm »
Last official soft here:
https://zeenko.tech/litevna

You already provided that link.  I was asking about where the archive (older releases) and the code you are working on (pre-release) are stored.   The official release has no documentation to tell users what has changed.  When you suggest you have corrected a problem, I would have no way to know if it was released or not. 

***
My test blog on:
https://groups.io/g/nanovna-beta-test/topics

Thanks for adding that link. 
« Last Edit: January 09, 2022, 06:07:34 pm by joeqsmith »
 

Offline Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11703
  • Country: my
  • reassessing directives...
Re: NanoVNA Custom Software
« Reply #1519 on: January 09, 2022, 06:42:36 pm »
Last official soft here:
https://zeenko.tech/litevna
still using peculiar BMP format.. i still read BMz and BGR tag in hex editor... i've provided standard format if its compatible to you in that thread... i'll be happy if you can still make it compatible to me, but i understand its not a compulsion to fulfill my request, thanks to you anyway. https://www.eevblog.com/forum/testgear/hugen-litevna-64-6-3ghz/msg3928667/#msg3928667
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline realfran

  • Regular Contributor
  • *
  • Posts: 65
  • Country: gb
Re: NanoVNA Custom Software
« Reply #1520 on: January 09, 2022, 08:25:21 pm »
This test FW works well on PC software (the averaging slow the process but work)
Dislord test blog on:
https://groups.io/g/nanovna-beta-test/topics
 

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11758
  • Country: us
Re: NanoVNA Custom Software
« Reply #1521 on: January 10, 2022, 12:30:11 pm »
This test FW works well on PC software (the averaging slow the process but work)
Dislord test blog on:
https://groups.io/g/nanovna-beta-test/topics

It appears they kept the list private for some reason.  I'll pass.  Hopefully they will improve the official release area to inform customers of the changes. 

Offline realfran

  • Regular Contributor
  • *
  • Posts: 65
  • Country: gb
Re: NanoVNA Custom Software
« Reply #1522 on: January 10, 2022, 01:50:25 pm »
Hello Jhon, Dislord sends you the list of addresses you can join to the beta tester, seam to me one person with your experience is beneficial for all.
Best regards.
Francesco.
 

Offline DiSlord

  • Regular Contributor
  • *
  • Posts: 108
  • Country: ru
Re: NanoVNA Custom Software
« Reply #1523 on: January 10, 2022, 03:30:02 pm »
My changelog for NanoVNA code.
LiteVNA use some code as H / H4 (not depended from hardware) after v1.0.69
Last v1.2 not finished (all work under calibrations) - so no change log yet

Also my github contain all changes for H/H4 (i also use this code for build fw for V2 / V2Plus / V2Plus4 / LiteVNA)
https://github.com/DiSlord/NanoVNA-D

PS thanks HA3HZ
« Last Edit: January 10, 2022, 03:44:01 pm by DiSlord »
 

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11758
  • Country: us
Re: NanoVNA Custom Software
« Reply #1524 on: January 10, 2022, 03:59:08 pm »
Hello Jhon, Dislord sends you the list of addresses you can join to the beta tester, seam to me one person with your experience is beneficial for all.
Best regards.
Francesco.
I never wrote a regression test to support this protocol.  Unlike the firmware supplied with my original NanoVNA, the firmware for the V2Plus4 was stable enough to use from the start.   

Because I use the PC to control the VNAs, I have little use for the majority of the features being added to the firmware.  I don't have a need for the display, buttons, switches and CF card.   As long as the firmware is stable and able to send raw data, that's really about all I need.  I view any changes that break the backward compatibility with the V2Plus4 a detriment.   Today the Lite is slower than the V2Plus4 are requires I increase my timeouts.   This may have been from the added averaging that is enable by default.   Turning off the average may increases the data rate but I am not sure if that causes other problems where a user may be expecting the V2Plus4's sample rate.  Certainly none of this is a problem for the antenna analyzer group.

If I ever sort out my calibration problems, I will download the latest firmware for the Lite and test it with my software before I make a release. 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf