This current method of measuring tuner power loss is, at its essence, based upon the fifth technique (

**Technique 5**described in this earlier blog post (above). But I have simplified its calculations to focus on "Operating Power Gain" (Gp) (although I do also calculate "Transducer Gain" (Gt), but this is primarily for comparison purposes).

*)*

__Operating Power Gain, Gp:__Gp is simply the ratio of the power delivered to a network's load divided by the power delivered to the network (which in this case is a two-port network). Any difference in these two powers must be due to power lost

*within*the network.

Gp can be calculated using a network's 2-port S-parameters (S11, S12, S21, S22) and its load's gamma using the following equations:

(Derivation of Gp can be found here: UC Berkeley Notes)

__Transducer Gain, Gt:__Gt is slightly different from Gp in that it is the ratio of the power delivered to a network's load divided by the power

*available from the generator*.

Note that the Gt formula now includes terms representing the source's gamma. So Gt is also a function of the match between the source's impedance and the network's input impedance. Thus, if the source is not matched to the network's input impedance (i.e. not conjugately-matched), not all of the power that is

*available*from the generator will be delivered to the network.

So, for the purposes of calculating Antenna Tuner loss, Gt can be thought of as comprising

*two*sources of power loss. The first source of loss being the loss

*within*the network (i.e. the loss calculated with Gp), and the second loss being a loss due to the mismatch between source and network-input impedances (i.e. the loss due to a non-conjugate match between source and network-input impedances).

For antenna tuners adjusted for low SWR's (measured at the network's input port), Gt and Gp should be (essentially) identical. But as SWR increases, Gt loss will increase compared to Gp loss because of the the Gt loss's increasing source-to-network mismatch loss. Thus, Gt is not nearly as useful for determining Tuner power loss because it includes this additional "external to the tuner" loss.

(Derivation of Gt can be found here: UC Berkeley Notes)

__Determining Gp:__From the formulas above, to calculate Gp we need to measure a tuner's two-port S-parameters (S11, S21, S12, S22) when the tuner has been tuned to match (as best it can) a load, and we should also have the load's gamma (calculated from its own S11 parameters).

S-parameters are ideally measured with a Vector Network Analyzer (VNA), and the resulting data can then be used to calculate Gp. Although this calculation can be performed by hand, MATLAB software provides a convenient way to both capture the S-parameter data from the VNA (via MATLAB's "Instrument Control Box") and to perform the Gp calculation (via MATLAB's powergain() function in its RF Toolbox). Note that a

*single*MATLAB statement will calculate Gp:

Gp = powergain(s_params,z0,zl,'Gp')

What could be simpler?

__S-parameter Capture and Gp Calculation Using MATLAB:__The rest of this blog post describes how I measure Tuner power loss using my VNA and MATLAB.

I use the following equipment and software:

- An HP 8753C
**Vector Network Analyzer**(VNA) and an HP 85046A**S-Parameter Test Set**. - An Agilent 82357B
**USB/GPIB Interface Module**, to interface a computer to the VNA. - A recent version of
**MATLAB**, with the following toolboxes: 1)**RF Toolbox**, 2)**Instrument Control Toolbox**.

(A note regarding MATLAB: their "Home" version is, in my opinion, a great value, and it is this version that I personally use.)

Previously I have measured Tuner Loss with the tuner terminated (and tuned for) either a 5 ohm (resistive) or 500 ohm (resistive) load (when measuring loss in the Elecraft KAT-500 and also in my own tuner design). Both of these loads represent an SWR of 10:1. But other loads could be used, too.

As an example, I will go through the steps of measuring the loss within a Drake MN-4 "Matching Network" when it has been terminated with a 5 ohm load and tuned to a 1:1 SWR at 29 MHz.

(Note that the Drake MN-4 is only spec'd to tune loads with a

**maximum SWR of 5:1**. So a 5 ohm load is well outside its specified load range! Never the less, the tuner will match 5 ohms to 50 ohms on 29 MHz, and this is a load I have at hand, so I will use it as an example for measuring Tuner Loss).

__Procedure to Calculate Tuner Loss:____Step 1. Measure the Load's S11 characteristics:__

Strictly speaking, if the impedance of the Test Load is known (e.g. 5 ohms), this step can be skipped and the Test Load's impedance can simply be inserted into the "zl" field of MATLAB's

But I prefer to use the VNA to measure the load's

*powergain*function: powergain(s_params,z0,zl,'Gp').But I prefer to use the VNA to measure the load's

**S11 characteristics for the frequency range of interest. Below is my 5 ohm Test Load attached to Port 1 of the S-Parameter Test Set:***actual*
(Note that the 5-ohm load consists of two 10 ohm 1% resistors connected in parallel across the back of a female SMA connector).

The frequency range will be 28 to 30 MHz (because, from previous experiments, I know that the MN-4 can match a 5-ohm load at 29 MHz).

After setting up the VNA for the appropriate frequency range and performing a full

**two-port calibration**using the cables I will use to connect to the Tuner's ports (do not skip this step!), I use a MATLAB routine (vna_s11.m) written by Dick Benson, W1QG, to capture the load's S11 data:__Step 2: Store this S11 Data in S1P File Format:__

This same routine is then used to store the captured S11 data in S1P file format.

In this example, I have named the file: 180810_8753C_S11_5ohm_Load_28-30MHz.s1p .

In this example, I have named the file: 180810_8753C_S11_5ohm_Load_28-30MHz.s1p .

__Step 3: Attach the Test-Load to Tuner and Adjust for the Tuner for Minimum SWR:__

Now I need to tune the Tuner to match the 5 ohm Test Load. To do this, I first:

- Attach the 5-ohm load to the Tuner's "Antenna" port.
- Attach Port 1 of the S-Parameter Test Set to the Tuner's "Transmitter" port.

With the VNA still in S11 mode, I then

**tune the Tuner for minimum SWR**at the frequency of interest (e.g. 29.0 MHz).__Step 4: Measure S11 with the Tuned Tuner and Load:__

__This next step is optional__(because it is

*not*needed for calculating Gp). I do it to validate my measurements, as I will show, later.

With the Tuner tuned for minimum SWR, I then make another S11 capture using the VNA and the vna_s11.m MATLAB routine.

The results are stored in a new file, again in S1P format.

In this example, the file is: 180810_8753C_S11_MN-4_5ohm_load_28-30MHz.s1p

__Step 5: Remove the Test-Load and Measure the Tuner's S11, S12, S21, and S22 characteristics:__

**, I remove the 5-ohm Test Load from the Tuner's "Antenna Port" and connect this port instead to Port 2 of the S-Parameter Test Set, as shown below (The tuner's Transmitter port is on the left, and its Antenna port is on the right):**

*Without touching the Tuner's settings*(!!!)
Using the VNA, I capture S11, S12, S21, and S22 with a different MATLAB routine written by Dick Benson, W1QG to perform two-port S-Parameter capture (vna_gui_1.m):

__Step 6: Store this Data in S2P File Format:__

Via this same program (vna_gui_1.m), I then store this data in S2P file format.

In this example, the file is: 180810_8753C_ s2p_MN-4_tuned_for_5_ohms_28-30MHz.s2p.

In this example, the file is: 180810_8753C_ s2p_MN-4_tuned_for_5_ohms_28-30MHz.s2p.

__Step 7: Calculate the "Operating Power Gain" (Gp):__

To calculate Gp (and thus Tuner Power Loss)) I will use the following S-parameter files that I have created (above):

- The Load's S1P file: 180810_8753C_S11_5ohm_Load_28-30MHz.s1p
- The Tuner's S2P file: 180810_8753C_ s2p_MN-4_tuned_for_5_ohms_28-30MHz.s2p

The result will be the Tuner's power loss when it has been adjusted to match a 5 ohm load at 29 MHz.

To perform this calculation I use the MATLAB script below (Plotting_Network_Gp_from_S2P.m).

Note: I usually only write MATLAB routines once or twice a year, and in between each session I typically forget what I had learned previously (the hazards of age!). Please forgive any awkward MATLAB code that might offend the more experienced programmer!

% Plotting_Network_Gp_from_S2P.m % % Predicting Network Loss with MATLAB % Date: 180811 % % By Jeff Anderson, K6JCA, % from code originally written by Dick Benson, W1QG. clc; clearvars; close all; path=[pwd,'\']; dir; % Note: objects must have the SAME number of points (e.g. % 201 or 401) % HP 8753C generates S2P files with 201 points, while the % HP 3577A generates S1P and S2P files with 401 points. % Get the Load-only S1P file. This is simply the S11 data % of the load, itself. s= '180810_8753C_S11_5ohm_Load_28-30MHz.s1p'; [Load_Obj,Load_Notes,Load_State] = spar_read(path,s); % Get Network-only S2P file -- this is S11, S12, S21, S22 % of the network "tuned" to an SWR of 1:1 when the load % in the S1P file (above) was attached, but captured via % the VNA *without* the load attached. s= '180810_8753C_ s2p_MN-4_tuned_for_5_ohms_28-30MHz.s2p'; [Network_Obj,Network_Notes,Network_State]... = spar_read(path,s); % As an optional check, get the S1P file of the Network % with Load attached. This will then be compared to the % gamma data generated from the Network-only S2P file (above) % and the Load-only S1P file (also above). % % In other words, this is the S11 data for the network % tuned to an SWR of 1:1 WITH the load still attached. s= '180810_8753C_S11_MN-4_5ohm_load_28-30MHz.s1p'; [System_Obj,System_Notes,System_State]... = spar_read(path,s); Zo = Network_Obj.Z0; % 50 ohms for all s-parameter files. FreqMHz= Network_Obj.Freq*1e-6; % Freq Vector. % Convert the load's S11 data to Impedance (Z): Z_Load = gamma2z(Load_Obj.S_Parameters,Zo); % Calculate the Gamma at the network's input from the % network's S2P file data (with network tuned for % appropriate load) and that load's impedance % (also known as Z_Load). gamma = gammain(Network_Obj.S_Parameters,Zo,Z_Load); % And for the Gt calculation, set Zs to equal Zo. % Note that if Zs is set to equal the % complex conjugate of the impedance seen at the % tuner's input port, then Gt, when % calculated, will equal Gp. % To see this, set Zs to be: % Zs = conj(gamma2z(gamma)); % instead of the next statement: Zs = Zo; % So Zs now equals 50 ohms. % Calculating the power gains... % % Note that Gp has no dependence on the source impedance % (Zs). % It only depends on the Networks' S-Parameters (which % are Zo referenced) and the Load impedance. % % Gt is also calculated, but as SWR diverges from 1:1, % Gt will worsen (because it also depends upon the % source impedance's match to the Tuner's input Z). % Gp is thus the preferred value to use because of its % independence from the source impedance. GpSystem = powergain(Network_Obj.S_Parameters,... Zo,Z_Load,'Gp'); GtSystem = powergain(Network_Obj.S_Parameters,... Zo,Zs,Z_Load,'Gt'); % Calculate the SWR from the measured S11 data of the % Network with Load attached. SWR_System = vswr( squeeze(System_Obj.S_Parameters)); % Plots: % Figure 1: % Plot Gp and Gt losses % figure; x0=150; y0=80; width=600; height=500; set(gcf,'units','points','position',... [x0,y0,width,height]); h_lines= plot(FreqMHz,10*log10(abs(GpSystem)),... FreqMHz,10*log10(abs(GtSystem))); set(h_lines(1),'Linewidth',2); set(h_lines(2),'Linewidth',2,'Linestyle',':'); xlabel('Freq in MHz'); ylabel('Loss in dB'); legend('Gp Loss','Gt Loss','Location','east'); grid on grid minor ax = gca; ax.GridAlpha = 0.4; % Make grid less transparent. ax.GridColor = [0,0,0]; % ax.MinorGridAlpha = 0.5; % Make grid less transparent. ax.MinorGridColor = [0,0,0]; % title(['Power Loss, Drake MN-4 Matching Network',... ' Tuned for a 5 ohm Load']); % Figure 2: % Plot Smith Chart and compare the measured gamma % (from S11 measured at the network's input with the % load attached) versus the gamma derived from the % Network-only S2P file and the Load-only S1P file. % figure; x0=250; y0=150; width=600; height=500; set(gcf,'units','points','position',... [x0,y0,width,height]); hsm1 = smithchart(squeeze(System_Obj.S_Parameters)); set(hsm1,'Linewidth',2); hold; hsm2 = smithchart(gamma); % set(hsm2,'Linewidth',2,'Linestyle',':'); legend('Measured gamma',... 'Calculated gamma'); legend('Location','southwestoutside'); %legend('boxoff'); %title('180602'); tx=text(-1.8,1.1,['Drake MN-4 Matching Network,',char(10),... ' 5 ohm Load,',char(10),... ' 28-30 MHz']); tx.FontSize = 16; tx.FontWeight = 'bold';

Published with MATLAB® R2017aNote that this code has file names and other descriptors

**specific to the measurement of the Drake MN-4 Tuner when terminated with a 5 ohm load and measured at 29 MHz.**

To use for other networks, loads, or frequencies, the following changes should be made:

- Change the
**three file names**(one S2P file and two S1P files). - Change the
**Title**of Figure 1 (Gp and Gt losses), - Change the
**Text**of Figure 2 (Smith Chart)

Below are the resultant plots:

First, the Power Loss plot:

Note that Gp is -0.5954 dB at 29 MHz. This represents a power loss of 12.8%, calculated using this formula:

(Note, too, that Gp must be

Gt is also plotted, but it is not as useful for determining Tuner loss because Gt doesn't just represent Tuner loss, it also includes power loss due to any mismatch between the source's impedance and the tuner's input impedance. So if the SWR, after tuning the Tuner, is low (i.e. the tuner's input appears to be Zo (typically 50 ohms)), then Gt will essentially equal Gp. But as SWR increases, Gt will diverge from Gp and thus Gp will no longer accurately reflect only Tuner loss.

As an aside, note that if the source impedance, Zs, in the Gt calculation is defined to be the

where "gamma" is calculated earlier in the code and represents the gamma of the Tuner's input when the Tuner is tuned to minimize SWR with the Test-load attached to the Tuner's Antenna port.

As an additional (and optional) verification step (per Step 4, above), I also compare the measured gamma versus the gamma predicted from the independently captured Network S2P and Load S1P files...

Power Loss (percent) = 100 * ( 1 - 10^(Gp/10) )

*negative*when calculating a loss with this formula).Gt is also plotted, but it is not as useful for determining Tuner loss because Gt doesn't just represent Tuner loss, it also includes power loss due to any mismatch between the source's impedance and the tuner's input impedance. So if the SWR, after tuning the Tuner, is low (i.e. the tuner's input appears to be Zo (typically 50 ohms)), then Gt will essentially equal Gp. But as SWR increases, Gt will diverge from Gp and thus Gp will no longer accurately reflect only Tuner loss.

As an aside, note that if the source impedance, Zs, in the Gt calculation is defined to be the

*complex-conjugate*of the tuner's input impedance when the tuner is terminated with the Test-load, then Gt*will***Gp. You can see this using the MATLAB code, above, by changing the definition of Zs from "Zs = Zo" (i.e. Zs = 50 ohms) to:***equal*
Zs = conj(gamma2z(gamma))

As an additional (and optional) verification step (per Step 4, above), I also compare the measured gamma versus the gamma predicted from the independently captured Network S2P and Load S1P files...

You can see that the two curves are quite close, as they should be.

__One final note:__as I mentioned above, this 5 ohm load is well outside the MN-4's range of spec'd loads (it is spec'd for loads having up to a 5:1 SWR). Please do not take this example of a 12.8% loss to represent what MN-4 loss would be with less extreme loads.

__Obtaining the MATLAB scripts:__If you would like copies of any of the MATLAB scripts or GUIs listed above, please email me.

**Standard Caveat:**As always, I might have made a mistake in my equations, assumptions, drawings, or interpretations. If you see anything you believe to be in error or if anything is confusing, please feel free to contact me or comment below.

And so I should add -- this information is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

## No comments:

Post a Comment