¿ªÔÆÌåÓý

Re: SWR


 

Here's proof of concept for the iterative approach to reading RF volts
from an AD8307, coded in python.? ? A fun puzzle.

Jerry, KE7ER

##############################################################
# Assume the AD8307 output increases by 0.025 volts per dB
# Assume the input network to the AD8307 is scaled such that 100 volts rms?
# of RF to the antenna results in 2.5 volts out of the AD8307.
# Those assumptions of? 0.025v, 100vrms, and 2.5v could be calibration
# constants stored in EEPROM for each individual AD8307.
?
# Computations from this of absolute Watts will be most accurate
# within the region that the AD8307 was calibrated.
# Computations of SWR should be fairly accurate for all power levels
# till noise into the AD8307 takes over at the bottom end.
?
# The final granularity of 1/4096 was chosen arbitrarily, increasing this?
# value makes it more accurate but increases the iterations required.
# Likewise, the initial granularity of 1/2 was also made arbitrarily.
# I have retained 6 significant digits in the voltsADC adjustment, equivalent?
# to about 18 fractional bits in the proposed 8:24 bit fixed point math.
?
import math as m
?
def findVoltsRF(adcReading):
? # The RF voltage falls by half for each 20*m.log10(2)=6.0206 dB,?
? #? or 0.025*6.0206=0.150515v from the AD8307
? voltsRF=100.0; voltsADC = 2.5
? while (voltsADC > adcReading):
? ? voltsADC = voltsADC - 0.150515
? ? voltsRF = voltsRF/2
? # The RF voltage increases by 1/4096 per 0.000053008 volts from the AD8307
? #? where? ? 0.025*20*m.log10(1+1.0/4096) =? 0.000053008
? while (voltsADC < adcReading):
? ? voltsADC = voltsADC + 0.000053008
? ? voltsRF = voltsRF + voltsRF/4096
? return voltsRF
?
def evalv8307(v):
? dbdown = (2.5-v)/0.025
? vrf = 100/(10**(dbdown/20))
? print v, ":", findVoltsRF(v), vrf
?
evalv8307(2.35) # 6db down
evalv8307(1.77) # something arbitrary
?
# Results:
# python? ad8307RFV.py
#? ?2.35 : 50.1222045103 50.1187233627
#? ?1.77 : 3.46747095117 3.46736850453
#################################################################



On Tue, May 8, 2018 at 11:51 pm, Jerry Gaffke wrote:
But the iterative approach should work, pretty much as described.

Join [email protected] to automatically receive all group messages.