Not Purely Reactive

vectorBridge3

If your DUT is not purely reactive, which means Z(DUT)=R+jX has some none-zero R, V2 is not on the circle, but on somewhere within the circle.

vectorBridge4

But in those cases, V(DUT) can be divided into two orthogonal vectors, V(by L) and V(by R), and the end point of the vector V(by L) is still on the circle. (Note that here we assume X>0, or in other words, your DUT is inductive, thus V2 is in the upper half.)

bridgeYellow

The fact that the end point of the vector V(by L), is always on the circle is understood easily by considering the real part of your DUT, R4 in the yellow box, as belonging to R3.

bridgeGreen

Your DUT is now purely reactive, and you are measuring the device with R3+R4, instead of with R3.

Purely Reactive

vectorBridge2

If your DUT is purely reactive, which means Z(DUT)=R+jX has no resistive part, V(DUT) vector and V(R3) vector are orthogonal, and hence V2 is on the circle with its diameter being V(R2) plus V(R1) vectors.

If the DUT is inductive, V2 is on the upper half of the circle, because the V2 phase is in advance relative to V1, and if capacitive, on the lower half.

What happens if the DUT has some resistive part? You will find V2 not on the circle, but within the circle. Do you ever find V2 out of the circle? The answer is never unless you can realize negative resistance with your DUT.

All those things are obvious for you?

Vectors and Bridge

capture_001_26062014_174851

Let’s see how we compute the impedance of the DUT (R4+L1, in the figure) by observing V1 and V2.

vectorBridge

In this particular example, we observe from the waveforms that V2/V1=0.5367, and V2 is advanced in relative to V1 with 55.48deg. We arbitrarily draw V1 as (0.5, 0.0) and V2 accordingly to get the diagram. Note that V(R1)=V(R2), due to the same impedance and the same current, and V(R1)+V(R2)=V(R3)+V(DUT), because they are both equal to V3.

Now some calculations:

z0=50.0+0.0j # define system impedance
cv1=1.0+0.0j # V1 as a complex number
cv2=vratio*(cos(phase2advance)+sin(phase2advance)*1.0j) # V2 as a complex number
cvr=2.0*cv1-cv2 # V(R3)
cz=z0*(cv2/cvr) # the same current for both DUT and R3
gamma1=(cz-z0)/(cz+z0) # a well-known formula
swr=(1+abs(gamma))/(1-abs(gamma)) # another well-known formula
# another method
cvfwd=cv1
cvrfl=cv2-cv1
gamma2=cvrfl/cvfwd # check yourself that gamma1 and gamma2 are the same

LTspice and Bridge (2)

bridgeAnt

Just one more example. In this case the DUT=5.21[ohm]+325.96[nH].

If you put the V1 and V2 waveforms into the Python program, you will get:

figure_6

bridge2c

that Z(DUT)=5.21+j14.39[ohm], where X(DUT)=2.0*3.1416*7026kHz*325.96nH=14.39[ohm].

Please also see the Figure 4 of my article, Antenna Impedance, in which case it is concluded that Z(DUT)=5.21+j14.39 [ohm] from the actual measurement.

LTspice and Bridge

capture_001_24062014_191340

This is a simulation by LTspice for an impedance bridge, where the DUT is an inductor of 1uH and the frequency of the input signal is 7MHz.

figure_1

We put the simulated waveform of V1 and V2 into a Python program.

bridgeL

We see that Z(DUT)=(0.00903879437834+44.0103397701j), and because X(DUT)=2.0*3.14*7MHz*1uH=43.96 [ohm], it seems that the program is working fine.

Cable Length

cable7001kHz

I am using a 5D-2V calbe for my dipole. V1 and V2 are measured at both ends of the cable.

V2(blue)/V1(green) = 0.926371240154
V2(blue) phase advance against V1(green)= -253.07921443 deg. (V2 is in advance if positive)

The electrical length of the cable is (300.0m/7.001MHz)*(253.08/360.0)=30.12m, and the physical length 20.18m, assuming the velocity factor of 0.67.

cableLength

Measuring the length with different frequencies gives this result, where the numbers 1 through 8 corresponds to the 3.5MHz/7MHz/10MHz/14MHz/18MHz/21MHz/24MHz/28MHz band, respectively.

Antenna Impedance

dummyload

Now we are ready for measuring the antenna impedance. First, a dummy load is used as a DUT.

dummyload2

You see that Z(DUT)=49.64-0.50j [ohm], and VSWR=1.01.

open

The DUT is an open circuit.

open2

Since V2/V1 is 2.0036, which exceeds the maximum value of 2.0, Z(DUT) is not obtained correctly.

dipole

Finally, my dipole antenna for 40m band with stub match removed.

dipole2

Now Z(DUT)=5.21+j14.39 [ohm], and VSWR=10.38.

import numpy as np
import pylab as pl
from scipy.optimize import curve_fit
def sinfunc(x,a,b,c,d):
# positive c means graph in right
    return a*np.sin((x-c)*(2.0*np.pi/b))+d
def findamp(x):
    return (max(x)-min(x))/2.0
def find0cross(x):
    n=0
    while x[n] >= 0: # skip while positive
        n+=1
    while x[n] < 0:  # skip while negative
        n+=1
    n1=n             # 1st neg to pos transition
    n+=10            # skip a little bit
    while x[n] >= 0: # skip while positive
        n+=1
    while x[n] < 0:  # skip while negative
        n+=1         # 2nd neg to pos transition
    n2=n
    return [n1, n2]

t, v1, v2 = np.loadtxt('7026kHzAnt.csv', unpack=True, delimiter=',')

#v1=3456*sin(t*(2.0*np.pi/444)+0.2)-111.1
#v2=4321*cos(t*(2.0*np.pi/444)+0.2)+222.2

fig=pl.figure(figsize=(12,8),dpi=75)
axes=fig.add_axes([0.1,0.1,0.8,0.8])
axes.plot(t,v1,'g--',lw=4)
axes.plot(t,v2,'b--',lw=4)
axes.set_xlabel('time')
axes.set_ylabel('Voltage')
axes.set_title('7MHz Dipole')

a1=findamp(v1)
a2=findamp(v2)
n11, n12 = find0cross(v1)
n21, n22 = find0cross(v2)
p1=n12-n11
p2=n22-n21
pave=(p1+p2)/2
o1=0.0
o2=0.0
guess1=[a1,pave,n11,o1]
guess2=[a2,pave,n21,o2]

fitpars1, covmat1 = curve_fit(sinfunc,t,v1,guess1)
fitpars2, covmat2 = curve_fit(sinfunc,t,v2,guess2)
axes.plot(t,sinfunc(t, *fitpars1),'r')
axes.plot(t,sinfunc(t, *fitpars2),'r')
axes.grid(True)

vratio=fitpars2[0]/fitpars1[0]
# positive c means graph in right, or delay is positive
phase2delay=2.0*np.pi*((fitpars2[2]-fitpars1[2])/((fitpars1[1]+fitpars2[1])/2.0))
phase2advance=-phase2delay

z0=50.0+0.0j
cv1=1.0+0.0j
cv2=vratio*(cos(phase2advance)+sin(phase2advance)*1.0j)
cvr=2.0*cv1-cv2
cz=z0*(cv2/cvr)
gamma=(cz-z0)/(cz+z0)
swr=(1+abs(gamma))/(1-abs(gamma))
print gamma, swr
cvfwd=cv1
cvrfl=cv2-cv1
gamma2=cvrfl/cvfwd
print gamma2

print z0,cv1,cv2,cvr,cz
print n11,n12,p1
print n21,n22,p2
print guess1, guess2
print fitpars1, fitpars2
print np.sqrt(np.diag(covmat1)), np.sqrt(np.diag(covmat2))
print "V2(blue)/V1(green) =",vratio
print "V2(blue) phase advance against V1(green)=",phase2advance*360.0/(2.0*np.pi), "deg. (V2 is in advance if positive)"

Initial guess

You always need a good initial guess when you try a curve fitting.

import numpy as np
import pylab as pl
import csv
from scipy.optimize import curve_fit
def sinfunc(x,a,b,c):
    return a*np.sin((x-c)*(2.0*np.pi/b))
def findamp(x):
    return (max(x)-min(x))/2.0
def find0cross(x):
    n=0
    while x[n] >= 0: # skip while positive
        n+=1
    while x[n] < 0:  # skip while negative
        n+=1
    n1=n             # 1st neg to pos transition
    n+=10            # skip a little bit
    while x[n] >= 0: # skip while positive
        n+=1
    while x[n] < 0:  # skip while negative
        n+=1         # 2nd neg to pos transition
    n2=n
    return [n1, n2]

t, v1, v2 = np.loadtxt('OwonData1.csv', unpack=True, delimiter=',')

#v1=3500*sin(t*(2.0*np.pi/400)+1.2)
#v2=4000*cos(t*(2.0*np.pi/400))

plt.plot(t,v1,'g--',lw=5)
plt.plot(t,v2,'b--',lw=5)

a1=findamp(v1)
a2=findamp(v2)
n11, n12 = find0cross(v1)
n21, n22 = find0cross(v2)
p1=n12-n11
p2=n22-n21
pave=(p1+p2)/2
print n11,n12,p1
print n21,n22,p2
guess1=[a1,pave,n11]
guess2=[a2,pave,n21]

fitpars1, covmat1 = curve_fit(sinfunc,t,v1,guess1)
fitpars2, covmat2 = curve_fit(sinfunc,t,v2,guess2)
print guess1, fitpars1
print guess2, fitpars2
pl.plot(t,sinfunc(t, *fitpars1),'r')
pl.plot(t,sinfunc(t, *fitpars2),'r')

phase2deg=360.0*((fitpars2[2]-fitpars1[2])/((fitpars1[1]+fitpars2[1])/2))
print phase2deg, "(negative value is in advance)"

The first and the second zero-crossings, from negative to positive, are used for estimating the period and the offset of a sine wave.

guess

Lab. Automation

CableLength11

When I was using an impedance bridge, I was always measuring the phase difference manually by moving two cursors. Here comes some automation with Python.

phase1

This is a test using sine and cosine functions with the same frequency but with different amplitude. The phase difference is measured to be 89.99deg by a curve fitting.

phase2

This is a real data example. The phase difference is now 42.30deg.