HP-67 Power Waves Program

Here’s another program by Class’67. This one is clearly useful for RF engineering (including many formulae I haven’t seen for a very long time). It is based around arithmetic with complex numbers so it may also be of interest to other engineers that deal with waves or use complex numbers, or to mathematicians generally.

Note: X Y Z refer to stack registers or to reactance, immittance (I think I knew this as transmittance) or to impedance; as the context dictates. “j” is √-1 (an imaginary number on the y-axis when real numbers are on the x-axis of a number line).

Gss HP-67 Power Waves

v0.07, Dec 17, 2015 by Class’67

Constants and Variables

Reg. Value
RA 299792458 (c)
RB phase constant (β)
RC characteristic impedance (Zo)
RD angular frequency (ω)
RE frequency (f)
R01 wavelength (λ)
R02

To save all registers:
– Press [W/DATA] ,
– ‘Crd’ is displayed.
– Touch the card under the display.
– Enter/Edit/Change the file name.
– Press Save.

Register Loader

This program performs the task of loading numbers with more than 10 digits into data registers R01 to R24. These registers can be viewed in the Data screen. Register R00 is reserved for scratch.

Ex. 1)
Store 9876.54321098765 THz in register RE (R24).
Store 2π in R02.
Store 2π*f in register RD.

Stack: T:
  Z: 9876.543 E12
  Y: 21098765
  X: 24
Then: Set Flag 2.
  Press [D]
Continue with: [ π ] , [ENTER] , [ + ] , [STO] , [ 2 ]
  [STO] , [ x ] , [ 0 ]
  [RCL] , [ 0 ] , [STO] , [D]

Polar Complex Functions

All inputs and results are in polar form.

Func. + 1/z * z^n e^z
Key B C D E e

Key [A] swaps stack registers X and Y.

The z^n function requires ‘n’ stored in Index register R25.

The e^z function requires arg(z) in radians and [RAD] mode set.

Polar Complex Stack Formats

[A], [B], [D] Inputs:
T: arg(z1)
Z: mag(z1)
Y: arg(z2)
X: mag(z2)

[C], [E], [e] Inputs:
Y: arg(z)
X: mag(z)

To subtract z2 from z1, press [CHS] , [B].
To divide z1 by z2, press [C] , [D].

Series <-> Parallel and Parallel Reactances

All inputs and results are in rectangular form.

Func. Zs>p Zp>s x1||x2 x2(X,x1)
Key a b c d

Input Format:
Y: Im(Z) or x1 or X
X: Re(Z) or x2 or x1

Clear Summation Registers:
– Set Flag 2
– Press [A] (Uses R00 to preserve stack.)

Reflection Coefficient (ρ) Calculator

1. Z normalized to Zo

Z = load impedance
Zo = characteristic impedance (real)
ρ = (Z – Zo)/(Z + Zo)
Zn = mag(Z)/Zo*exp(j*arg(Z)), where arg(Z) is in radians

Store Zo in register RC (R22).

Stack input: T:
  Z:
  Y: Im(Z)
  X: Re(Z)

Set Flag 2
Set Flag 0 (not cleared on exit)
Press [E] (see output/results below)

2. Generalized reflection coefficient

Z = load impedance
Zs = source impedance
ρ = (Z – Zs*)/(Z + Zs), Zs* is conjugate of Zs
Zn = Re(Z)/Re(Zs) + j * (Im(Z) + Im(Zs))/Re(Zs)

Stack input: T: Im(Z)
  Z: Re(Z)
  Y: Im(Zs)
  X: Re(Zs)

Set Flag 2. (Clear Flag 0 if set.)
Press [E].

Stack output: T: arg( ρ )
  Z: mag( ρ )
  Y: Im(Zn)
  X: Re(Zn)

Results stored in registers R10 – R13.
R10 = arg( ρ )
R11 = mag( ρ )
R12 = Im(Zn)
R13 = Re(Zn)
(Summation registers are cleared.)

3. Immittance calculator

Z = R + jωL
Y = G + jωC

Uses ω in register RD.

    Z Y
Stack input: T:
  Z: ~ ~
  Y: L C
  X: R 1/R

Set Flag 2.
Press [C]

    Z Y
Stack output: T: ~ ~
  Z: ~ ~
  Y: arg(Z) arg(Y)
  X: mag(Z) mag(Y)

Press [C] to convert Z to Y, or Y to Z if needed.
Multiply Y by Zo to normalize Y.
Divide Z by Zo to normalize Z.
Convert to R + jX to plot on Smith chart.

Lambda-beta Calculator

Wavelength ( λ ) and phase constant ( β )

Stack input: T: 2π
  Z: 299792458 (c)
  Y: frequency (f)
  X: relative permittivity (εr)

Set Flag 2.
Press [B]

Stack output: T:
  Z:
  Y: β (stored in RB)
  X: λ (stored in R01)

Greek Alphabet

Α Β Γ Δ Ε Ζ Η Θ Ι Κ Λ Μ
α β γ δ ε ζ η θ ι κ λ μ

Ν Ξ Ο Π Ρ Σ Τ Υ Φ Χ Ψ Ω
ν ξ ο π ρ σ τ υ φ χ ψ ω

Formulas

Conversion of sample standard deviation (s) to population standard deviation (σ):
σ = s*sqrt((n – 1)/n), where n is the sample size (R19).

Variance of the sample standard deviation (Var(s)):
Var(s) = s^2

Series <-> Parallel:
Q = |Xs|/Rs = Rp/|Xp|
Rp = Rs*(1 + Q^2)
Q = sqrt(Rp/Rs – 1)

Parallel Reactances:
X = (x1 * x2)/(x1 + x2) = x1/(1 + x1/x2)
x2 = -x1/(1 + (-x1)/X)

Capacitor impedance in s-parameters:
Zc = 1/(s*C), where
s = σ + jω, where
σ = exponential decay constant, and
ω = 2π*f

Phase relationship between capacitor voltage and current (φ):
φ = atan(E/I)

Dispation factor (DF):
DF = tan δ (Loss tangent)

Equivalent series resistance (ESR):
ESR = Rsd + Rsm (milliohms), where:
Rsd = summation of all losses in dielectric, and
Rsm = summation of all losses in metals

Impedance of an R-L circuit:
Z = R + jωL

Admittance of an R-C circuit:
Y = 1/R + jωC

Angular frequency (ω):
ω = 2π*f (rad/s)
  = 2π*c/λ

Phase velocity (v) on a lossless line:
vp = 1/sqrt(Ls*Cp) (m/s)

Phase velocity (vp) (or propagation velocity):
vp = λ/T
  = λ*f
  = ω/κ (m/s), where
λ = wavelength in meters
T = the time period in seconds
ω = angular frequency
κ = angular wavenumber = 2π/λ

Phase constant (β):
β = 2π/λ (radians/m)

Velocity factor (VF), or velocity of propagation, of media with relative permittivity (εr):
VF = 1/sqrt(εr)

For a lossless transmission line:
VF = 1/(c*sqrt(L*C))

Propagation constant ( γ ):
γ = sqrt((R + jωL)*(G + jωC))
γ = α + jβ, where
α = attenuation constant (nepers/m)
β = phase constant (radians/m)

Propagation delay (tpd):
tpd = sqrt(εr)/c (s)

Electrical length (El) of a cable is its length measured in wavelengths:
El = l*f/(984*vf), where
l = length of the line in feet
f = frequency in MHz
vf = velocity factor

[Editor’s note: or (if I remember the concept) vf shorter than the free space wavelength. If a vf of 0.9 means it travels at 0.9 of the speed of light in the cable, then you cut the cable to 0.9 of the wavelengths you require. 300 MHz = 1 meter waves. Half a wavelength = 50cm. In a 0.9 vf cable, cut the cable to 45cm.]

Attenuation per unit length at f2 (af2) when the attenuation per unit length at f1 (af1) is known:
af2 = af1*sqrt(f2/f1)

Relative permittivity, dielectric constant (εr):
εr(w) = ε(w)/εο, where:
ε(w) = permittivity of material w dielectric, and
εο = permittivity of vacuum constant

Relative permeability (μr):
μr(w) = μ(w)/μο, where
μ(w) = permeability of material w dielectric, and
μο = permeability of vacuum constant.

Complex permeability (μ):
μ = μ’ + jμ” = B/H, where
B = magnetic flux density, and
H = magnetic field

Loss tangent (tan δ):
tan δ = (ω*μ” + σ)/(ω*μ’), where
σ = conductivity in seimens

Skin effect (δ):
δ = sqrt(2*ρ/(ω*μ)), where
ρ = the resistivity of the conductor,
ω = 2π*f, and
μ = μr * μο

One wavelength of cable at frequency (f) in dielectric with relative permittivity (er):
λ = c/(sqrt(εr)*f) (m)

Length of one wavelength of cable with phase velocity (vp):
λ = c/vp (m)

Wavelength (λ) in a vacuum:
λ = c/f (m)

Z normalized to Zo:
Zn = mag(Z)/Zo*exp(j*arg(Z)), where arg(z) is in radians.

Zn in polar form:
Zn = mag(Z)/Zo*exp(j*arg(Z)), where the arg(Z) is in radians.

Reflection coefficient computed from Zn:
p = 1 – 2/(1 + Zn)

Reflection coefficient computed from Zo:
p = (Z – Zo)/(Z + Zo)

Generalized reflection coefficient in impedance form (Γ):
Γ = (Z – Zs*)/(Z + Zs), where
Zs = source impedance, and
Zs* = conjugate of Zs

Z normalized to Zs:
Zn = Re(Z)/Re(Zs) + j * (Im(Z) + Im(Zs))/Re(Zs)

Generalized reflection coefficient in admittance form (Γ):
Γ = (Ys – Y)/(Ys* + Y), where
Ys = source admittance, and
Ys* = conjugate of Ys

Note) The generalized Smith chart no longer allows the substitution of Y = 1/Z in order to change from an impedance to an admittance basis. This substitution is not allowed in the above forms unless Y = 1/Z is real.

The inverse of the impedance reflection coefficient (not generalized) is just the negative of Γ:
Γ = (Z – Zo)/(Z + Zo) = -1 * (Y – Yo)/(Y + Yo)

Calculation of Γ(x) when Γ(0) is known:
Γ(x) = Γ(0)*exp(-j*β*x), where
β = 2π/λ
(does not apply to admittance form of Γ)

Input impedance at a specific distance from the load:
Zn(x) = (Zn(o) + j*tan(β*x))/(1 + j*Zn(o)*tan(β*x)), where
β = 2π/λ, and
x = change in wavelengths

Standing Wave Ratio:
VSWR = (1 + Abs(Γ))/(1 – Abs(Γ))
Abs(Γ) = (VSWR – 1)/(VSWR + 1)

Input return loss (S11):
S11 = -20*log10(Abs(Γ)) dB, where
Γ is a Zo normalized reflection coefficient, and
Z is the input impedance of the doubly-terminated network.

Mismatch Loss:
loss = -10*log10(1 – Abs(Γ)^2) dB

Efficiency (η). This is the ratio of P2/Pin in dB.
η = 10*log10(P2/Pin) dB, where:
P2 = rms power entering a doubly-terminated network, and
Pin = rms power entering the load attached to a doubly-terminated network.

[Editor: sounds like “power out/power in” so power entering the load should be P2 and power entering the network should be Pin]

Maximum power transfer from Zs to Z occurs when Zs = Z except that X = -Xs. This is called a conjugate match. Therefore, if Γ = 0 there is a conjugate match. This is the center of the Smith chart.

Maximum available source power (Pas):
Pas = Abs(Es)^2/(4*Rs), where
Es = rms source voltage
Rs = real part of source impedance, Re(Zs)

Transducer power gain (T):
T is equivalent to PL/Pas = 1 – Abs(Γ)^2, where
PL = load power

Characteristic impedance (Zo) of a lossless line:
Zo = sqrt(Ls/Cp), where
Ls = series inductance per unit length
Cp = parallel capacitance per unit length

Resonant angular frequency in an LC circuit:
ω = sqrt(1/(L*C))

R-C time constant (τ):
τ = R*C
The time in seconds for the voltage across a capacitor to drop to (1/e x 100) % of its fully charged state through resistance R.

The R-C time constant also applies when charging a capacitor from a regulated source voltage E in series with resistor R. The voltage across the capacitor will be (1 – 1/e)x100 % of the source voltage at time τ = R*C.

Unloaded Q (Qo):
Qo = ω*C/Go, where
ω = 2π*f,
C = capacitance in Farads, and
Go = conductance of resonator

Coupling coefficient (κ):
κ = Gex/Go = Qo/Qex, where
Gex = external conductance felt by resonator

Loaded Q (QL):
QL = Qo/(1 + κ)

Ratio in nepers (Np) of x1 and x2:
ratio = log(x1) – log(x2) (Np)

Ratio in decibels (dB) of x1 and x2:
ratio = 10*log10(x1/x2) (dB)

Nepers to decibel conversion:
1 neper = 20/(log(10)) ~= 8.68588 … dB

Decibel to nepers conversion:
1 decibel = 1/(20*log10(e)) ~= 0.115129 … Np

Angular wavenumber (κ):
κ = 2π/λ

Physical Constants

Planck constant (h):
h = 6.626070040(81)E-34 J*s, where (81) = the standard error

Two Pi:
2*π = 6.28318 53071 79586 47692 52867 66559 00576 83943 38798 75021 …

Reduced Planck constant (h_bar):
h_bar = h/2π

Speed of light in a vacuum (c):
c = 299792458 m/s

Electric constant, Permittivity of vacuum (εo):
εo = 1/(c^2*μο) F/m
  = 8.8541878176203898 … E-12 F/m

Permeability of vacuum (μο):
μο = 4*π E-7 H/m or N/A^2
  = 1.2566370614359173 … E-6 H/m

Boltzmann constant (κ):
κ = 1.38064852(79)E-23 J/K

Stefan–Boltzmann constant (σ):
σ = 5.670367(13)E-8 W/(m^2 K^4)

References

Cuthbert, Thomas R, 1999, Broadband Direct-Coupled and Matching RF Networks, published by author, 9.4 MB PDF
ethw.org/Archives:Broadband_Direct-Coupled_and_Matching_RF_Networks

RF Engineering Basic Concepts, 2007, 1.5 MB PDF
cas.web.cern.ch/cas/UK-2007/Afternoon%20Courses/RF/cas_rf_engineering_basic_concepts.pdf

RF Engineering Basic Concepts: The Smith Chart, 2010, 2.5 MB PDF
cas.web.cern.ch/cas/Denmark-2010/Lectures/Caspers-Smith-Chart.pdf

Introduction to Transmission Lines, Part I, 2012, 1.8 MB PDF
www.sonoma.edu/users/f/farahman/sonoma/General_Lectures/TransmissionLines/TransLine/TransmissionLinesPart_I.pdf

Introduction to Transmission Lines, Part II, 2012, 3.1 MB PDF
www.sonoma.edu/users/o/ouj/classes/CES590/lectures/TransmissionLinesPart_II.pdf

Reflection Coefficient Calculator
leleivre.com/rf_gammatoz.html

Reflection Coefficient Calculator w/VSWR, RL, etc.
chemandy.com/calculators/return-loss-and-mismatch-calculator.htm

Series to Parallel Impedance Calculator
www.multek.se/engelska/engineering/signal-management-2/series-to-parallel-impedance-conversion-calculator-2

HP-67 Program

Here’s the program:

PROG
224
001: 31 25 13
002: 35 71 02
003: 22 08
004: 35 62
005: 35 52
006: 42
007: 31 25 11
008: 35 71 02
009: 22 04
010: 35 52
011: 35 22
012: 31 25 14
013: 35 71 02
014: 22 05
015: 35 52
016: 35 53
017: 71
018: 35 53
019: 61
020: 35 54
021: 35 22
022: 31 25 12
023: 35 71 02
024: 22 06
025: 31 72
026: 35 54
027: 35 54
028: 31 72
029: 35 52
030: 35 53
031: 61
032: 35 53
033: 61
034: 35 54
035: 32 72
036: 35 22
037: 32 25 15
038: 31 72
039: 32 52
040: 41
041: 35 54
042: 35 54
043: 31 63
044: 35 82
045: 31 62
046: 35 54
047: 71
048: 35 52
049: 35 82
050: 71
051: 32 72
052: 35 22
053: 31 25 15
054: 35 71 02
055: 22 03
056: 35 34
057: 35 63
058: 35 52
059: 35 34
060: 71
061: 35 52
062: 35 22
063: 32 25 12
064: 31 22 01
065: 31 22 00
066: 35 52
067: 81
068: 31 22 01
069: 71
070: 35 52
071: 35 22
072: 71
073: 22 11
074: 32 25 11
075: 31 22 01
076: 35 52
077: 31 22 00
078: 71
079: 31 22 01
080: 81
081: 35 52
082: 35 22
083: 32 25 14
084: 42
085: 32 25 13
086: 31 22 01
087: 81
088: 01
089: 61
090: 31 51
091: 35 22
092: 81
093: 35 22
094: 31 25 01
095: 41
096: 41
097: 35 54
098: 35 22
099: 31 25 00
100: 81
101: 41
102: 41
103: 71
104: 01
105: 61
106: 35 54
107: 35 22
108: 31 25 03
109: 31 42
110: 35 71 00
111: 22 02
112: 33 07
113: 35 53
114: 33 06
115: 35 53
116: 33 05
117: 35 53
118: 33 04
119: 34 06
120: 61
121: 34 07
122: 81
123: 33 02
124: 34 05
125: 34 07
126: 81
127: 33 03
128: 35 51 02
129: 22 07
130: 31 25 02
131: 33 05
132: 3
5 53
133: 33 04
134: 35 54
135: 32 72
136: 34 13
137: 81
138: 31 72
139: 33 03
140: 35 53
141: 33 02
142: 34 13
143: 33 07
144: 00
145: 33 06
146: 31 25 07
147: 34 04
148: 34 05
149: 32 72
150: 34 06
151: 35 71 02
152: 42
153: 34 07
154: 32 72
155: 42
156: 31 22 12
157: 33 09
158: 35 53
159: 33 08
160: 34 04
161: 34 05
162: 32 72
163: 34 06
164: 34 07
165: 32 72
166: 31 22 12
167: 31 22 13
168: 34 08
169: 34 09
170: 31 22 14
171: 33 01
172: 35 52
173: 33 00
174: 35 52
175: 34 02
176: 34 03
177: 31 42
178: 35 51 02
179: 31 22 11
180: 35 22
181: 31 25 04
182: 33 00
183: 31 42
184: 44
185: 33 04
186: 33 05
187: 33 06
188: 33 07
189: 33 08
190: 33 09
191: 61
192: 31 42
193: 34 00
194: 35 22
195: 31 25 06
196: 31 54
197: 71
198: 81
199: 33 01
200: 81
201: 33 12
202: 34 01
203: 35 22
204: 31 25 08
205: 35 52
206: 34 14
207: 71
208: 35 52
209: 32 72
210: 35 22
211: 31 25 05
212: 35 33
213: 35 53
214: 33 00
215: 35 53
216: 33 61 00
217: 34 00
218: 33 24
219: 35 22
220: 84
221: 84
222: 84
223: 84
224: 84
STATE
7
DEG
FIX
9
0
0
0
1
CARD
11
Title: Power Waves
A: x<>y
B: +
C: 1/z
D: *
E: z^n
a: zs>p
b: zp>s
c: x1||x2
d: x2(x,x1)
e: e^z
HELP
19
Gss HP-67 Power Waves
v0.07, 12/17/2015  by Class'67

    Polar Complex Functions
    +       1/z      *       z^n      e^z
    B        C        D        E         e

   Series-Parallel Reactances
 zs>p    zp>s     x1||x2    x2(x,x1)
    a          b           c              d

  [A] - Swap X and Y reg.
SF 2,  [A] - clear summation reg.
SF 2,  [B] - lambda-beta calc.
SF 2,  [C] - Z(L) or Y(C) 
SF 2,  [D] - register loader
SF 2,  [E] - gen. rho,  Zc = Zs*
SF 2,  SF 0,  [E] - rho,  Zo 

END
It's only fair to share...Share on FacebookTweet about this on TwitterShare on Google+Share on LinkedInShare on StumbleUponDigg thisPin on PinterestEmail this to someone

Leave a Reply

Your email address will not be published. Required fields are marked *