start:
CLS
PRINT " This program by W0IVJ calculates the load seen by the output of a"
PRINT " high-pass T-network tuner if you know the values of the series"
PRINT " input capacitance, the shunt inductor, and the series output"
PRINT " capacitor."
PRINT
PRINT " Frequency in Mhz ";
INPUT F$
F = VAL(F$)
IF F = 0 THEN GOTO another
PRINT " Input Resistance in ohms ";
INPUT Ri$
Ri = VAL(Ri$)
IF Ri = 0 THEN
PRINT
PRINT " Losses are too high."
GOTO another
END IF
PRINT " Series Input capacitance in pf ";
INPUT Ci$
Ci = VAL(Ci$)
PRINT " Shunt Inductance in uh ";
INPUT L$
L = VAL(L$)
PRINT " Unloaded Coil Q (250 is not unreasonable for a good coil) ";
INPUT Ql$
Ql = VAL(Ql$)
PRINT " Series Output Capacitance in pf ";
INPUT Co$
Co = VAL(Co$)
PRINT
Ci = Ci * 1E-12
Co = Co * 1E-12
L = L * .000001
F = F * 1000000!
pi = 3.14159
Xci = 1 / (2 * pi * F * Ci)
Xco = 1 / (2 * pi * F * Co)
Xl = 2 * pi * F * L
A = Xci * Xl
B = Xl - Xci
M = A + B * Xco
N = 50 * (Xl - Xco)
Q = SQR(M ^ 2 + N ^ 2)
P = SQR(Ri ^ 2 + B ^ 2)
Theta1 = ATN(N / M)
Theta2 = ATN(B / Ri)
D = Q / P
Theta3 = Theta1 - Theta2
R = D * COS(Theta3)
X = D * SIN(Theta3)
IF R < 0 THEN
R = -R
X = -X
END IF
X = -X
IF X < 0 THEN
sign$ = " - "
ELSE
sign$ = " + "
END IF
X = ABS(X)
Vi = SQR(Ri * 1000)
Ii = Vi / Ri
Vci = Xci * Ii
Vl = SQR(Vi ^ 2 + Vci ^ 2)
Rl = Xl / Ql
Zl = SQR(Xl ^ 2 + Rl ^ 2)
Il = Vl / Zl
Pl = Il ^ 2 * Rl
IF Pl >= 1000 THEN
PRINT
PRINT " Losses are too high."
GOTO another
END IF
PercentLoss = (Pl / 1000) * 100
Loss = (1000 - Pl) / 1000
DbLoss = -10 * (LOG(Loss) / LOG(10))
Qc = Xci / Ri
PRINT " The tuner is matching an impedance of: ";
PRINT USING "####.#"; R;
PRINT sign$;
PRINT "J ";
PRINT USING "####.#"; X
PRINT
PRINT " Circuit Q = ";
PRINT USING "##.#"; Qc
PRINT " Tuner Loss = ";
PRINT USING "##.#"; PercentLoss;
PRINT " % ;";
PRINT USING "##.##"; DbLoss;
PRINT " db"
another:
PRINT
PRINT " Another Calculation ";
INPUT Ans$
IF (Ans$ = "N") OR (Ans$ = "n") THEN
GOTO done:
ELSE
GOTO start:
END IF
done:
END