Author Topic: NanoVNA Custom Software  (Read 458360 times)

0 Members and 1 Guest are viewing this topic.

Online joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11629
  • Country: us
Re: NanoVNA Custom Software
« Reply #275 on: September 07, 2019, 02:53:01 pm »
Hi,

....
The reason I am uploading it here is to get some feedback on this eternal question of mine: "What is wrong with the supplied NanoVNASharp software?"

To me that software looks just fine and implements all graphs (mine does not do it correctly at this moment). The only thing it does not do, is to export data in CSV format for further Excel work. Would adding this feature solve the demand for alternative software (at least for most people)?

I understand that joeqsmith did his software because he did not like the graphics and refresh rate of NanoVNASharp. Plus he is free to do whatever he likes! :)

But what I really would like to understand and I have asked and got no reply (I know, I am dumb): what other functionalities do you guys want/need?

My only problem with the Sharp software was what I had shown with the cursors being unusable.  This was really the catalyst for where I am now.   

While my software has many basic features that you will find on most VNAs, these are a few that my current software supports that you may not find with Sharp:

  Support control of external bias power supply
  Support for an external transfer relay
  Full 2-port calibration
  Automatic T-check
  Automatically collect all four S-parameters
  Create full 2-port Touchstone files
  Segmented sweeps (both log and linear are supported)
  Record data for post processing over extended periods and there is some built-in post processing capability (3-D viewing, histograms, scatter....) 
  Supports external mixers and directional couplers using CH1 for S11
  Basic TDR measurements (time, distance, impedance, Beatty standard....)

I would like to point out that member RHB's posts did not fall on deaf ears.  It's an interesting topic.
https://www.eevblog.com/forum/rf-microwave/nanovna-custom-software/msg2668785/#msg2668785

...

4) The much discussed software of joeqsmith has a problem (to those asking for it - certainly not for him), by the way: It was developed with the HOME version of LabVIEW. This version, while affordable for hobby use, does explicitly not allow to use the resulting applications for any commercial use. Independently if joeqsmith is worried about this or not: if it was me, I would not make the software public, for the following reasons:

...

Kind regards,
Vitor

You had asked about this before:
https://www.eevblog.com/forum/rf-microwave/nanovna-custom-software/msg2599500/#msg2599500

I did not develop my software with the Home edition as you have stated.  If you look at screen shots or videos I have posted, the lack of a watermark should have been the tell tail.   There is nothing from a legal aspect that would prevent me from providing the software for profit as again, I have a professional license.    The software will indeed run on the Home edition.   It could be built into an EXE with an installer like any other application using the Home edition but using this for profit would be a licensing problem as you suggest.   

A pro license doesn't cost too much.  Somewhere around $3000.  If I were planing to use it for profit, I would just sort out the license costs as part of the sale price.   I wouldn't try and sell 3001 copies at $1.00 USD to make $1 in profit.   :-DD   Hope this clears things up. 
« Last Edit: September 07, 2019, 04:38:28 pm by joeqsmith »
 

Offline Bicurico

  • Super Contributor
  • ***
  • Posts: 1707
  • Country: pt
    • VMA's Satellite Blog
Re: NanoVNA Custom Software
« Reply #276 on: September 07, 2019, 03:23:36 pm »
@joeqsmith: Sorry, I thought you were using the HOME version.

Anyway, I guess my thoughts still apply regarding the development of such software (or software to support other devices) using the HOME version of LabVIEW, which was discussed in a different thread.

But to stay on topic: I will now continue to monitor this thread and see if I can learn something about VNA measurements and see if this motivates me to continue developing the software.

@radiolistener: Thanks! It did not occur to me to verify that S1P files are actually just CSV files...
 
Regards,
Vitor

Online joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11629
  • Country: us
Re: NanoVNA Custom Software
« Reply #277 on: September 07, 2019, 04:51:19 pm »
@joeqsmith: Sorry, I thought you were using the HOME version.

I did buy the $50 Home edition and am using it but not to develop the code for the Nano.  At $50, with the application builder it was a very good deal for anyone wanting to learn the tools or in my case, hobbyist looking for a low cost upgrade.  Sure, it's not designed to be a cheap tool for people to profit from but they do offer licenses for that.  I wonder just how much they have invested in that tool.   It's really advanced over the years. 

Offline OwO

  • Super Contributor
  • ***
  • Posts: 1250
  • Country: cn
  • RF Engineer.
Re: NanoVNA Custom Software
« Reply #278 on: September 07, 2019, 05:06:37 pm »
FYI to anyone working on alternative software for the NanoVNA: it's a good idea to abstract out the hardware interfacing part of your code and separate it from your UI code because the command interface is going to be completely reworked in V2. It will be a more simple low level (and binary rather than text) protocol to improve performance and sweep rate. The other thing I know about V2 is it will cover at least 1 to 2500 MHz (without harmonic tricks). V1 is very noisy above 300MHz because of the use of the third harmonic and the SA612 mixer which both mean a very weak signal.
« Last Edit: September 07, 2019, 05:08:57 pm by OwO »
Email: OwOwOwOwO123@outlook.com
 
The following users thanked this post: horo

Offline edigi

  • Regular Contributor
  • *
  • Posts: 184
  • Country: hu
Re: NanoVNA Custom Software
« Reply #279 on: September 07, 2019, 06:23:02 pm »
What is the confidence level of this information?
Any expected date?

Actually harmonic usage is not that a bad idea, in fact I've checked with SA till 1.5 GHz and maybe even that could be used (at least for S11).
Mixer is definitely limiting (500 MHz by the spec if I remember correctly).
Also due to overdrive of the clock chip stability around 300 MHz is not the best, low battery is one issue but I could provoke it also with hair dryer (so summer high temperature can be also an issue; the 800 MHz code version is not there by accident...).

A more efficient data transfer is definitely a good idea even if it breaks compatibility with other devices (not an issue for me and probably for many but I heavily suspect that joeqsmith has not developed his SW only because of NanoVNA but probably same SW is used with other devices). A good compromise could be that the VNA could be forced back to the slower but more compatible mode but by default it could use a more efficient one.
 

Online joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11629
  • Country: us
Re: NanoVNA Custom Software
« Reply #280 on: September 07, 2019, 07:38:00 pm »
It will be a more simple low level (and binary rather than text) protocol to improve performance and sweep rate. The other thing I know about V2 is it will cover at least 1 to 2500 MHz (without harmonic tricks).

Very nice!!  I was very surprised to see them sending ASCII.   2.4GHz without the harmonics would be a very welcome addition as well.  Currently, I limit the sweep to 300MHz while playing around with mixing the signals.

A more efficient data transfer is definitely a good idea even if it breaks compatibility with other devices (not an issue for me and probably for many but I heavily suspect that joeqsmith has not developed his SW only because of NanoVNA but probably same SW is used with other devices).

I started out thinking I could port the code I wrote for my old HP but there were two problems.   First, I wrote the program many years ago and have learned better techniques over the years.   The other problem was the data format.   That HP has clear plastic overlays that attach to the CRT with the various scales, like polar and smith.  You would mark on these with your grease pencil with the data you collect  (primitive storage).    The data had to be translated through three different systems.  It was a real nightmare.    I did like the look and feel of the software and decided to follow that same sort of scheme.  I reused my graphics and the techniques I came up with for plotting the data but that's about it.   One day I would like to replace the old HP with something less than 20 years old  :-DD

https://www.amazon.com/COLOR-MARKERS-PEEL-OFF-GREASE-PENCIL/dp/B00XJ1FRRI?ref_=fsclp_pl_dp_7

Pictures of the 50 ohm home made standard with mixers drifting a bit.  Also shown is a 3.4GHz low pass, both compliments of the $50 Nano.    My confidence is about at that $50 level...  Maybe lower.

****

Playing with the scatter plot, 3.4GHz LP filter....

https://www.youtube.com/watch?v=F8bUZMEElyk&feature=youtu.be
« Last Edit: September 07, 2019, 08:41:06 pm by joeqsmith »
 

Offline rhb

  • Super Contributor
  • ***
  • Posts: 3476
  • Country: us
Re: NanoVNA Custom Software
« Reply #281 on: September 07, 2019, 08:02:55 pm »
if I understand correctly, TDR can be obtained by make IFFT applied to S1P. Is it correct?

It seems that it works, but the most confusing thing here is how to calculate proper time for points.  ???

Here is 0.5 meters RG316 with open end, measured with NanoVNA (it's real back and forth delay is about 0.495 ns):
(Attachment Link)

Here is 10 meters RG316 with open end, measured with NanoVNA (don't know it's real delay, but 98.4 ns looks very close to velocity factor 0.66):
(Attachment Link)

It shows signal magnitude after IFFT. Don't take attention to ST/ED/BW values on screenshot, these are rudiments from debugging :)

Is it correct way?  :phew:

Is it possible to calculate impedance instead of this unknown unit magnitude?

The frequency spacing determines how long the time domain trace is.  The Nyquist frequency determines the sampling.  If you sweep to 900 MHz at 1 MHz spacing you have data for 1 microsecond.  If you pad the end of the frequency series to raise Nyquist to 2 GHz you will have 250 ps sampling.

Doing an FFT from time to frequency, padding with zeros and inverse transforming is the standard way to resample data to finer sampling rates.  There are other ways of doing it, but the FFT is the fastest.

I wrote an arbitrary resampling routine which would resample any sample rate to any other sample rate by FFT  around 20 years ago.  You have to pad the series so that m*dtT1 = n*dT2.  If you don't you will get a phase error near the end.  That cost me 2 weeks of misery to figure out.  It's clearly stated, "The DFT is defined on the semi-closed interval from [-Pi:Pi)."  But it's easy to overlook that little detail.

I've presented  some time domain connector testing here:

https://www.eevblog.com/forum/rf-microwave/testing-rf-connectors-and-cables/msg2640531/#msg2640531

using a Tek 11801 and 20 GHz SD-24 TDR head.

Chinese  SMA and N connectors are OK to about 1 GHz.  BNC males are often completely useless.  It's really a function of the tolerances on the make collar.

Have Fun!
Reg
 
The following users thanked this post: radiolistener, horo

Offline Bicurico

  • Super Contributor
  • ***
  • Posts: 1707
  • Country: pt
    • VMA's Satellite Blog
Re: NanoVNA Custom Software
« Reply #282 on: September 07, 2019, 09:31:51 pm »
Hi,

I have the following question, which is probably obvious for you all, but not for me:

1) Port S11: Is it correct to assume that this port internally combines a TG, RF IN, DUT with a SWR bridge?
2) Port S21: Is it correct to assume that this port internally acts just as a TG?
3) Both TG and RF IN are synchronized, allowing for phase measurements, as opposed to SWR measurements carried out with a spectrum analyzer and SWR bridge, where no phase information is available?

If I am am measuring with S21, where I connect S21->DUT->S11, will the device internally "switch off" the SWR bridge, which would (in my opinion) no longer be needed?
If so, what would happen if I configure a S21 measurement, but then only connect DUT->S11, without using S21 at all? Wouldn't the result be similar to a regular spectrum analyzer?

Thanks,
Vitor

PS: Am I correct to assume that UK English writes "spectrum analySer" and USA English writes "spectrum analyZer"?
 

Online joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11629
  • Country: us
Re: NanoVNA Custom Software
« Reply #283 on: September 07, 2019, 11:00:01 pm »
Hi,

I have the following question, which is probably obvious for you all, but not for me:

1) Port S11: Is it correct to assume that this port internally combines a TG, RF IN, DUT with a SWR bridge?
2) Port S21: Is it correct to assume that this port internally acts just as a TG?
3) Both TG and RF IN are synchronized, allowing for phase measurements, as opposed to SWR measurements carried out with a spectrum analyzer and SWR bridge, where no phase information is available?

If I am am measuring with S21, where I connect S21->DUT->S11, will the device internally "switch off" the SWR bridge, which would (in my opinion) no longer be needed?
If so, what would happen if I configure a S21 measurement, but then only connect DUT->S11, without using S21 at all? Wouldn't the result be similar to a regular spectrum analyzer?

Thanks,
Vitor

PS: Am I correct to assume that UK English writes "spectrum analySer" and USA English writes "spectrum analyZer"?

I have always written Z (unless I would make a mistake, which I often do)  All of my test equipment use Z on their markings.   

Yes, channel 0 has two ADCs for the reference and return (S11) while channel 1 has one ADC for the thru (S21).   Phase relative to the reference is available from both channels. 

This gets a bit odd when you consider using channel 1 for S11 while up and down converting the signal from channel 0.  While I am mixing it with a signal that is asynchronous to the reference, once it it down converted everything is back to normal.  The calibration handles the phase errors. 

There is no switching off. The signals are hardwired.   It's up to you to decide what to do with the data.   You can pull just the channel 0 or the channel 1 data.  For example, when I collect S11, there is no reason to read channel 1 and there is certainly no reason to read the frequency.  This is why my software runs so much faster as the Sharp software pulls everything down.  (no, not at 9600 BAUD.  I thought I had drove the final spike in that coffin).

Your last question is a bit tricky.  I understand what you are asking and the basic answer is yes!!!   If I connect my RF generator to channel 1, set the analyzer to read S21, with nothing on channel 0, you can see this sort of spectrum analyzer result in the attached graph.  Everything is asynchronous so the phase is nothing but noise but you can clearly see the magnitude peak at the frequency the RF generator is set to which in this case is 20MHz. 

But there's a catch which I talked about in that very first video I made.   You only have 101 samples to work with.  Say you have an RF generator with VERY low phase noise set to CW.   Would you be able to see it using a wide band sweep?  Most likely not.  You will need to know what you are looking for and zoom in around that area.
Think about it, what's 900MHz / 101.   Try looking a 7.968MHz oscillator with that.   

While you could calibrate out the errors in amplitude, I doubt you would be happy with the performance.   The graph shows what happens when I use a 20MHz center frequency and 100KHz span.   Someone may look at that and say, that Joe Smith has one really poor excuse for an RF generator.     Of course, attaching it to something other than a $50 instrument tells a whole different story. 
« Last Edit: September 07, 2019, 11:11:38 pm by joeqsmith »
 

Online radiolistener

  • Super Contributor
  • ***
  • Posts: 3282
  • Country: ua
Re: NanoVNA Custom Software
« Reply #284 on: September 07, 2019, 11:17:56 pm »
The frequency spacing determines how long the time domain trace is.  The Nyquist frequency determines the sampling.  If you sweep to 900 MHz at 1 MHz spacing you have data for 1 microsecond.  If you pad the end of the frequency series to raise Nyquist to 2 GHz you will have 250 ps sampling.

So, the time interval after IFFT is from 0 to 1/[frequency step] is it correct?


I'm looking at scikit-rf library for python, and there is also interesting function delay(d, unit,...) in network.py [line 2514]:

Code: [Select]
def delay(self, d, unit='deg', port=0, media=None,**kw):
        '''
        Add phase delay to a given port.
        This will cascade a matched line of length `d/2` from a given `media`
        in front of `port`. If `media==None`, then freespace is used.
        Parameters
        ----------
        d : number
                the length of transmissin line (see unit argument)
        unit : ['deg','rad','m','cm','um','in','mil','s','us','ns','ps']
                the units of d.  See :func:`Media.to_meters`, for details
        port : int
            port to add delay to.
        media: skrf.media.Media
            media object to use for generating delay. If None, this will
            default to freespace.
        '''
        if d ==0:
            return self
        d=d/2.
        if self.nports >2:
            raise NotImplementedError('only implemented for 1 and 2 ports')
        if media is None:
            from .media import Freespace
            media = Freespace(frequency=self.frequency,z0=self.z0[:,port])

        l =media.line(d=d, unit=unit,**kw)
        return l**self

But I don't understand python syntax well, so I cannot understand what happens here? Especially at these 3 lines:
Code: [Select]
            media = Freespace(frequency=self.frequency,z0=self.z0[:,port])

        l =media.line(d=d, unit=unit,**kw)
        return l**self

If I understand correctly, "l =media.line(..." represents impedance transformation of transmission line. And it someway applied to S11 parameters. And result represents S11 parameters at the end of transmission line. Is it correct?

What means "**" operator in python? According to google, this is power operator (2^3=8 equals to 2**3=8 in python), but the second argument is S11 matrix... What means power operator for matrix?  ???

Tried to google such operation (S11 matrix correction for specific electronic delay in transmission line), but didn't find anything... Can someone suggest some literature, where such operation for S11 matrix is explained?
« Last Edit: September 07, 2019, 11:31:55 pm by radiolistener »
 

Offline hendorog

  • Super Contributor
  • ***
  • Posts: 1617
  • Country: nz
Re: NanoVNA Custom Software
« Reply #285 on: September 08, 2019, 12:08:45 am »
There are some quite good docs.

https://scikit-rf.readthedocs.io/en/latest/tutorials/Introduction.html

"Element-wise mathematical operations on the s-parameters are accessible through overloaded operators."
"Cascading and de-embeding 2-port Networks can also be done though operators. Cascading is done through the power operator, **."



 
The following users thanked this post: radiolistener

Online radiolistener

  • Super Contributor
  • ***
  • Posts: 3282
  • Country: ua
Re: NanoVNA Custom Software
« Reply #286 on: September 08, 2019, 12:30:13 am »
hendorog, thanks. But what it means still is not clean for me. Needs reverse engineering of skrf source code, because python syntax very tricky. For example, it is not clean where IF statement ends... Also, algorithms are smeared through different classes and overloaded operators and it's hard to understand what is going on here with no need to diving into the rest of the code  :)

Any literature about math which is used under the hood in skrf?
 

Offline Bicurico

  • Super Contributor
  • ***
  • Posts: 1707
  • Country: pt
    • VMA's Satellite Blog
Re: NanoVNA Custom Software
« Reply #287 on: September 08, 2019, 07:36:12 am »
joeqsmith - May I abuse your patience and ask:

When using the DATA command I always get X and Y values. Are you doing it differently?
Yes, the frequency list is not necessary - one can compute it without having to download it. It is just (Fend-Fstart)/samples*step
What does X and Y really represent. This is the toughest question and possibly the most annoying to you. Sorry - I am still a noob in terms of VNA.
Regarding the low sample rate of just 101 samples per sweep, I have not tested if the SWEEP command accepts the sample number different than 101 as the third parameter.
If not my plan is to increase the sweep to 500 samples by just dividing the frequency span by 5 and getting the 101 samples for each of the 5 frequency segments.
Of course this will slow down the sweep rate by a factor of 5 but I have learned that refresh rate is not everything and there are quite expensive professional test equipment with rather slow sweep rates (a joke in my opinion - but that is another story).
It is not yet clear to me how to software-wise configure the NanoVNA to do S21 measurement so that I just hook the DUT on Port 0 and get a spectrum reading.

Regards
Vitor

Online radiolistener

  • Super Contributor
  • ***
  • Posts: 3282
  • Country: ua
Re: NanoVNA Custom Software
« Reply #288 on: September 08, 2019, 08:16:09 am »
What does X and Y really represent. This is the toughest question and possibly the most annoying to you. Sorry - I am still a noob in terms of VNA.

These X and Y are real and imaginary parts of S11 value (for CH1 S21). It is represented in complex form.

For exampel:
Code: [Select]
1.000334382 -0.012819038

means:
re (real part) = 1.000334382
im (imaginary part) = -0.012819038

So, it means that S11 = 1.000334382 - j0.012819038.

If you want, you can translate it to polar coordinate system in the following way:

magnitude = sqrt(re * re + im * im);
angle = 180 * atan2(im, re) / pi;

atan2(im, re) calculates angle, but the result represented in radians, so you're needs to convert it to degree by multiplying it with 180 / pi

S11 is very useful value, for exampel you can calculate VSWR value:

Code: [Select]
rr = re * re + im * im;

if (rr >= 1) then VSWR = infinite;

else VSWR = (1 + sqrt(rr)) / (1 - sqrt(rr));


Regarding the low sample rate of just 101 samples per sweep, I have not tested if the SWEEP command accepts the sample number different than 101 as the third parameter.

you can pass any number in sweep command. NanoVNA just ignore it. It always works with 101 points and there is no way to change it. I think this is memory limit of this microcontroller.

It is not yet clear to me how to software-wise configure the NanoVNA to do S21 measurement so that I just hook the DUT on Port 0 and get a spectrum reading.

Do you mean console commands? Just use data command:
data <channel>

for exampel, this command will get data for CH0:
data 0

and this command will get data for CH1:
data 1

it's pretty easy  :)

In order to setup frequencies, you can use sweep command:
sweep <start> <stop>

for exampel, this command will setup sweep range from 1 MHz to 150 MHz:
sweep 1000000 150000000

You can download PUTTY (this is terminal, it allows to connect to Serial port) and play with it. It's pretty easy. You're needs to specify Serial port for connection and com port name.  Here is putty session for exampel:
Code: [Select]
help
Commands: help exit info echo systime threads reset freq offset time dac saveconfig clearconfig data dump frequencies port stat sweep test touchcal touchtest pause resume cal save recall trace marker edelay
ch> info
Kernel:       4.0.0
Compiler:     GCC 5.4.1 20160919
Architecture: ARMv6-M
Core Variant: Cortex-M0
Port Info:    Preemption through NMI
Platform:     STM32F072xB Entry Level Medium Density devices
Board:        NanoVNA
Build time:   Jul 22 2019 - 16:26:51
ch> sweep 1000000 30000000
ch> sweep
1000000 30000000 101
ch> data 0
1.000334382 -0.012819038
1.000619411 -0.014043334
1.000123381 -0.015157566
1.000514984 -0.016093827
1.000436782 -0.017410092
1.000501394 -0.018344996
1.000151395 -0.019588120
1.000253081 -0.020322881
0.999891698 -0.021273871
0.999914824 -0.022288246
0.999868750 -0.023332940
0.999770462 -0.024202115
0.999884128 -0.025404103
0.999833703 -0.026232335
0.999632596 -0.027013938
0.999499559 -0.028223698
0.999637365 -0.028801376
0.999387919 -0.029435977
0.999631226 -0.029972538
1.002218246 -0.029391391
1.004171252 -0.032068528
1.001608490 -0.034094724
1.000858068 -0.035458635
1.000560522 -0.036200754
1.000125050 -0.037087496
1.000095486 -0.038230843
1.000262737 -0.039139334
0.999750494 -0.039976678
0.999891042 -0.041104275
0.999784827 -0.042336892
0.999971687 -0.043484516
0.999799907 -0.045150741
0.999982059 -0.046216718
0.999493658 -0.047426808
0.999777674 -0.048748057
0.999688148 -0.049898017
0.999597012 -0.051182426
0.999525427 -0.052349578
0.999216139 -0.053816296
0.999178647 -0.054883997
0.999005794 -0.056154955
0.998820781 -0.057684507
0.999015092 -0.058685358
0.998871505 -0.059900578
0.998757004 -0.061241392
0.998712182 -0.062616705
0.998695135 -0.063646942
0.998613953 -0.064931072
0.998556375 -0.066254936
0.998585581 -0.067580714
0.998366594 -0.068778082
0.998310446 -0.070160925
0.998090565 -0.071184404
0.998218178 -0.072452932
0.998082041 -0.073820449
0.997873008 -0.075051650
0.997672736 -0.076362192
0.997864961 -0.077377557
0.997722983 -0.078763738
0.997510135 -0.080164059
0.997572302 -0.081403687
0.997310221 -0.082679249
0.997066974 -0.083944469
0.997346639 -0.085386037
0.997254550 -0.086459428
0.997277498 -0.087772250
0.997081696 -0.088958740
0.997002899 -0.090456649
0.996815264 -0.091620504
0.996773242 -0.092930428
0.996567785 -0.094331786
0.996562242 -0.095199465
0.996507167 -0.097060345
0.996266543 -0.097908206
0.996095418 -0.099269963
0.996342182 -0.100541479
0.995806276 -0.101831674
0.995640277 -0.103128492
0.995647966 -0.104465112
0.995308578 -0.105523049
0.995393931 -0.106829814
0.995034158 -0.108262822
0.995196044 -0.109290048
0.994729876 -0.110772430
0.995051443 -0.112008184
0.994862079 -0.113100029
0.994484126 -0.114403992
0.994411051 -0.116048157
0.994243025 -0.117027558
0.994225263 -0.118228457
0.994016349 -0.119506403
0.993956506 -0.120835222
0.993702173 -0.122295558
0.993651926 -0.123540185
0.993369281 -0.124662227
0.993133306 -0.125806242
0.992927193 -0.127351313
0.992799878 -0.128284811
0.992875814 -0.129809200
0.992461144 -0.130973890
0.992346584 -0.132136657
ch> data 1
0.000022881 -0.000034072
-0.000044930 -0.000003006
0.000001353 -0.000019715
-0.000053841 -0.000043194
-0.000004344 -0.000006963
0.000001772 -0.000007370
-0.000000086 -0.000014207
-0.000005251 0.000030388
0.000011967 -0.000017351
-0.000020198 0.000030180
-0.000004857 -0.000045057
-0.000020909 0.000002008
0.000010476 -0.000008191
0.000004981 -0.000037762
-0.000053258 0.000006323
-0.000023624 0.000023545
-0.000021935 -0.000011593
-0.000025896 -0.000000449
-0.000039536 -0.000018117
0.000018417 0.000040691
-0.000015518 -0.000064735
-0.000022360 -0.000048622
-0.000014705 0.000005838
0.000012554 -0.000030298
-0.000035040 -0.000004715
0.000017032 -0.000023722
-0.000012310 -0.000016603
0.000024222 -0.000042020
-0.000050025 -0.000037519
-0.000024725 -0.000024864
0.000012915 -0.000024808
0.000015194 -0.000008572
0.000012409 -0.000028297
0.000032538 0.000017843
0.000026463 -0.000013021
-0.000001025 -0.000037424
-0.000019795 -0.000044200
-0.000013177 -0.000036966
-0.000016448 -0.000019061
0.000003270 0.000000127
0.000045834 -0.000063594
-0.000008657 -0.000003194
0.000010901 0.000005717
0.000023127 -0.000009332
-0.000012275 0.000016109
0.000015946 -0.000023457
0.000012786 0.000031161
0.000002111 0.000011889
0.000023851 0.000024347
-0.000001895 0.000019804
0.000021308 0.000006177
0.000027474 -0.000015023
-0.000020845 -0.000027184
-0.000019241 -0.000042736
0.000046159 -0.000022540
-0.000023773 -0.000018934
0.000017447 0.000030827
0.000032983 -0.000004683
0.000000493 -0.000022111
-0.000006937 0.000028902
0.000043825 -0.000022563
0.000062209 0.000005554
0.000046276 -0.000050153
-0.000017177 -0.000012213
0.000033449 -0.000046718
-0.000002024 0.000019626
0.000041615 -0.000019849
0.000026992 -0.000000219
0.000014502 -0.000004934
0.000015049 0.000002597
-0.000033414 0.000004811
-0.000033238 -0.000052053
0.000026538 0.000015010
0.000009085 -0.000022117
-0.000025025 -0.000017477
-0.000002855 -0.000049975
-0.000008924 -0.000026126
-0.000000627 -0.000041066
0.000014821 0.000012632
0.000008421 0.000025136
0.000020770 -0.000022932
0.000021408 0.000012013
-0.000002280 -0.000019163
-0.000031954 0.000019613
-0.000012588 0.000018006
0.000011647 0.000022847
0.000030014 0.000008953
-0.000044193 0.000000472
0.000014898 -0.000047376
0.000015692 -0.000035619
-0.000000117 -0.000035395
0.000010286 -0.000003112
-0.000038924 -0.000028851
-0.000023267 -0.000004298
-0.000060468 -0.000020690
-0.000024815 0.000003858
-0.000012520 -0.000020648
-0.000003775 -0.000013356
-0.000001176 -0.000004715
-0.000015004 -0.000030841
-0.000015286 -0.000069948
ch>
« Last Edit: September 08, 2019, 08:24:30 am by radiolistener »
 

Offline Flynt

  • Newbie
  • Posts: 6
  • Country: it
Re: NanoVNA Custom Software
« Reply #289 on: September 08, 2019, 11:51:29 am »
Joeqsmith, you didn't understand anything ...
I HAVE NEVER THOUGHT THAT YOUR TIME DOES NOT APPLY, I ONLY REQUEST THE INSTALLER OF A PROGRAM YOU DEVELOPED ...

I think you didn't understand my intentions, and I'm not able to program.
However, not but nothing, the Gentile helped me
Radioman ...

On the other hand, these are the Americans ... We in Italy, among radio amateurs, help each other.

Bye Bye :( :( :(

I'm glad we finally understand one another.    It's too bad that your not getting my work for free upsets you to the point you feel the need to make such ignorant comment about an entire country but it speaks of your character.     

You do bring up a valid point that what I have been doing is of no help to you.  Others have posted similar comments,  which is something I can live with. 

Take care.

(TAKE CARE):Pay attention to what ?? To you'??? Should I be Afraid ???
 :-DD :-DD :-DD

I didn't want your job, for free, I also wrote you that I was ready to give you a Donation ...

We ITALIANS, we are not like that and among Radio Amateurs & Makers we help each other Free ...

And then a private reply message, you could send it !!!  :=\ :=\ :=\

Don't worry, thanks to the lovely RADIOLISTENEN User, I Solved ...

GOODBYE  :-X :-X :-X
« Last Edit: September 08, 2019, 12:00:17 pm by Flynt »
 

Online joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11629
  • Country: us
Re: NanoVNA Custom Software
« Reply #290 on: September 08, 2019, 02:35:08 pm »
Joeqsmith, you didn't understand anything ...
I HAVE NEVER THOUGHT THAT YOUR TIME DOES NOT APPLY, I ONLY REQUEST THE INSTALLER OF A PROGRAM YOU DEVELOPED ...

I think you didn't understand my intentions, and I'm not able to program.
However, not but nothing, the Gentile helped me
Radioman ...

On the other hand, these are the Americans ... We in Italy, among radio amateurs, help each other.

Bye Bye :( :( :(

I'm glad we finally understand one another.    It's too bad that your not getting my work for free upsets you to the point you feel the need to make such ignorant comment about an entire country but it speaks of your character.     

You do bring up a valid point that what I have been doing is of no help to you.  Others have posted similar comments,  which is something I can live with. 

Take care.

(TAKE CARE):Pay attention to what ?? To you'??? Should I be Afraid ???
 :-DD :-DD :-DD

I didn't want your job, for free, I also wrote you that I was ready to give you a Donation ...

We ITALIANS, we are not like that and among Radio Amateurs & Makers we help each other Free ...

And then a private reply message, you could send it !!!  :=\ :=\ :=\

Don't worry, thanks to the lovely RADIOLISTENEN User, I Solved ...

GOODBYE  :-X :-X :-X


https://dictionary.cambridge.org/dictionary/english/take-care-of-yourself
https://www.fluentu.com/blog/english/say-goodbye-english/

Online joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11629
  • Country: us
Re: NanoVNA Custom Software
« Reply #291 on: September 08, 2019, 03:44:39 pm »
joeqsmith - May I abuse your patience and ask:

...

Of course this will slow down the sweep rate by a factor of 5 but I have learned that refresh rate is not everything and there are quite expensive professional test equipment with rather slow sweep rates (a joke in my opinion - but that is another story).
It is not yet clear to me how to software-wise configure the NanoVNA to do S21 measurement so that I just hook the DUT on Port 0 and get a spectrum reading.

Regards
Vitor
Interesting you say that about the speed.  I have a very old Tektronix SA that still uses analog filters that is very slow.    The old HP shown in the picture that I am using to compare with the Nano uses digital IF filtering.   From the plot you could see with a 100KHz span and RBW of 580Hz using the swept spectrum mode requires 154ms.

If I were to adjust the RBW to something lower, say 73 Hz, it would take 1880  seconds.  At the lowest RBW (1.1 Hz) it would require 1,720,000 seconds to sweep.   This analyzer has a narrow band mode that can improve the sweep time.   For example using the same 100KHz span and a 360Hz resolution it requires 10mSec.   

The HP uses 401 samples for all modes compared with the 101 of the Nano.   Looking at the same signal with the Signal Hound using the sweep mode requires 70mSec but it collects 5243 samples. 

As far as setting up the Nano,  CH1 would be set to thru, then LogMag.  In the case of this demo, the Stimulus is set to a Center of 20MHz and the Span set to 100K.  With it being a relative measurement,  just ignore the calibration.   Based on the bit of testing I did, keep the power below 0dBm to avoid compression and you should be fine.   

****

Forgot to mention that the old HP uses GPIB which is fairly slow where the Signal Hound is using USB3.   The Signal Hound can spit data out fast enough that they have a note in the manual that talks about if you plan to write your own software that you will need to keep up.     With the HP, I don't think that would ever be a concern.   
« Last Edit: September 08, 2019, 03:50:16 pm by joeqsmith »
 

Offline Bicurico

  • Super Contributor
  • ***
  • Posts: 1707
  • Country: pt
    • VMA's Satellite Blog
Re: NanoVNA Custom Software
« Reply #292 on: September 08, 2019, 03:52:05 pm »
@radiolistener: Thanks for your valuable explanations.

If you notice my previous posts, I do know some parts of it, like the DATA command, but I did not know that I could use the 0/1 argument to get only the required data. That is great and now I understand what joeqsmith meant.

Also, while I do understand that the X/Y data that is received with the DATA command represent a complex number, with real and imaginary component.

What I do NOT understand at this point is for instance how to calculate the dB figure that the NanoVNA shows on the LCD for CH1.

Finally, one of the things I want to achieve is to use the NanoVNA as a spectrum analyzer. I understand it was not designed for this, but I got the impression that it would be a possible thing to do. It is here where I need help!

The communication part is already working, as can be tested with my tool, though it is an initial draft implementation.

I will bear in mind to separate communication from processing, as suggested by OwO.

@Owo: Do you know further details, like retail price, LCD size and resolution, additional functionality (like spectrum analyzer)?

Kind regards,
Vitor

Offline Bicurico

  • Super Contributor
  • ***
  • Posts: 1707
  • Country: pt
    • VMA's Satellite Blog
Re: NanoVNA Custom Software
« Reply #293 on: September 08, 2019, 04:38:18 pm »
The HP uses 401 samples for all modes compared with the 101 of the Nano.   Looking at the same signal with the Signal Hound using the sweep mode requires 70mSec but it collects 5243 samples. 
...
Forgot to mention that the old HP uses GPIB which is fairly slow where the Signal Hound is using USB3.

I own a HP8594E (actually I own three units, but two are lacking a working PSU).

I made a special version of my "VMA Simple Spectrum Analyser" software for this series (HP/Agilent 859x) and indeed they use 401 samples per sweep and you are right, using GPIB to transfer these samples takes quite some time, compared for instance with the R&S CMU200/CRTU.

Feel free to take a look at my blog and download the software, in case your HP is of the 859x series. You will require a free license.

I am considering adapting this software for the NanoVNA, in order to use it as a spectrum analyzer (first goal) and then eventually add VNA measurements to my software. So that is the big picture.

And once again, because VNA is totally new to me, I might be wrong about what I imagine is possible to do, but unless I understand that it is indeed impossible, I will try as time allows.

Also note, that hobby-wise I come from TV/CATV/SAT, reception, multiplexing, broadcasting and of course field meters, got into spectrum analysis and am now looking at VNA, which is a bit of a different field to what I am used to.

regards,
Vitor

Online radiolistener

  • Super Contributor
  • ***
  • Posts: 3282
  • Country: ua
Re: NanoVNA Custom Software
« Reply #294 on: September 08, 2019, 05:09:46 pm »
What I do NOT understand at this point is for instance how to calculate the dB figure that the NanoVNA shows on the LCD for CH1.

dB figure is a just magnitude of that complex number in logarithmic scale:

magnitude = sqrt(re*re + im*im);

dB = 20 * log10( magnitude );

magnitude value is a Linear S11 plot
dB value is a Logmag S11 plot

The same for S21.
« Last Edit: September 08, 2019, 05:12:51 pm by radiolistener »
 

Offline Bicurico

  • Super Contributor
  • ***
  • Posts: 1707
  • Country: pt
    • VMA's Satellite Blog
Re: NanoVNA Custom Software
« Reply #295 on: September 08, 2019, 05:57:38 pm »
Thanks!

I was being stupid - I somehow was thinking in dBm and not dB.

Anyway, I was doing some hacking and indeed the stitched sweep works!

My software now uses 500 samples (505 to be exact), by running the sweep/data commands 5 times in sequence to cover the selected frequency range.

Speed wise it is OKish - right now I am doing one sweep on every button click. For a continuous mode, I would optimize my code, so that the trace is updated with each individual segment, which would give the illusion of higher sweep rate (much like my VMA Simple Spectrum Analyser software does it for the cheap ADF4351 devices).

Note how the curves are much smoother on the graph and please ignore the rudeness and wrongness of the graph!

Regards,
Vitor


Online joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11629
  • Country: us
Re: NanoVNA Custom Software
« Reply #296 on: September 08, 2019, 06:58:55 pm »
The HP uses 401 samples for all modes compared with the 101 of the Nano.   Looking at the same signal with the Signal Hound using the sweep mode requires 70mSec but it collects 5243 samples. 
...
Forgot to mention that the old HP uses GPIB which is fairly slow where the Signal Hound is using USB3.

I own a HP8594E (actually I own three units, but two are lacking a working PSU).

I made a special version of my "VMA Simple Spectrum Analyser" software for this series (HP/Agilent 859x) and indeed they use 401 samples per sweep and you are right, using GPIB to transfer these samples takes quite some time, compared for instance with the R&S CMU200/CRTU.

Feel free to take a look at my blog and download the software, in case your HP is of the 859x series. You will require a free license.

I am considering adapting this software for the NanoVNA, in order to use it as a spectrum analyzer (first goal) and then eventually add VNA measurements to my software. So that is the big picture.

And once again, because VNA is totally new to me, I might be wrong about what I imagine is possible to do, but unless I understand that it is indeed impossible, I will try as time allows.

Also note, that hobby-wise I come from TV/CATV/SAT, reception, multiplexing, broadcasting and of course field meters, got into spectrum analysis and am now looking at VNA, which is a bit of a different field to what I am used to.

regards,
Vitor

That's a nice setup with the tracking generator.    The HP shown is a 3589A.  Where you have 2.9GHz to play with, this one is limited to 150MHz.  HP calls it a spectrum/network analyzer.  It's a bit of a hybrid.  You can use it with an external coupler and it has software to support down conversion.   

Pictures showing my home made 50 ohm standard with Mini-Circuits coupler.  They did offer a test set for this instrument.

Also shown for fun is two signal generators connected to a splitter and to the 3589A.   The generators are set to 10MHz, separated by 100Hz and 10dBm.     Using the swept mode, you can see it requires 104.86 seconds to sweep.   Using the narrow mode requires 1.28 seconds.   Note the resolution does change but its never caused me a problem.   

For my electronics hobby, I really can't justify the cost of new TE in most cases.  I do a fair amount of projects below 100MHz into the KHz and this system works really well for this.

Offline rhb

  • Super Contributor
  • ***
  • Posts: 3476
  • Country: us
Re: NanoVNA Custom Software
« Reply #297 on: September 08, 2019, 11:58:26 pm »
Would you mind explaining the calibrator?  The short, open, load and thru are obvious, but I don't understand the 5th.  There appears to be a "pi" network of some type.  Is that an attenuator?
 

Online joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11629
  • Country: us
Re: NanoVNA Custom Software
« Reply #298 on: September 09, 2019, 12:09:37 am »
Yes, 10dBish. 

Online radiolistener

  • Super Contributor
  • ***
  • Posts: 3282
  • Country: ua
Re: NanoVNA Custom Software
« Reply #299 on: September 09, 2019, 12:35:06 pm »
joeqsmith, could you please explain some details about your cal kit design?

The distance between ground and signal wire is not the same along signal wire path. For example, there is too small gap between resistors and the ground on the left side (according to photo orientation). It definitely should affect impedance, isn't it?

Also, there is too small gap between signal wire on PCB and ground on SMA connector...
« Last Edit: September 09, 2019, 12:51:35 pm by radiolistener »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf