Author Topic: NanoVNA Custom Software  (Read 526968 times)

0 Members and 7 Guests are viewing this topic.

Online joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11758
  • Country: us
Re: NanoVNA Custom Software
« Reply #1650 on: February 07, 2022, 01:50:26 pm »
I continued testing the entire day (12 or so hours, using the PC only) above 200MHz without a single problem.  Even with that rare step, the Lite with this version of firmware has been very stable. 

Offline realfran

  • Regular Contributor
  • *
  • Posts: 65
  • Country: gb
Re: NanoVNA Custom Software
« Reply #1651 on: February 11, 2022, 10:26:25 am »
NanoVNA V2 Plus5 $329.00 difference:Max sweep rate: Specifications:

    Frequency range: 50kHz - 4GHz
    System dynamic range:
        90dB up to 1GHz (V2 Plus4, AVG=20)
        90dB up to 1GHz (V2 Plus5, BW=1.6kHz, AVG=5)
        80dB up to 3GHz (V2 Plus4, AVG=5)
        80dB up to 3GHz (V2 Plus5, BW=1.6kHz, NO AVG)
        S11 noise floor (calibrated): -50dB (up to 1.5GHz), -40dB (up to 3GHz)
       600 points/s (V2 Plus5)
 :-DD god business
 

Online joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11758
  • Country: us
Re: NanoVNA Custom Software
« Reply #1652 on: February 11, 2022, 02:21:36 pm »
There is no mention of supporting the power setting,  solving or improving the noise when running from an external power supply.    Maybe its a firmware change.   I have no plans to purchase one.  If they made ANY changes that requires additional software updates, I will not be supporting it.   

Dislord,
When running CW, why isn't the data rate faster than with swept mode?  Is it throttled for a reason? 

Offline DiSlord

  • Regular Contributor
  • *
  • Posts: 108
  • Country: ru
Re: NanoVNA Custom Software
« Reply #1653 on: February 11, 2022, 04:14:40 pm »
Quote
When running CW, why isn't the data rate faster than with swept mode?  Is it throttled for a reason?

By default point measure look like this:
1 - set frequency, disconnect output, connect reference trace to ADC
2 - wait lock time
3 - measure reference (in this measure output disconnected)
4 - connect output, and connect reflect trace to ADC
5 - wait N*IF period time (N - integer, need for phase sync)
6 - measure Reflect
7 - connect thru trace to ADC
8 - wait N*IF period time (N - integer, need for phase sync)
9 - measure Thru
.........
repeat

In CW mode step 1-4 made only for first point.
After need hope all switch for step 5-9 good phase sync, not lost any data. On device measure i can grab data and not lost sync. On usb, possible situation then buffer full, and need wait then CPU software grab data, at this moment possible lost it, and as result get wrong phase, so CW mode disabled for USB.

Anyway, at this moment i rewrite all DSP part (i add auto gain select for all measure phases), i hope this allow little faster sweep/more dynamic range in reflect measure, and solve some more problems. But need test it more.
 

Online joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11758
  • Country: us
Re: NanoVNA Custom Software
« Reply #1654 on: February 11, 2022, 05:57:06 pm »
After our friend had posted about monitoring their heart rate and breathing, I had wondered why it would not be faster.  With you working on the firmware for the Lite, maybe you could improve it.   

It's odd that the software can not keep up.   Are you using my software or something else?   

For their heart rate experiment, it seems it was good enough but I have wanted to run similar experiments that would require a higher sample rate.   If you wanted to try sending the data up 2X, 4X, or even higher, I would certainly be willing to see if my software could keep up. 

Similar if you wanted to try and resolve the dip I see at the lower frequencies, I would certainly be willing to test it. 

***
For example showing MFSK and two chirp wave forms in sequence.  It's not a lot of data, 401 * 500 or 200,000 samples but software keeps up just fine.   
« Last Edit: February 11, 2022, 06:33:40 pm by joeqsmith »
 

Offline DiSlord

  • Regular Contributor
  • *
  • Posts: 108
  • Country: ru
Re: NanoVNA Custom Software
« Reply #1655 on: February 11, 2022, 06:15:42 pm »
You can increase sweep rate by use my debug registers.

0xE0 - for Si5351 (< 140MHz range)
0xE1 - for MAX (>140MHz)

This regisers by default = 15, set IF periods count for one measure
This mean for one point measure use 300 samples (for frequency > 400Hz, in this case one period = 20 samples, for less frequency one period 100 samples)
Average multiplie this value, so on 2xavg use 2x300 = 600 samples and so on

You can use any non zero value. !!! this registers i use for debug, so not check for 0)!!!

Use 1 allow get high sweep rate, but more noise (in this case sweep time limit only USB bus speed and wait/sync delays)

PS try use USB 2.0 port on CPU, as i see it allow get more sample rate then USB3.0
« Last Edit: February 11, 2022, 06:29:38 pm by DiSlord »
 

Online joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11758
  • Country: us
Re: NanoVNA Custom Software
« Reply #1656 on: February 11, 2022, 06:39:08 pm »
Thanks.  I will add the ability to change this setting and let you know how it works. 

My newer software supports sending the demodulated signals to the sound card.   Maybe we can do some audio. 

***
spelling
« Last Edit: February 11, 2022, 07:33:22 pm by joeqsmith »
 

Online joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11758
  • Country: us
Re: NanoVNA Custom Software
« Reply #1657 on: February 11, 2022, 07:30:58 pm »
I added manual control to these two registers.   Changing from 1 to 15 seems to have no effect on the data rate to the PC.   I tried both synthesizers at 10MHz and 200MHz.  No change (except the slower sweep rate for the lower frequency). 

I still have LiteVNA64-220127.bin firmware installed.   Does the released code support it?   Do I need to be in a certain state before changing the registers for them to take effect?   

Offline DiSlord

  • Regular Contributor
  • *
  • Posts: 108
  • Country: ru
Re: NanoVNA Custom Software
« Reply #1658 on: February 11, 2022, 08:13:04 pm »
Hmm, i write to E0 (send 0x20 0xE0 0x01)

And get ~660 samples/sec sweep on 1xavg in < 400k range

Here is my last beta, in it i rewrite DSP part, now for all measures select best gain (before only for thru).
Also  must get little less noise floor and more linear thru measure on hi frequency, but this still beta, i want add more fixes.
 

Online joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11758
  • Country: us
Re: NanoVNA Custom Software
« Reply #1659 on: February 11, 2022, 08:26:13 pm »
It's very possible it's on our side.    At 10MHz, I was seeing an update rate of 1000ms for 401 data points, 1 avg at 10MHz.   Writing a one to E0, I still see 1000ms.   I'll try your current firmware. 

Online joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11758
  • Country: us
Re: NanoVNA Custom Software
« Reply #1660 on: February 11, 2022, 09:01:36 pm »
With the new firmware installed, it seems to speed it up about 100ms.   

If you turn off S11 and only send the S21 data, could you then skip all the delays?   Do you have have another debug register to select what data comes back? 

Offline DiSlord

  • Regular Contributor
  • *
  • Posts: 108
  • Country: ru
Re: NanoVNA Custom Software
« Reply #1661 on: February 11, 2022, 09:31:13 pm »
Yes, this is one of the features that I would like to add (for version H / H4 this feature is available), this allow near x1.5 faster sweep.
 

Online joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11758
  • Country: us
Re: NanoVNA Custom Software
« Reply #1662 on: February 11, 2022, 09:44:51 pm »
That would be a worthwhile change.   50% increase but half the data, hard to believe any of the existing software would have a problem.   Let me know if you want to try it. 

Online joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11758
  • Country: us
Re: NanoVNA Custom Software
« Reply #1663 on: February 12, 2022, 02:00:24 am »
This is as fast as the Lite will run with your test code and my software seems to have no problem keeping up.   It seems there is a bit of phase error in the sampling as well.   

Offline DiSlord

  • Regular Contributor
  • *
  • Posts: 108
  • Country: ru
Re: NanoVNA Custom Software
« Reply #1664 on: February 13, 2022, 01:48:29 pm »
I see onboard speed increase (visually) but max speed i can get in CPU software ~800 points/sec (in theory by timings i must get near 2000-3000).

I see x1.5 increase on one data measure (S11 or S21), but as before limit near 700-800 (not depend from internal measure speed, limits in current USB exchange format).

You can try this:
write in 0x44 register 1 allow get only S11 data (exchange protocol not change, S21 data conatain garbage)
write in 0x44 register 2 allow get only S21 data (exchange protocol not change, S11 data conatain garbage)

Current settings (not need use debug registers 0xE0 and 0xE1) allow get max speed in only S11 or S21 measure on 1xAVG, as i can see near 800 points/sec (1.2ms for one point in your software)
 

Online joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11758
  • Country: us
Re: NanoVNA Custom Software
« Reply #1665 on: February 13, 2022, 11:41:13 pm »
Thanks for the update.  I tried it and it seems to work as suggested.  Not stated but setting to 0 will reset the mode to S11 and S21 data.   I tried comparing USB 3 and 2 ports but saw no difference.  My PC seems a fair bit slower than yours so I suspect there is a way I could further speed up my software by using the read FIFO command (0x18,AA,NN).   Since getting the V2+4, I have always set NN to 1.  Each call the index will increment as expected.   Setting NN to 2 for example,  I will get the two packets but they are identical.   Not just the same index but the same payload.   I always assumed this was a bug and just ignored it but suspect if this were to work, I could reduce the overhead a fair amount. 

I send 0x18, 0x30, 0x01 for every data point.  I would expect I could send 0x18, 0x30, 0x02  and receive two data points but it doesn't appear to work this way.   


***
That was a problem on my end.  I forgot to index the array...   :palm:

Anyway, seems to work fine but sadly, no gains.   With USB 3.1, 800 points, 200MHz CW, 1 Avg, S21 only, it takes about 1.23 seconds (1.53ms/point or 650Hz sample rate).     Sending both S21 and S11 requires 1.36 seconds.   I can disable all the features except the showing the raw data and the time is not improved.   Sending both with USB 2.0  requires 1.46 seconds.   

It's only 167kbps sustained.    In your case, a couple hundred kbps, but I am not sure why.   You have a faster Lite?  Hardly seems like the PC is the bottleneck.   

***
Using NN > 1 does seem to deduce the phase error.   Shown is about an hour of data.

***
If I throttle the PC read thread.  This is the thread sending the read FIFO commands, the index will start to skip.   So, if the software can't keep up, we will not see incrementing indexes.   
(not true, always seems to increment regardless.  Breakpoint in wrong spot)

At these low data rates, I could use a couple of USB / TTL or RS232 adaptors and write a simple Lite simulator.   Maybe send test patterns.  From this we could sort out at what speed LabView can't not keep up. 

On the firmware side, you could also try making a simple debug version that just sends up a pattern.   Even a simple counter with checksum should be good enough.  If the problem is getting the data out of the Lite,  what do you think about only sending the data that is being requested? 

I'm only considering CW.   
 
« Last Edit: February 14, 2022, 05:29:25 am by joeqsmith »
 

Online joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11758
  • Country: us
Re: NanoVNA Custom Software
« Reply #1666 on: February 14, 2022, 04:00:37 pm »
Looking at the USB comm port adapters I have, none are very fast.   I could achieve maybe 5X faster but I suspect not enough to stress the software.

It's not really an apples to apples compare but I own a Signal Hound BB60C spectrum analyzer that uses USB 3.   They offer an API that allows access to the IQ data.    I made a demo video where I used LabView to collect the signal from a 900MHz radio (a DMM I own) and convert it to the meter's readings. 

https://signalhound.com/products/bb60c/




I don't own any other equipment that uses USB but I have used LabView to interface with some Ethernet devices also at much higher data rates without any problems.   

Offline DiSlord

  • Regular Contributor
  • *
  • Posts: 108
  • Country: ru
Re: NanoVNA Custom Software
« Reply #1667 on: February 14, 2022, 06:32:05 pm »
Found problem, now you can get max speed (i can get ~2600 points/sec if use E0/E1 = 1, avg = 1, and get only S11 data 0x44 = 1, this speed close to current limit)

Also now on device calibrate i use only one channel measure (S11 for SOL, and S21 for ISOLN/THRU) - so calibrate sweep ~x1.5 faster.

But need understand use E0/E1 change measure RBW - so use less value increase noise, increase this value reduce it.
Final RBW depend from E0/E1 * AVG, bigger value reduce RBW and decrease noise, but increase sweep speed.

PS i see only 1000 points/sec on USB3 port and 2600 points/sec on USB2, look like USB3 ask for data only every 1ms
« Last Edit: February 14, 2022, 07:31:59 pm by DiSlord »
 

Online joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11758
  • Country: us
Re: NanoVNA Custom Software
« Reply #1668 on: February 14, 2022, 08:45:56 pm »
 :clap:

That's fast!  800 data points is about 160ms or roughly 5KHz on USB3.x port.    Screen shot showing me running Flippers Lite a couple thousand miles away.  Their PC only has 3.x ports.   I tried enabling both VNA ports and it made little difference on the data rates.   

I'll play around with it using my setup but this is very much what I was expecting.   Thanks for taking the time to look into this.

Online joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11758
  • Country: us
Re: NanoVNA Custom Software
« Reply #1669 on: February 14, 2022, 09:01:59 pm »
Quote
0xE0 - for Si5351 (< 140MHz range)
0xE1 - for MAX (>140MHz)

This regisers by default = 15, set IF periods count for one measure
This mean for one point measure use 300 samples (for frequency > 400Hz, in this case one period = 20 samples, for less frequency one period 100 samples)

Average multiplie this value, so on 2xavg use 2x300 = 600 samples and so on

Can you maybe reword the above or provide more details about where these number come from and what they mean? 

Offline DiSlord

  • Regular Contributor
  • *
  • Posts: 108
  • Country: ru
Re: NanoVNA Custom Software
« Reply #1670 on: February 14, 2022, 09:29:55 pm »
This related to DSP processing

VNA measure IF data after mixer
Use ADC for this, on LiteVNA used 600k sample rate (V2Plus/V2Plus4 use 1.5M sample rate, but after decimate?)
After used sin/cos table for calculate signal I/Q data
Table period depend from used IF
For signal >400k used 60k IF and 10 samples for one period table (if use 60k on less frequency you start see artefacts on IF harmoincs)
For signals > 20k and less 400k used 12k IF, but use bigger table - and this reduce sweep speed (you can see artefacts on 24k, 36k and so on)
For signals < 20k used 6k IF, and this more slowdown

More IF periods pass in DSP - result less RBW in measure, less noise, but need more time.

E0 - periods count for Si generator ( < 100MHz) for one measure, after this multiplie by AVG settings
E1 for MAX generator ( > 100 MHz)

You can see how this work, connect generator to CH1, set 30MHz output, and measure S21 logmag in 30MHz and span 30k, change AVG or E0 settings and see filter width

E0 = 6 and AVG = 1 give RBW = 10k (60k IF / (6 * 1))
E0 = 60 and AVG = 1 give RBW = 1k (60k IF / (60 * 1))
And so on

Default E0/E1 = 15, this give on 1xAVG RBW = 60k/15 = 4k
 
The following users thanked this post: joeqsmith, realfran

Online joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11758
  • Country: us
Re: NanoVNA Custom Software
« Reply #1671 on: February 15, 2022, 06:02:05 am »
Here's Dislord's latest rocket powered firmware in action .... so fast!!   



It will be interesting to see if any of it makes it into the release code.   If it does, I will go ahead and clean up my software to support it. 

Thanks for all your help.     

Offline realfran

  • Regular Contributor
  • *
  • Posts: 65
  • Country: gb
Re: NanoVNA Custom Software
« Reply #1672 on: February 15, 2022, 10:31:04 am »
I sed before Joe; you can make with your software one gadget to one  instrument:-+
Thank you Dislord@ to share your precious information from your great work on this firmware.
I hope to get the V.3 I'm very anxious about it.
 

Online joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11758
  • Country: us
Re: NanoVNA Custom Software
« Reply #1673 on: February 15, 2022, 03:01:21 pm »
I hope to get the V.3 I'm very anxious about it.

You're not alone.  Its been a while since I've received any colorful emails but an radio hobbyist PMed the other day.  They felt the need to need to let me know they are upset about my not releasing it.   They did make me aware of how important their time was.     Apparently they didn't like the "tone" of my responses.   :-DD   

Offline realfran

  • Regular Contributor
  • *
  • Posts: 65
  • Country: gb
Re: NanoVNA Custom Software
« Reply #1674 on: February 15, 2022, 04:23:12 pm »
I don't flatter person but appreciate your work and when you release the software version I go to use,  for the ""tone" of your response same time luck sarcastic or dray but is your character possible is your sense of humour this not change the fact I appreciate your labour and the experience of it.  :-DD
« Last Edit: February 15, 2022, 04:30:13 pm by realfran »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf