Author Topic: NanoVNA Custom Software  (Read 553100 times)

0 Members and 4 Guests are viewing this topic.

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11969
  • Country: us
Re: NanoVNA Custom Software
« Reply #2025 on: April 23, 2022, 11:46:56 pm »
They do have their big parties and conferences if that's your thing.   


Offline Kosmic

  • Super Contributor
  • ***
  • Posts: 2554
  • Country: ca
Re: NanoVNA Custom Software
« Reply #2026 on: April 24, 2022, 12:37:53 am »
And apparently nobody's working during the weekend. Their website is down since yesterday  :-DD

 

Offline DiSlord

  • Regular Contributor
  • *
  • Posts: 109
  • Country: ru
Re: NanoVNA Custom Software
« Reply #2027 on: April 24, 2022, 09:23:26 am »
Quote
Why does the LiteVNA shift up and down near 750MHz?
I think this related to MAX2871 switch
MAX2871 can generate in 3G-6G range, less frequency get from divide on 2, 4, 8, ....
750M - result 3G / 4 (at this point switch from 6G/8 to 3G/4)

Check 375M, 1.5G, 3G frequency

PS i not see this on my LiteVNA
« Last Edit: April 24, 2022, 09:31:02 am by DiSlord »
 

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11969
  • Country: us
Re: NanoVNA Custom Software
« Reply #2028 on: April 24, 2022, 01:14:42 pm »
Quote
Why does the LiteVNA shift up and down near 750MHz?
I think this related to MAX2871 switch
MAX2871 can generate in 3G-6G range, less frequency get from divide on 2, 4, 8, ....
750M - result 3G / 4 (at this point switch from 6G/8 to 3G/4)

Check 375M, 1.5G, 3G frequency

PS i not see this on my LiteVNA

I'm not sure how I would test it at other frequencies (outside of constructing unique tank test circuits).    I'm not surprised you were unable to replicate it.  It appears to be a very unique case.

Injecting an RF generator into port2 sweeping the signal looking at the peak, first we cut the problem in half (removing the drive side) but I do not see the step.    I tried using a step attenuator to see if I could replicate it on a wider range or just at the 750MHz, no luck. 

I can tune the LC tank off that 750MHz (lower to 700MHz) and the step will go away.    The problem appears related to that 750MHz and appears to require a changing amplitude signal to replicate it.   

I tried to reduce the drive strength one level and the step goes away.   I then placed a step attenuator in series with the LC tank and again lowering the  signal causes the step to go away. 

I wonder if that high Q tank is causing some problem but only at certain frequencies.  Really strange.    Maybe one of the RF gurus can replicate it. 

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11969
  • Country: us
Re: NanoVNA Custom Software
« Reply #2029 on: April 24, 2022, 01:20:48 pm »
And apparently nobody's working during the weekend. Their website is down since yesterday  :-DD

When I tried, it appears it was a planned outage.

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11969
  • Country: us
Re: NanoVNA Custom Software
« Reply #2030 on: April 24, 2022, 02:02:24 pm »
Testing a tank at 350MHz, we can see the same step.  What is interesting is as I reduce the drive, the location of the steps narrows (move closer to the peak).   

***
I would show you this without the PC attached but I find it very difficult to scale what is on the screen.
« Last Edit: April 24, 2022, 02:04:56 pm by joeqsmith »
 

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11969
  • Country: us
Re: NanoVNA Custom Software
« Reply #2031 on: April 24, 2022, 03:19:04 pm »
Showing a higher Q tank with the same resonance as the last one (yellow trace).   As we change the span from 100MHz down to 20MHz, we can clearly see the steps in the phase. 

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11969
  • Country: us
Re: NanoVNA Custom Software
« Reply #2032 on: April 24, 2022, 03:46:05 pm »
Zooming into the step.   (Note, I changed the delay slightly to show it is not as some unique phase point).     
« Last Edit: April 24, 2022, 03:48:16 pm by joeqsmith »
 

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11969
  • Country: us
Re: NanoVNA Custom Software
« Reply #2033 on: April 24, 2022, 05:15:05 pm »
The more I looked into it, it appeared to be tied to the fact it's a high Q rather than the frequency it is running it. 

Shown with a Q of around 40 at 225MHz.   

The second plot showing the exact same settings and same LC tank circuit.  I have removed the two protection diodes on the front end. 

Makes sense now.   

Offline DiSlord

  • Regular Contributor
  • *
  • Posts: 109
  • Country: ru
Re: NanoVNA Custom Software
« Reply #2034 on: April 24, 2022, 08:08:06 pm »
I think you see gain step. V2 models use fixed gain settings for various ranges. This not allow get good resolution.

My last firmware changes - add AGC mode.
Exist one problem - not possible get perfect results on switch step due nonlinearity OpAMP gain. On V2 you also have this errors but not visible (you can see this near 140MHz on V2 most big jump and on 100MHz on Lite).

On start i made gain calibration (you can see it on DMSG screen as GAIN0-GAIN3) on fixed frequency.

How big step you see? My results near 0.01 to 0.05dB i thin this not critical
« Last Edit: April 24, 2022, 08:11:57 pm by DiSlord »
 

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11969
  • Country: us
Re: NanoVNA Custom Software
« Reply #2035 on: April 24, 2022, 11:39:04 pm »
>>How big step you see? My results near 0.01 to 0.05dB i thin this not critical

With last tank, 0.043 dB.  About  1 deg of phase error.  Of course -1/2pi*dP/dF..  That one degree phase step causes some pretty large spikes in the group delay.   I tend to agree.  Its a low cost unit and there's nothing really critical.  It's more just something to be aware of.   

I am still using the same firmware from Feb.  If you would like me to try a different version just post a link.     

Offline DiSlord

  • Regular Contributor
  • *
  • Posts: 109
  • Country: ru
Re: NanoVNA Custom Software
« Reply #2036 on: April 25, 2022, 04:21:43 am »
No, in this case you must see only amplitude sift (related to errors in gain), phase shift?

I for change AGC need time (near 4 IF periods), possible signal phase change in time? If you reduce IFBW phase shift change?
 

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11969
  • Country: us
Re: NanoVNA Custom Software
« Reply #2037 on: April 25, 2022, 01:15:23 pm »
No, in this case you must see only amplitude sift (related to errors in gain), phase shift?

I for change AGC need time (near 4 IF periods), possible signal phase change in time? If you reduce IFBW phase shift change?

The first post, I show the lite stand alone, zoomed in to show the phase shift.
https://www.eevblog.com/forum/rf-microwave/nanovna-custom-software/msg4134577/#msg4134577

Changing the IFBW from 4k to 400Hz has no effect other than taking longer to acquire. 

I posted a 3d plot showing how indeed the reported phase does change with time.  However, it's a simple LC tank circuit.  So the circuit it self it not changing to cause it.

Things that appear to have an effect:

Q
Loss in the loose coupling
Drive strength
Protection diodes

Offline ee1993

  • Newbie
  • Posts: 5
  • Country: us
Re: NanoVNA Custom Software
« Reply #2038 on: April 25, 2022, 06:35:47 pm »
Joe’s software is excellent for interactive bench work.  Can it be adapted to work as part of an automated test system?  I could probably use an autohotkey script to push buttons and save data files but a direct API or SCPI commands would be more versatile.

One possible use case would be to characterize an LC tuner design over a range of its possible LC combinations; It could then be used for load pull testing (without the VNA).  After setting each LC step, trigger the VNA to sweep and then store the S Parameters.  A typical autotuner can have up to ½ million possible combinations, so maybe take about 1000 streps.  For load pull, set perhaps an  8:1 VSWR and step phases through a full cycle.
 

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11969
  • Country: us
Re: NanoVNA Custom Software
« Reply #2039 on: April 25, 2022, 11:34:02 pm »
Joe’s software is excellent for interactive bench work.  Can it be adapted to work as part of an automated test system?  I could probably use an autohotkey script to push buttons and save data files but a direct API or SCPI commands would be more versatile.

One possible use case would be to characterize an LC tuner design over a range of its possible LC combinations; It could then be used for load pull testing (without the VNA).  After setting each LC step, trigger the VNA to sweep and then store the S Parameters.  A typical autotuner can have up to ½ million possible combinations, so maybe take about 1000 streps.  For load pull, set perhaps an  8:1 VSWR and step phases through a full cycle.

Seeing that it is written using software that was specifically developed for test automation, the answer is yes.  I've also demonstrated some experiments where I have integrated other peripherals with the software to automate some of my experiments, for example:
https://youtu.be/XaYBpPCo1qk?t=4251

That said, I am guessing the easiest route would be to start with one of the many open source programs and just tailor it to fit your requirements.  I would start by making sure that what ever low cost VNA you plan to use is capable of making your measurements.   

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11969
  • Country: us
Re: NanoVNA Custom Software
« Reply #2040 on: April 26, 2022, 11:26:05 pm »
Showing the raw real and imaginary int32 values of channel 1. 

Offline ee1993

  • Newbie
  • Posts: 5
  • Country: us
Re: NanoVNA Custom Software
« Reply #2041 on: April 27, 2022, 02:30:25 pm »
I prefer to program with LabView.  However, i can likely work with the VNA-qt Python source to expose some controls to LabView. 
 

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11969
  • Country: us
Re: NanoVNA Custom Software
« Reply #2042 on: April 27, 2022, 09:30:27 pm »
I prefer to program with LabView.  However, i can likely work with the VNA-qt Python source to expose some controls to LabView. 

Another option would be to just write your own custom application.  The interface is a simple serial port so really, not much effort there.   Dislord has provided us with a lot of details beyond the basics depending on what you are trying to do.  That was a big help for me.   

With the downfall of National Instruments,  you may want to consider something other than LabView, especially if you start from scratch.   

If you do get some sort of load pull working with the NanoVNA, please take the time post about it.   Maybe provide a link here.  I would be very interested in seeing what you come up with.

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11969
  • Country: us
Re: NanoVNA Custom Software
« Reply #2043 on: April 27, 2022, 10:30:27 pm »
Dislord,

After much more testing, I now believe this step is indeed a firmware problem.   I had looked at the signals with a scope and it just made no sense that removing the diodes would have anything to do with it but lowering the amplitude does.  I realized then that I had different firmware in the second unit.

I then upgraded the 2nd Lite to the same firmware and indeed the step shows up.  So both VNAs behave the same.   

As it turns out, the three released versions of firmware that I have from 220127 and older do not exhibit the step.    The version from 220225 does.  This was the last version I had downloaded.   

I had saved the Beta versions you had uploaded here as well.  The one from 220213 exhibits the step.  So does the one from 220211.   

So it appears what ever the problem is, it happened between Jan 27 and Feb 11.   Afraid I can't narrow it down any further for you.   Because you are unable to replicate the problem, if you have versions between these two that you would like me to try, just let me know. 

***
I noticed a new release 220228.  This version also exhibits the step problem.   
« Last Edit: April 28, 2022, 12:12:11 am by joeqsmith »
 

Offline DiSlord

  • Regular Contributor
  • *
  • Posts: 109
  • Country: ru
Re: NanoVNA Custom Software
« Reply #2044 on: April 28, 2022, 03:55:54 am »
You see gain step change. Older firmware use one gain setting for measure reflect data. Last use auto gain (depend from measured level).

And difficult question where is more correct measure. If use one gain settings you not see step, but error also present (you see smooth data)
Use AGC allow better measure low level signals on reflect.
 

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11969
  • Country: us
Re: NanoVNA Custom Software
« Reply #2045 on: April 28, 2022, 01:10:00 pm »
You see gain step change. Older firmware use one gain setting for measure reflect data. Last use auto gain (depend from measured level).

I suspect there may be a language problem.    Attached, I am looking at S21 transmitted data.    After installing firmware 220224,  I will see the step.   
  No calibration has been performed at this time.   The VNA will display the step as I have shown.   This step is not the reflected data.  Looking at the raw channel 0 integers, I do not see the step in the incident or reflected data.     

What is this gain setting you are referring to?   How do you calculate it?   What are you actually changing?  Output power of synthesizers based on frequency?   

And difficult question where is more correct measure. If use one gain settings you not see step, but error also present (you see smooth data)
Use AGC allow better measure low level signals on reflect.

Please explain this AGC algorithm in detail.  Again, what ever it is you are doing causes a problem when looking at the transmitted S21 data.   

When connected to the PC,  I expect the VNA to always send raw data. 

Offline DiSlord

  • Regular Contributor
  • *
  • Posts: 109
  • Country: ru
Re: NanoVNA Custom Software
« Reply #2046 on: April 28, 2022, 05:43:28 pm »
Before the signal is measured, it is amplified by an operational amplifier that has 4 gain levels.

If the level of the measured signal is low, the amplifier switches to a higher gain level. Later this is taken into account in the calculations. But it is rather difficult to connect all gain levels exactly, since the gain is not quite linear.

Using gain switching allows you to measure weak signals with higher resolution.
For example, without amplification, the signal has a level on an 8-bit ADC of 10 out of 2000, and using analog gain it can be raised to 1000 out of 2000
 

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11969
  • Country: us
Re: NanoVNA Custom Software
« Reply #2047 on: April 28, 2022, 06:12:12 pm »
That's helpful to know.   So the drive level remains constant.   

Is this done for all ADC measurements?   You mention the reflect but I assume it is for all measurements.   

How do you handle glitches in the data?   Do you have a fixed switch point and some level of hysteresis?   Seeing how the signal looked like it was bouncing between states, it looks like a hard switch point.   

Do you have a way that I can override the AGC with one of the debug registers?  Maybe an enable bit as well as manual control of the gain stage.   If so,  I would like to try running a few tests on it.

Offline DiSlord

  • Regular Contributor
  • *
  • Posts: 109
  • Country: ru
Re: NanoVNA Custom Software
« Reply #2048 on: April 28, 2022, 07:24:00 pm »
AGC use for reflect and thru measures. Forward use predefined constant level depend from frequency range (AGC not need, forward signal always constant)

Older firmware use limited AGC for thru measures

How i made it:
I measure min/max value in one IFBW period and if i see low signal i switch to more high gain level. If i see overflow i reduce gain. After restart measure. For apply correct gain i need only one period.

Older firmware made full measure and after this apply gain and restart (and only for thru measures).

How this calibrated (on all fw versions):
Used fixed frequency, and measure forward signal in all gain levels. After this data normalised to 0 level.
you can see it in CONFIG->DMSG as GAIN0 to 3

You can manual control gain level by:
0xE8 - reference gain
0xE9 - Reflect gain
0xEA - Thru gain

0 to 3 used this value, 4 use AGC
!! you can get overflow if use high gain settings
« Last Edit: April 28, 2022, 07:28:35 pm by DiSlord »
 

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11969
  • Country: us
Re: NanoVNA Custom Software
« Reply #2049 on: April 28, 2022, 07:30:12 pm »
If I set these registers, how do I tell your firmware not to change them?   If there a way to turn off the AGC algorithm?


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf