Keyboard Shortcuts
ctrl + shift + ? :
Show all keyboard shortcuts
ctrl + g :
Navigate to a group
ctrl + shift + f :
Find
ctrl + / :
Quick actions
esc to dismiss
Likes
- Nanovna-Users
- Messages
Search
Re: TDR Python Script
I am absolutely blown away by this thread. I was working on TDR via VNA, but had not started to write any code. Just looking at the mathematics very closely. Particularly because of the manner in which the problem is treated in Dunsmore's book, which has a strong "Professionals at work, don't try this yourself." tone.
Clearly the basic work is done, so I am changing direction and will focus on crafting test cases. I spent much of my career in the oil industry finding and fixing bugs in 2.5 million lines of seismic processing codes. The oil industry seismic community was doing DSP almost 20 years before EE started doing it. We could make money with a 125 Hz Nyquist. Digital processing was *much* easier than doing it on analog data. So Geophysical Services Incorporated, the parent company of Texas Instruments, threw huge sums of money at TI to figure out how to make the data acquisition equipment. Eventually TI sold GSI which later shut down for lack of revenue during one of the downturns. The resolution for TDR work is a function of the maximum frequency and the phase resolution. I don't yet know if we can wedge an FFT into flash or not. I've got a prime factor FFT algorithm which is probably 2 dozen lines of FORTRAN, so it might be possible. But at $35 delivered from China, writing TDR only FW would make it a *very* useful tool worth having for even occasional use. I've got some chores to do and you're all running *very* fast. I'll try not to fall too far behind, but it's likely to take me a while to catch up. Kirkby talking me into getting one of these when we were chatting on the phone and Dave was right. Wow! It is a tour de force of T&M design. Have Fun! Reg |
Re: TDR Python Script
Dr. David Kirkby from Kirkby Microwave Ltd
On Sun, 1 Sep 2019 at 15:55, Jeff Anderson <jca1955@...> wrote:
Hi neb (or anyone else who has s1p file for TDR analysis) Hello Would it be possible for you to post your s1p file to Github? I've just written a Matlab script to do the TDR function, and I would like to verify It is obviously good to have code to do the TDR analysis on a .s1p file. But having the TDR in real time is very useful. To pick the most obvious example I can think of, if you have *intermittent* problems on a cable, you can bash the cable around until you see a problem on the time domain. You can see if there is an open, short, or some other change in impedance that might indicate that the dielectric is damaged resulting in a change of impedance. You can¡¯t do that very easily post processing Touchstone files, bug obviously it is best to start development of code outside the VNA. There are several ways I can process .s1p to get time domain data, but whilst the first two require hardware, so cost money, the others are available to anyone for *FREE*. *Expensive as they need hardware * 1) I have access to a Keysight N5247A. I can read a .s1p file and give you the time domain. That instrument covers 10 MHz to 67 GHz. 2) If you want me to make low frequency measurements down to 300 kHz, I can do them on an 8753ES VNA. I can save a Touchstone file, but I don¡¯t know if it even possible to save the time domain data, despite the instrument has the time domain option. *FREE for anyone * 3) The software for the relatively low cost 1.3 GHz VNWA can be downloaded *FREE*. That will work in demo mode without owning a VNWA. It can open a .s1p file and produce the time domain data. The VNWA software has more configurable TDR parameters than any other VNA - more than the PNA-X which I expect cost over a million USD. I am unsure of the usefulness of all these options on the VNWA though. 4) The software for the Copper Mountain VNAs is also a *FREE* download. That runs in demo mode without the hardware. 5) The software for the LA Techniques VNAs will run in demo mode. I have only used that a couple of times, so are unsure of its capabilities. There are probably other USB controlled VNAs, for which the software can be downloaded free and run in demo mode. Personally I would only use your time on the very professional Copper Mountain software or the VNWA. Other software, (in particular the Picktech VNA) is just a joke. The good thing about the VNWA software is there¡¯s very good support on the VNWA forum, including from the developer. For example, with a length of coax whose S11 was measured from 1 to 60 I suggest that you look with the VNWA software. If you get stuck, ask on the VNWA list.
Dave, G8WRB Dr. David Kirkby, Kirkby Microwave Ltd, drkirkby@... Telephone 01621-680100./ +44 1621 680100 Registered in England & Wales. Company number 08914892. Registered office: Stokes Hall Lodge, Burnham Rd, Althorne, Chelmsford, Essex, CM3 6DT, United Kingdom |
Re: nanoVNA for Dummies
Here is the MENU flow chart:
/g/nanovna-users/files/Miscellaneous/nanoVNA%20Menu%20Structure%20v1.1.pdf This is helpful as it permits you to get an eagle eye view of the instrument soft key flow top view. Alan |
Re: nanoVNA for Dummies
Hi Bruce,
Try this file: /g/nanovna-users/files/NanoVNA%20Calibration%20Considerations%20and%20Procedure_v1.0.pdf It is in the FILE DIRECTORY FOLDER. Also, there is a MENU breakdown flow chart that is very easy to follow and will provide quite a bit of assistance with the manual in hand. Alan |
Re: TDR Python Script
Thanks very much, Rune. I was wondering why they weren't exactly the same. And so I compared your code at to my Matlab script (listed, below).
Functionally, your python and my matlab code look identical to me, unless I missed something. (Note: apart from one small difference -- the x-axis of my time-response plot is divided-by-two, so that the x-coordinate of the blip matches the stated length). Best regards, - Jeff, k6jca % **** % Time-Domain Response from S11 data % (requires .s1p file) -- K6JCA % **** s = 'RG-8_0.66_6.81m_10_282MHz.s1p'; % file containing s11 data [Gamma_Obj,coax_Notes,coax_State] = spar_read(path,s); % get s-parameter data. Zo = Gamma_Obj.Z0; % This should be 50 ohms FreqHz = Gamma_Obj.Freq; % AND assume Freq Vector is the same for all as well. s11 = squeeze(Gamma_Obj.S_Parameters(1,1,:)); Z_coax = gamma2z(Gamma_Obj.S_Parameters,Zo); Zin = squeeze(Z_coax); Rloss = 20.*log10(abs((Zin-Zo)./(Zin+Zo))); Freq = FreqHz.'; % convert column vector to row vector FreqMHz = Freq./1e6; % convert Hz to MHz % Vfactor = 0.69; % velocity factor for RG303 coax % Vfactor = 0.84; % velocity factor for 9913 coax Vfactor = 0.66; % velocity factor for RG58A coax c0 = 299792458; % speed of light in vacuum, m/s [Row,Npoints]=size(Freq); % Number of points in s11 file (Odd Integer) start_f = FreqMHz(1); stop_f = FreqMHz(Npoints); delta_f = Freq(2)-Freq(1); window = blackman(Npoints); windowed_s11 = window.*s11; NFFT = 16384; td = abs(ifft(windowed_s11, NFFT)); delta_time = 1 / delta_f; t_axis = linspace(0, delta_time, NFFT); d_axis = t_axis * c0 * Vfactor / 2; [max_td,index] = max(td); length = d_axis(index); length_in = length*39.370; length_feet = length_in/12; rem_in = mod(length_in,12); figure(1); plot(FreqMHz,Rloss); tlbl1 = sprintf('Return Loss, Frequency Domain Response'); freq_lbl = sprintf('(Start %.3f MHz, Stop %.3f MHz)',start_f,stop_f); title1 = char(tlbl1,s,freq_lbl); title(title1,'Interpreter','none'); ylabel('Return Loss (dB)'); xlabel('Frequency (MHz)'); grid on; set(gcf,'position',[400,500,550,300]) figure(3); plot(d_axis, td,'linewidth',2); ylabel("magnitude"); tlbl3 = sprintf('Return Loss, Time Domain'); xlbl = sprintf('length (m)\n\r \n\rLength = %.3f meters,... given Vf = %.3f\n\r(%.2f inches, or %.0f '', %.2f ")\n\r',... length,Vfactor,length_in,length_feet,rem_in); title3 = char(tlbl3,s); title(title3,'Interpreter','none'); xlabel(xlbl); grid on; set(gcf,'position',[600,300,550,300]) |
Re: NanoVNA with a cracked screen
For those looking for the compatible 3.2 inch display, just do a search on eBay with the following two items in the same line: ili9341 3.2
You'll see individual panels for sale. Check the pinouts in the description and compare to the 2.8" display pinouts (check the nano's schematic for that). Regards Larry |
nanoVNA for Dummies
It's always bewildering to wander into someplace and find that you're trapped inside
someone's jargon jungle. I've found myself in that shape when I wandered into the nanoVNA Users group. I'm a noobie when it comes to the nanoVNA. I've owned a miniVNA but the gui is far different. The interface presents measurements according to known task names making selections a lot simpler. The price difference between the two is 10 to 1. When the magic smoke got let out of miniVNA, I knew I needed a much more affordable instrument. I don't need lab grade for what I do hence my purchase of the nanoVNA, a good deal. I came to this group looking for help. I'm sure it's here but filtering through the myriad of messages make the discovery task a chore. The user manual really isn't too much help. It is obviously written by someone whose first language is not English but the effort is appreciated. Looking for help in the various messages means wading through much expert-speak to get to a simple explanation. What is needed by this oldie-newbie is a manual, or series of tutorials, which give, step by step, instructions which uses the nanoVNA to perform simple(?) tasks. For instance, proper calibration is emphasized throughout many messages but nowhere are there instructions which show how to perform calibration. And if more than one calibration type is required, a tutorial which shows how to do each. Something else, there is a document which details the console commands for the nanoVNA. What application is used to communicate with the device? Surely not the touch screen! And if you communicate serially through the USB port, what are the parameters of that port? For other tasks to be performed by the nano, just look at the miniVNA document referenced elsewhere in this forum. It's a good document but, as I said, the user interface is far different from the nano. Folks, I'm not complaining (well, maybe I am ... I'm old and in a hurry), but I just want to get along with my learning so that I, too, can acquire a new expert-speak language, voila'! Bruce, K4TQL |
Re: TDR Python Script
Wow! Have I got a lot of catching up to do!
I tried, but was unable to find out anything about the xtal which on mine is marked "H26.0 D439" and measures ~3.6 x 2.1 mm. Between xtal and cable variations on the physical side and sampling on the mathematical side, 0.1% accuracy seems rather good. I'll create some test cases to run through the TDR codes where we know what the answer should be. Does anyone know how much of flash is unused on the STM32F072C8T6? It would be *really* useful to have a built in TDR function. I'm staggered that these are $35 delivered from China. I bought one for $50 because I didn't want to wait. Have Fun! Reg |
Re: TDR Python Script
I forgot to screenshot the lengths my software gave, so I'm not sure.
toggle quoted message
Show quoted text
Whoops. But the 8.5m coax is still connected, and currently shows at 8.516 at 0.66 Vf measured to 800MHz. So we're within 8mm of each other. I doubt we're going to get much better results than this anyway. And the velocity factor is usually given to an accuracy of "0.66" or rarely "0.659" - and our difference is equivalent to a difference in Vf of 0.0006. -- Rune / 5Q5R On Sun, 1 Sep 2019 at 17:55, Jeff Anderson <jca1955@...> wrote:
Many thanks, Rune! |
Re: TDR Python Script
Many thanks, Rune!
Using your files, my Matlab script gives me the following lengths (assuming Vf of 0.66): - RG58 measured to 60 MHz: 1.424m - RG58 measured to 800 MHz: 1.363m - RG213 measured to 60 MHz: 8.545m - RG213 measured to 800 MHz: 8.524m Do you calculate the same? - Jeff, k6jca |
Re: TDR Python Script
On Sun, Sep 1, 2019 at 10:55 PM, Jeff Anderson wrote:
Hi Jeff, As per your request. Kind regards, neb 9913_0.84_30.05m_10_282MHz.s1p
9913_0.84_30.05m_10_282MHz.s1p
RG-8_0.66_1.23m_10_282MHz.s1p
RG-8_0.66_1.23m_10_282MHz.s1p
RG-8_0.66_6.81m_10_282MHz.s1p
RG-8_0.66_6.81m_10_282MHz.s1p
|
Re: TDR Python Script
Thanks Rudi, I'll get those added!
toggle quoted message
Show quoted text
-- Rune / 5Q5R On Sun, 1 Sep 2019 at 17:22, <reuterr@...> wrote:
Hello Rune, |
Re: TDR Python Script
Hello Rune,
TDR works for me. I have added 3 thin coax cable data: self.tdr_velocity_dropdown.addItem("RG174 (0.66)", 0.66) self.tdr_velocity_dropdown.addItem("RG316 (0.69)", 0.69) self.tdr_velocity_dropdown.addItem("RG402 (0.695)", 0.695) Maybe a sentence in your README to make it easier to use: "Connect the coax cable to the nanoVNA TX port calibration plane, which could already be a short coax cable." Thank you for the TDR extension. 73, Rudi DL5FA |
Re: Better, Worse, Worst....... baloney.
Hi I also Have a Mini 1300 (EU1KY) that also uses a Si5351 chip and will only go to 280 MHz,
My Nanovna Si5351 chip goes to 300mhz also, I am also thinking of getting some more Si5351 chips and swapping out the one in the mini 1300 (could be better or worse) Dave 2E0DMB |
Re: TDR Python Script
If you want test data, find attached the following:
toggle quoted message
Show quoted text
1-800MHz 1.4 metre RG-58 1-60 MHz 1.4 metre RG-58 1-800MHz 8.5 metre RG-213 1-60MHz 8.5 metre RG-213 All files should have 1010 data points :-) -- Rune / 5Q5R On Sun, 1 Sep 2019 at 16:55, Jeff Anderson <jca1955@...> wrote:
Hi neb (or anyone else who has s1p file for TDR analysis) 1-800 8.5m RG213.s1p
1-800 8.5m RG213.s1p
1-60 1.4m RG58.s1p
1-60 1.4m RG58.s1p
1-800 1.4m RG58.s1p
1-800 1.4m RG58.s1p
1-60 8.5m RG213.s1p
1-60 8.5m RG213.s1p
|
Re: TDR Python Script
Hi neb (or anyone else who has s1p file for TDR analysis)
Would it be possible for you to post your s1p file to Github? I've just written a Matlab script to do the TDR function, and I would like to verify its math against what others are seeing. For example, with a length of coax whose S11 was measured from 1 to 60 MHz, I get the attached responses (the time-domain response may or may not be correct, which is what I would like to verify). If anyone would like to do the same thing, my s1p file for this measurement is here: Thanks, - Jeff, k6jca |
to navigate to use esc to dismiss