VNA cal kit modelling script install guide - Page 1
Forum section: electronics / rf-microwave

author: hendorog
author_rank: Super Contributor
timestamp: February 28, 2018, 08:33:09 am
content: I've written an install guide for IN3OTD's cal kit modelling script.His page is here:http://www.qsl.net/in3otd/electronics/VNA_calkit/calkit.htmlThis has been discussed and used over in this thread:https://www.eevblog.com/forum/testgear/kirkby-calibration-kit-alternatives/It takes an s1p file for each standard, and outputs the characterising data you need to enter into the VNA.Getting this working on Windows is a bit of a hassle, due to its dependancy on NLopt. So I have documented it to make life easier. Hopefully it saves a bit of time.It produces output like this, along with a number of graphs which show how well it fits the data.Code:Optimization results:offs_delay = 52.198199 psoffs_loss = 5.475853 Gohm/soffs_Z0 = 48.922942 ohmC0 = -225.264412 * 1e-15 FC1 = -2021.918164 * 1e-27 F/HzC2 = 2334.234374 * 1e-36 F/Hz^2C3 = -242.942624 * 1e-45 F/Hz^3Residual RMS error : -67.161024 dBEdit: Minor edit to instructions.

author: mgberry
author_rank: Newbie
timestamp: March 14, 2018, 10:39:13 pm
content: This is very helpful...Thanks.I also had some real issues getting NLopt up and running awhile back. The script is pretty handy for creating your own cal standards.Thanks,Matt

author: Bud
author_rank: Super Contributor
timestamp: March 14, 2018, 11:53:37 pm
content: @hendorog while it may seem obvious to some, i think you should mention that a calibrated VNA is required to measure the standards under test to make s1p files.

author: hendorog
author_rank: Super Contributor
timestamp: March 15, 2018, 01:06:58 am
content: Quote from: Bud on March 14, 2018, 11:53:37 pmGood point - and there is no overview which provides the big picture either.

author: mark03
author_rank: Frequent Contributor
timestamp: June 03, 2019, 05:28:51 pm
content: I realize this is an old thread, but thought someone might benefit from seeing a concrete example. I built an open/short/load set of female SMA standards very similar to Claudio's and others. For the load I used 2x 100-ohm thin film resistors from Susumu:https://www.digikey.com/product-detail/en/susumu/RG2012V-101-P-T1/RG2012V100PCT-ND/1248326METAS VNA Tools also offers a cal-kit model fitting tool, which I used in conjunction with Claudio's Octave script. The VNA Tools fitter is a bit more user friendly, offering a nice dialog where you can set the parameter initialization and lock parameters at will, while watching a graph of the fit accuracy. OTOH I caught VNA Tools making an error which unfortunately means I cannot entirely trust its output; under certain conditions when the parameters hit their limits, the rms fit statistic and the graphs are incorrect. So I mostly used VNA Tools to get a feel for how to constrain the parameters, then used the Octave script for final optimization.I did not have access to a fancy calibrated VNA for the initial measurements, but a friend loaned me his Copper Mountain cal kit (good to 9 GHz). I entered the data-sheet coefs into my Agilent 4396B combo analyzer (300 kHz to 1.8 GHz) as a user kit, then measured my homemade standards. I fixed the test cable in place as best I could for stable measurements. Results:Open fit -61 dB rms:offset delay = 38.07 psoffset loss = 11.96 Gohm/soffset Z0 = 50 ohms (constrained)C0 = -0.1448e-15 FC1 = 1904e-27 F/HzC2 = -968e-36 F/Hz^2Short fit -59 dB rms:offset delay = 37.14 psoffset loss = 2.67 Gohm/soffset Z0 = 49.44 ohmsLoad fit -77 dB rms:offset delay = 80.4 psoffset loss = 0offset Z0 = 50.95 ohmsarbitrary termination = 50.02 ohms (of dubious utility, but, why not)The load measurement is curious. My resistors were .02% tolerance, and at DC the impedance is as close to 50 ohms as I am able to measure, yet the calibrated return-loss measurement is "only" -42 dB at ~ 1 MHz. The 4396B supports "arbitrary impedance" load standards, so by calling my load 49.21 ohms I get an excellent fit to the measured data. Something doesn't add up.UPDATE:The reason for this was fairly obvious: I measured the primary calibration standard and found its DC resistance ~ 50.8 ohms! This is still within spec (better than -38 dB return loss to 9 GHz), but much-improved modeling results were obtained by entering that load in the VNA as "arbitrary impedance" with the measured DC value, re-measuring the DIY standards, and re-fitting. The modeling results are now better all around. Data and plots updated to reflect this.In the meantime, I had to rip apart my VNA and test set again to try and diagnose a problem with two-port measurements. Disappointingly, all indications are that the 4396B does not support test sets with mechanical transfer switches (seehttps://www.eevblog.com/forum/repair/agilent-4396b-spectrumnetworkimpedance-analyzer-repair/msg2459730/#msg2459730) despite it being a contemporary of the 8753 seriesThus I am now looking at ways to upgrade my test set to electronic switching.Thanks again to Claudio IN3OTD for his useful model-fitting code!

author: Bud
author_rank: Super Contributor
timestamp: June 03, 2019, 06:28:06 pm
content: I'd advise to be careful with Susumi. from experience their precision resistors behaved weird when heat test was applied. The resistance changed when heat was applied but did not swing back after heat was removed. I never use Susimi resistors since then, i use Panasonic ones.

author: mark03
author_rank: Frequent Contributor
timestamp: June 10, 2019, 12:45:19 am
content: That wasn't the problem here; the finished standard is very close to 50 ohms. The problem was assuming that the professional load standard was 50.0 ohms, when it was actually closer to 50.8 at low frequency. Now the results make sense and are significantly better (post updated above).

author: OH2LIY
author_rank: Contributor
timestamp: June 15, 2019, 10:18:26 am
content: Hi, I did loan R&S ZNB20 VNA and ZV-Z52 + ZN-Z51 autocals from my good friend. Softwares I installed to RPi3 (very easy, calculating speed is other thing). Everything runs nicely, but every calculating run I get different results (short seems to be ab. ok, but open gives problem).Doing several runs, default opt.algorithm = NLOPT_GN_CRS2_LM options gives badly wrong offs_delay and offs_Z0. Changing to NLOPT_GN_DIRECT_L_RAND gives realistic values for offs_delay and offs_Z0 but C0 to C4 are still wildly changing.Here is measured ZV-Z135 vs. ZV-Z52Code:ZV-Z135 1. runNLOPT_GN_CRS2_LMNLOPT_GN_DIRECT_L_RANDNLOPT_GN_DIRECT_L_RANDNLOPT_GN_DIRECT_L_RANDfrom R&S datasheetoffs_delay = 42.371331 psoffs_delay = 30.080272 psoffs_delay = 30.193585 psoffs_delay = 30.192812 ps30,821ps 9,24mmoffs_loss = 10.514279 Gohm/soffs_loss = 2.290398 Gohm/soffs_loss = 3.477191 Gohm/soffs_loss = 3.386195 Gohm/soffs_Z0 = 30.000000 ohmoffs_Z0 = 48.998628 ohmoffs_Z0 = 49.179694 ohmoffs_Z0 = 49.176977 ohmC0 = -798.986893 * 1e-15 FC0 = 0.169351 * 1e-15 FC0 = 0.267923 * 1e-15 FC0 = 0.244675 * 1e-15 F-7,425fFC1 = 10000.000000 * 1e-27 F/HzC1 = 1708.355208 * 1e-27 F/HzC1 = 1404.316218 * 1e-27 F/HzC1 = 1376.810395 * 1e-27 F/Hz2,47fFC2 = -8433.135261 * 1e-36 F/Hz^2C2 = -10.556205 * 1e-36 F/Hz^2C2 = -9.216564 * 1e-36 F/Hz^2C2 = -10.762751 * 1e-36 F/Hz^2-0,226fFC3 = 1671.350599 * 1e-45 F/Hz^3C3 = -0.169351 * 1e-45 F/Hz^3C3 = -0.473050 * 1e-45 F/Hz^3C3 = -0.192145 * 1e-45 F/Hz^30,00618fFResidual RMS error : -48.185993 dBResidual RMS error : -49.189880 dBResidual RMS error : -49.196187 dBHere is Anritsu 22KF50. Using VNA I approximate electrical lenght to be ab. 42,009psCode:22KF50 (female)OPEN20GHz data 1001ptsNLOPT_GN_DIRECT_L_RANDNLOPT_GN_DIRECT_L_RANDNLOPT_GN_DIRECT_L_RANDoffs_delay = 28.710349 psoffs_delay = 41.587105 psoffs_delay = 40.474517 psoffs_delay = 41.279768 psoffs_loss = 1.880376 Gohm/soffs_loss = 1.178295 Gohm/soffs_loss = 1.977415 Gohm/soffs_loss = 1.810120 Gohm/soffs_Z0 = 48.876609 ohmoffs_Z0 = 49.886187 ohmoffs_Z0 = 49.280887 ohmoffs_Z0 = 49.943507 ohmC0 = 242.172088 * 1e-15 FC0 = -1.573142 * 1e-15 FC0 = 4.518946 * 1e-15 FC0 = -0.384148 * 1e-15 FC1 = 2097.143813 * 1e-27 F/HzC1 = -97.836874 * 1e-27 F/HzC1 = 3487.316352 * 1e-27 F/HzC1 = 1030.916293 * 1e-27 F/HzC2 = 586.611516 * 1e-36 F/Hz^2C2 = 88.301227 * 1e-36 F/Hz^2C2 = -44.735429 * 1e-36 F/Hz^2C2 = 30.721115 * 1e-36 F/Hz^2C3 = 45.725005 * 1e-45 F/Hz^3C3 = 1.573925 * 1e-45 F/Hz^3C3 = -2.791711 * 1e-45 F/Hz^3C3 = 0.982168 * 1e-45 F/Hz^3Residual RMS error : -56.410139 dBResidual RMS error : -45.885849 dBResidual RMS error : -46.602073 dBResidual RMS error : -47.469405 dBIf someone is interested, I added my measurements... I still have to make N/7mm connector measurements, saddly I have to return VNA after weekend (my own HP8720C is soooo slow and ancient comparing....)OH2LIY Ramppa

author: OH2LIY
author_rank: Contributor
timestamp: June 15, 2019, 10:20:52 am
content: couple pictures....

author: mark03
author_rank: Frequent Contributor
timestamp: June 16, 2019, 05:40:02 am
content: Quote from: OH2LIY on June 15, 2019, 10:18:26 amSometimes the solution appears under-determined, where two or more variables spin wildly without any real change in the goodness of fit. It can then help to fix one of the parameters, e.g. force offset Z0 = 50. Also, I think it's normal for the higher-order capacitance polynomial coefs to vary from one run to the next, because at these frequencies they have essentially no effect. They are "placebo parameters". As long as the fit looks about right and none of the parameters are stuck at their extreme values, you should be fine.Can you post pictures of your homemade standards?

author: hendorog
author_rank: Super Contributor
timestamp: June 16, 2019, 11:43:58 pm
content: To get a better fit we found it can be useful to reduce the frequency range - e.g. DC-3GHz and 3GHz-6GHz.The downside is that you need to change the cal to suit the frequency of course.The more 'ideal' way is to do avoid this fitting step entirely, and do the calculations on a PC using software Metas or scikit-rf using actual measurements of the standards and the DUT.

author: OH2LIY
author_rank: Contributor
timestamp: June 17, 2019, 03:05:29 pm
content: Quote from: mark03 on June 16, 2019, 05:40:02 amYears ago, when I got my first HP8753A, back then I used homemade N-male short and open. Load was Suhner, selected from bigger pile to be bestest available. But after those, I got Anritsu 3753LF kit and HP85032B. Measuring these standards was just for curiosity. Actually I have Anritsu 22K50/22KF50 and I'd like to use them on my HP8720C. There is no known specs for those standards.Ramppa

author: OH2LIY
author_rank: Contributor
timestamp: June 17, 2019, 03:07:35 pm
content: Quote from: hendorog on June 16, 2019, 11:43:58 pmTnx, I'll have to try find Metas and/or scikit-rf and study more how to use them...

author: geraldSOENCO
author_rank: Newbie
timestamp: December 09, 2022, 03:57:49 pm
content: Good Morning hendorog,I know I'm a little late on this post, I'm following the HOWTO instruction for the octave graphs and I have a couple .s1p files but I'm not sure which directory I should store them in order to "call" them in the calkit_model() function.I've trying copying them to the Octave site C:\Octave\Octave-4.2.1\lib\octave\site\oct\x86_64-w64-mingw32 but no luckAny help is greatly appreciated!!Jerry