Author Topic: NanoVNA Custom Software  (Read 462515 times)

0 Members and 3 Guests are viewing this topic.

Offline ALW

  • Contributor
  • Posts: 33
  • Country: fr
Re: NanoVNA Custom Software
« Reply #1225 on: August 09, 2021, 08:55:11 pm »
Your remark about prepending array size put me right on track  :-+
I guess it goes like: Uint size, frequencies, Uint size, Ch1 complex, etc.
I started with VSWR too, was fun to try-and-error a Vivaldi out of copper tape. When the Smith chart shows a bit too much inductance, cut some tape and make the coupling capa larger... Works like a charm, got the SWR below 1.2 in the entire 2.4 G ISM band  (need  directional antennas for the radar). Now I have the rough shape, will cut it out of copper sheet and put it in a can (side lope suppression) to reduce direct path reception.
Its amazing what this little thing can do, but your software is definitively the icing on the cake. Reference subtraction, all the options for stimulus, automatic marker placement, ... incredible.  :-+ :-+ :-+ :clap:
« Last Edit: August 09, 2021, 09:31:45 pm by ALW »
 

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11708
  • Country: us
Re: NanoVNA Custom Software
« Reply #1226 on: August 09, 2021, 09:35:31 pm »
In the case of this software, I've used Touchstone which isn't going to work for cases like this where we want to look at continuous sweeps.   If I need to interface with another program, I will normally use CSV.  Normally when I want to look at the trends (for example watching how the wife's nail polish cures), I just load it into that 3D viewer.   It slices up the data by sweeps over time.   Besides surface, you can also select scatter plots.   

In your case, you need to know how many samples make up a single sweep, then parse the data.  Easy enough to look for the frequency to repeat.   

Offline ALW

  • Contributor
  • Posts: 33
  • Country: fr
Re: NanoVNA Custom Software
« Reply #1227 on: August 09, 2021, 09:48:18 pm »
Nail polish curing control by RF  :-DD You made my day!
I am planning to fft the sweep data and then digitally filter out a certain radar range / frequency window. Then look at phase shift in this window.
It's late here now, with the hexeditor I do understand the structure of the file now. The sample number seems to be written in front of each data block as UINT32. Will try to read the binary tomorrow.
« Last Edit: August 09, 2021, 09:54:20 pm by ALW »
 

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11708
  • Country: us
Re: NanoVNA Custom Software
« Reply #1228 on: August 09, 2021, 10:45:35 pm »
Just copy the file and unzip it.  It will prompt you for a binary input file and a CSV output file. 

Output will be freq(Hz), real,img,real,img


2360000000.000000,0.454178,0.164357,-0.000022,-0.000037
2360050000.000000,0.454497,0.164947,0.000059,-0.000095

****
Moved to Github
« Last Edit: August 10, 2021, 01:24:13 am by joeqsmith »
 
The following users thanked this post: ALW

Offline ALW

  • Contributor
  • Posts: 33
  • Country: fr
Re: NanoVNA Custom Software
« Reply #1229 on: August 09, 2021, 10:56:20 pm »
Wow. I am speechless. I owe you a case of good beer or a good bottle of Bordeau, your choice! Thank you so much. Will try to make that happen with my next trip to the US!
You saved me a day of programming, min...
Tomorrow I will use your translator. Cheers
 

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11708
  • Country: us
Re: NanoVNA Custom Software
« Reply #1230 on: August 09, 2021, 11:07:17 pm »
 :-DD  If I showed you the software in LabView, you would laugh.  This was maybe 10 minutes of work, really!   Of course, it also looks like a 10 minute program.  Let me know how it works out.   

Offline ALW

  • Contributor
  • Posts: 33
  • Country: fr
Re: NanoVNA Custom Software
« Reply #1231 on: August 09, 2021, 11:19:47 pm »
Doesn't matter how long it took you. I am using your software, and now you're even cooking extra dishes...
I tried it of course right away, with data where I recorded the radar echo from my body. Raw data already show some action in a certain frequency band which probably translates to a range distance. Now it is 1am here and I need to get some sleep. Thanks and I will keep you posted on my adventures...
 

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11708
  • Country: us
Re: NanoVNA Custom Software
« Reply #1232 on: August 10, 2021, 01:23:22 am »
Good to hear it may do what you need.   I have created a branch named Utilities and have included the EXE there as others may find it helpful.   I made a small change where it now just asks for the binary file and will use the same name for the output but with the CSV extension. 

***
Almost forgot, 

https://www.eevblog.com/forum/rf-microwave/fingernail-polish-and-rf-front-ends-do-they-mix/msg3079836/#msg3079836
« Last Edit: August 10, 2021, 01:35:06 am by joeqsmith »
 

Offline ALW

  • Contributor
  • Posts: 33
  • Country: fr
Re: NanoVNA Custom Software
« Reply #1233 on: August 10, 2021, 11:00:58 am »
Now with your tool removing any of my lame excuses the old brain is fuming with complex calculus...

A humble suggestion for the user interface of your SW if I may. I find it all super self explaining, except what was confusing to me was that there are two separate stimulus ranges/modes: the first one center/span, the second min/max. If you click on either of these titles or numbers, you activate that range. Only visible by the freq scale in the graphs, not where you click.
And when you load a calibration, it (reasonably) activates the min/max range that was active during that calibration, I find very cool, after I got it :o.
So if I may suggest to draw a frame around each of the two stim range value blocks and somehow indicate which one is currently active, would help dummies like myself. Took me a while to figure this out, I inadvertently switched stim freq range more than once. You wrote about it somewhere in the manual, but it is a bit hidden in the deep.
« Last Edit: August 10, 2021, 11:23:25 am by ALW »
 

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11708
  • Country: us
Re: NanoVNA Custom Software
« Reply #1234 on: August 10, 2021, 02:41:43 pm »
Wow, that looks like total ass.  I assume that is on your 10" Surface Pro.   If you don't change the settings
Quote
Select "High DPI scaling override" option "System (enhanced)"
, is is still mangled up like this? 

Quote
except what was confusing to me was that there are two separate stimulus ranges/modes: the first one center/span, the second min/max.
It's not that simple.  There is also CW and segmented sweeps.  For segmented, there is quasi log and linear.    In segmented, the Span will have a different purpose and the order that the data is entered will become very important.    In some cases the transmission graph will not reflect the current sweep range. 

I have no doubt that all of these settings can pose a huge problem for the random button pusher who just wants to try things without taking the time to learn how they work.  I fully understand that we are living in the age of expertise.   I doubt very much that adding a simple box around a few widgets will do anything to help and may even further confuse this group.   Not to mention, a change like this needs to be tested, documented and maintained.   

Quote
You wrote about it somewhere in the manual, but it is a bit hidden in the deep.
No doubt that manual is very sparse and non-professional.  Your dealing with a home project, not a commercial product.

Good book on the subject:
« Last Edit: August 10, 2021, 02:43:14 pm by joeqsmith »
 

Offline ALW

  • Contributor
  • Posts: 33
  • Country: fr
Re: NanoVNA Custom Software
« Reply #1235 on: August 27, 2021, 05:29:32 pm »
Joe, thanks a lot again. Got it to work. Using your software recording breathing and heartbeat with RADAR using a NanoVNA V2+4. I transmitted CW 2.4 GHz using my makeshift Vivaldi antenna at port 1, receiving the reflected wave (doppler effect for movement of my chest wall) with a simple stub at port 2. Calculated phase of S21 with atan2(i,r). Range was about 1 m.
Pics:
Setup

Unfiltered moving in, three breath, holding breath, three breath, moving out.

filtered with a 3 Hz lowpass, showing the heartbeat. Same data.
« Last Edit: August 27, 2021, 07:00:29 pm by ALW »
 
The following users thanked this post: joeqsmith, harrimansat, horo

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11708
  • Country: us
Re: NanoVNA Custom Software
« Reply #1236 on: August 27, 2021, 11:48:13 pm »
Thanks for the update.   It's maybe the most bizarre use of a VNA I have come across.

I am still curious about the poor front panel layout being tied to your scaling settings.  If you turn that off, does everything look lined up, buttons the same size, no over lap....     I suspect that it causes the OS to choose a different font which is causing the alignment problems.     

Offline ALW

  • Contributor
  • Posts: 33
  • Country: fr
Re: NanoVNA Custom Software
« Reply #1237 on: August 28, 2021, 10:51:41 am »
Hi Joe,
would you have an idea what the actual sampling rate is when recording raw CW data with the V2+4 and if it can be changed without going into the firmware?
Edit: I noticed that when I reduce in your SW / CW mode the "Points" to 20 the refresh of the SW gets very fast, when I reduce it further it does not accept any input anymore, seems too busy refreshing the graphs and numbers, need to kill it with task manager. I did not see any difference when I changed the "Sam/Dec" entry.

(As for my scrambled screenshot since I know most labels by heart now I do not need geezer glasses anymore and went back to the original un-garbled magnification)
My application is not so bizarre for a medical person, since it can measure vital parameters without touching the patient and from a distance through clothing and bedding. Medically extremely valuable...
Cheers
Albrecht
« Last Edit: August 28, 2021, 02:15:14 pm by ALW »
 

Offline harrimansat

  • Regular Contributor
  • *
  • Posts: 210
Re: NanoVNA Custom Software
« Reply #1238 on: August 28, 2021, 11:25:52 am »
Joe, thanks a lot again. Got it to work. Using your software recording breathing and heartbeat with RADAR using a NanoVNA V2+4. I transmitted CW 2.4 GHz using my makeshift Vivaldi antenna at port 1, receiving the reflected wave (doppler effect for movement of my chest wall) with a simple stub at port 2. Calculated phase of S21 with atan2(i,r). Range was about 1 m.
Pics:
Setup

Unfiltered moving in, three breath, holding breath, three breath, moving out.

filtered with a 3 Hz lowpass, showing the heartbeat. Same data.

There´s some firmware for plus with CW?
Can you please tell me wich?

Thanks
 

Offline ALW

  • Contributor
  • Posts: 33
  • Country: fr
Re: NanoVNA Custom Software
« Reply #1239 on: August 28, 2021, 11:29:01 am »
The V2+4 standard firmware can do CW. https://nanorfe.com/nanovna-v2-user-manual.html "Zero span". I am using stock FW 1.2 it came with. In Joe's SW you can simply select/enter a CW frequency, it will do CW and even record the raw data. Only thing I couldn't figure out so far is the sample rate and whether it can be manipulated with the number of point settings

Edit: FW version on display git-20210538-412578c
Even standalone you have an entry in the menu "stimulus" "CW FREQ"
« Last Edit: August 28, 2021, 11:37:58 am by ALW »
 

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11708
  • Country: us
Re: NanoVNA Custom Software
« Reply #1240 on: August 28, 2021, 04:02:11 pm »
I suspect it's the OS changing the fonts.  One of the problems when distributing LabView code is the various PCs may not have the same fonts loaded.  You would think it would include the required fonts when installing the software but I suspect some fonts are protected by license.   To work around it, it's best to use fonts that are the most common.

Your question about the sample rate isn't something I have looked into.  We know the time to pull down a 400 point data set requires one second.   So something in the order of 2.5mS (which would include switching between ports).  Acquiring less data points will reduce the update rate but I doubt it is linear.   I did try setting it to 25 points it seems to update around 65mSish.  While changing the number of samples may not effect the hardware sample rate, it will certainly increase the overall uncertainly.  Consider we are now spending more time dealing with the overhead to send the data. 

I suspect you are really wanting to know how fast the hardware samples.  Depending how the firmware was written, it may not be a constant.  The easiest thing may be to ask OWO.    Another option may be to look at the drive side of R301 and see how fast the receiver's input selection switch toggles.   

**
Wording
« Last Edit: August 28, 2021, 04:14:15 pm by joeqsmith »
 
The following users thanked this post: ALW

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11708
  • Country: us
Re: NanoVNA Custom Software
« Reply #1241 on: August 28, 2021, 05:23:42 pm »
For fun, we can attempt to measure it indirectly.  From the manual for the V2Plus4, we know it will be dependent on the frequency range. 

For starts, I have set the number of data points to 31, Center to 13MHz and a span of 1MHz.   Notice my software shows a sweep time of 208mS.   Now lets look at the output signal with my Signal Hound.  We can see the time between sweeps is 207mS.  But the actual time the VNA is sweeping is 45mS.   It appears like it is close to 689SPS.   We have lost about 75% of our data. 
 
The following users thanked this post: ALW

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11708
  • Country: us
Re: NanoVNA Custom Software
« Reply #1242 on: August 28, 2021, 05:31:28 pm »
I transmitted CW 2.4 GHz using my makeshift Vivaldi antenna at port 1, receiving the reflected wave (doppler effect for movement of my chest wall) with a simple stub at port 2.

Let's see how it behaves at the frequency you are using.  Again, setting the center to 2.4GHz with a 1MHz span and 31 points.    Notice now that my software reports a sweep time of roughly 80mS (again, I lot of uncertainty in this measurement).    Looking at the Signal Hound, the time between sweeps is roughly 78mS.  The time the VNA is sweeping is about 17.3mS.   Or 1.8KSPS.  Much faster as we would expect from the manual.   Notice that the duty cycle is roughly the same and we are still discarding 75% of the data.
 
The following users thanked this post: ALW

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11708
  • Country: us
Re: NanoVNA Custom Software
« Reply #1243 on: August 28, 2021, 05:47:47 pm »
Looking at zero span (CW), the the VNA appears to leave the output active.  The time to collect the data appears to be the same as with swept.   Guessing it has no effect on the actual sample rate.   

***
The V2Plus4 was again set to 2.4GHz, 1MHz span, 31 points.  The Signal Hound is set to zero span mode.   We can now get a better idea what the data stream looks like.  It appears that they are running at 2KSPS but as you can see, there is repeating pattern.   I'm sure OWO would know the cause of this.  That or I would need to have a look at the firmware.   

« Last Edit: August 28, 2021, 06:51:21 pm by joeqsmith »
 
The following users thanked this post: ALW

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11708
  • Country: us
Re: NanoVNA Custom Software
« Reply #1244 on: August 28, 2021, 07:20:11 pm »
With the Signal Hound set to 40 MS/s, zero span, it appears that the pattern is not always 4 X 500us period pulses followed by the runt and short.    Where the markers are, note there were six.   

The Signal Hound has a decent library allowing you to control it with an external PC.   I've had mine for a few years now and really like it.   I made a little demo of it decoding one my my DMMs radios.   I mention it as it may be a better solution for what you are attempting to do.   

 
The following users thanked this post: ALW

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11708
  • Country: us
Re: NanoVNA Custom Software
« Reply #1245 on: August 28, 2021, 07:37:18 pm »
If you want to see some of the earlier work where I was reverse engineering the interface, 30 minutes of agony.   


 
The following users thanked this post: ALW

Offline ALW

  • Contributor
  • Posts: 33
  • Country: fr
Re: NanoVNA Custom Software
« Reply #1246 on: August 29, 2021, 07:38:17 am »
Thank you, very helpful insights. Need to read it a cpl of times to understand it, will do some measurements using a SDR as a spectrum analyzer. The data stream in the FIFO seems to be at 400 SPS with CW 2.4 GHz 101 pts, interesting how it switches even in CW mode. Need to do some scrounging there.
 

Offline harrimansat

  • Regular Contributor
  • *
  • Posts: 210
Re: NanoVNA Custom Software
« Reply #1247 on: August 29, 2021, 12:44:15 pm »
If you want to see some of the earlier work where I was reverse engineering the interface, 30 minutes of agony.   



Which kind of receiver are you using?
 

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11708
  • Country: us
Re: NanoVNA Custom Software
« Reply #1248 on: August 29, 2021, 04:51:27 pm »
Thank you, very helpful insights. Need to read it a cpl of times to understand it, will do some measurements using a SDR as a spectrum analyzer. The data stream in the FIFO seems to be at 400 SPS with CW 2.4 GHz 101 pts, interesting how it switches even in CW mode. Need to do some scrounging there.

I think you will need to be very clear about what you are asking.   With my software set as you suggest, it takes about 250ms to update.   2.5ms/sample or 400Hz.   Pretty much what the manual states at 400 samples per second.  We are a 1/4 the amount of data, so 1/4 the time.   Again, this may have little to do with the actual sample rate.  It really depends what you are trying to ask. 

One thing to be aware of is when using CW, the interface is not very reliable.  I never sorted out the root cause but suspect there is a problem with my software. 

 
The following users thanked this post: ALW

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11708
  • Country: us
Re: NanoVNA Custom Software
« Reply #1249 on: August 29, 2021, 04:59:50 pm »
Which kind of receiver are you using?

 :-// :-//  I am not sure what you are asking.  If you are interested in more detail, I suggest actually watching the video you linked. 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf