Pi-L Network Calculator



    This is a somewhat different version of a Pi-L calculation program which computes "real" rather than theoretical values.

    The program uses a two pass methodology in which the coils are first calculated for the tops of the wider band(s) then the capacitors are calculated at the band edges and finally the true Q of the resulting combinations are derived.

    The initial Q's may be set individually per band which allows for tweaking the values to accomodate one's real world components or a constant Q may be set which will override the table entries.

    This program is written in the "dead" language of Quick Basic running under the defunct DOS operating system. Perhaps, a young computer genius may import the formulae into a spreadsheet format, the current default vogue.

    No error checking is provided against entering silly values but, the program will crash without harm should a divide by zero or similar anomaly be encountered.

    The output values are written into a text file named "pilX.txt" where "X" is the selected plate impedance.



*** The Program Listing ***

    Note the underscores which denote continued lines for this web posting. The Quick Basic editor will remove these and restore the program's original format.

REM -- Pi-L Network Calculator by WC6W, Copyright 2005 
 
3 DIM FQ(20), QQ(20), FL(20), L1(20), L2(20): N = 15: CLS
5 PI = 3.14159

10 QZ = 14: REM Use fixed Q if not 0

REM -- Frequencies in MHz

20 DATA 1.8, 2.0, 3.5, 4,  5.4, 7.15, 10, 14.15, 18.15,21.2, 24.85, 28, 29.7,50,54 

REM -- Pi-Section Q's

30 DATA 7, 7, 7, 7 , 8,  8,    8,   8,    8,    8,    8,    8,    8,   10, 10 

REM -- Coil Frequencies in MHz

40 DATA 2, 2, 4, 4, 5.4, 7.15, 10, 14.15, 21.2, 21.2, 29.7, 29.7, 29.7,54,54 


50 FOR X = 1 TO N: READ FQ(X): NEXT X
55 FOR X = 1 TO N: READ QQ(X): NEXT X
60 FOR X = 1 TO N: READ FL(X): NEXT X

REM -- Network Impedances

70 R1 = 4500: REM Plate Impedance
80 R2 = 250: REM Mid Point Impedance
90 R3(1) = 52: R3(2) = 25: R3(3) = 100: REM Output Impedances


REM -- First Pass: Calculate L's at band tops

100 FOR X = 1 TO N
110 F = FL(X) * 1000000
120 Q0 = QQ(X)

130 IF QZ <> 0 THEN Q0 = QZ: REM Force Fixed Q


REM -- Figure Q's

210 Q1 = (R1 * Q0 - SQR(R1 * R2 * Q0 * Q0 - (R1 - R2) ^ 2)) / (R1 - R2)
220 Q2 = Q0 - Q1
230 QL = SQR(R2 / R3(1) - 1)


REM -- Calculate Pi Coils

330 XL = (R1 * Q0) / (Q1 ^ 2 + 1)
340 L1(X) = XL * 1000000 / (2 * PI * F)

REM -- Calculate L Coils

350 XL2 = QL * R3(1)
360 L2(X) = XL2 * 1000000 / (2 * PI * F)

399 NEXT X


666 OPEN "PIL" + RIGHT$(STR$(R1), LEN(STR$(R1)) - 1) + ".TXT" FOR OUTPUT AS #1

REM -- Second Pass: Calculate Network for 3 output impedances

700 FOR Z = 1 TO 3
710 R3 = R3(Z)

720 PRINT #1,
730 PRINT #1, TAB(15); R1; "ohm to"; R3; "ohm PI-L Network"
740 PRINT #1,
750 PRINT #1, "FREQ"; TAB(10); "Pi-Q"; TAB(20); "C1 pF"; TAB(30); "L1 uH";_
 TAB(40); "C2 pF"; TAB(50); "L2 uH"; TAB(60); "Mid Z"
760 PRINT #1,

REM -- Calculate at all Frequencies

800 FOR X = 1 TO 13
810  F = FQ(X) * 1000000

REM -- Calculate XL's

820 XL = L1(X) * 2 * PI * FQ(X)
830 XL2 = L2(X) * 2 * PI * FQ(X)

REM -- Calculate Actual Mid point Z by figuring L network "backwards"

850 R2 = ((XL2 / R3) ^ 2 + 1) * R3

REM -- Capacitance of L network

860 XCL = R2 / SQR((R2 / R3) - 1)

REM -- Pi section caps

910 XC1 = R1 * XL / (R1 + SQR(R1 * R2 - XL ^ 2))
920 XC2 = R2 * XL / (R2 + SQR(R1 * R2 - XL ^ 2))

REM -- Pi-section Q

930 Q1 = (R1 + SQR(R1 * R2 - XL ^ 2)) / XL
940 Q2 = (R2 + SQR(R1 * R2 - XL ^ 2)) / XL
950 Q0 = Q1 + Q2

REM -- Combine output C of Pi-Net and L network C

960 XT2 = (XC2 * XCL) / (XC2 + XCL)

REM -- Figure C's

970 C1 = 1E+12 / (2 * PI * F * XC1)
980 C2 = 1E+12 / (2 * PI * F * XT2)


990 PRINT #1, FQ(X); TAB(10); INT(Q0 * 10 + .5) / 10; TAB(20); INT(C1); TAB(30);_
 INT(L1(X) * 100) / 100; TAB(40); INT(C2); TAB(50); INT(L2(X) * 100) / 100; TAB(60); INT(R2)
995 NEXT X:
998 PRINT #1,
999 NEXT Z

1000 CLOSE




*** A Typical Output file ***

 
               4500 ohm to 52 ohm PI-L Network

FREQ     Pi-Q      C1 pF     L1 uH     C2 pF     L2 uH     Mid Z

 1.8      15.1      247       37.78     1794      8.07      212 
 2        14        202       37.78     1424      8.07      250 
 3.5      15.5      130       18.89     954       4.03      203 
 4        14        101       18.89     712       4.03      250 
 5.4      14        75        13.99     527       2.99      250 
 7.15     14        56        10.56     398       2.25      250 
 10       14        40        7.55      284       1.61      250 
 14.15    14        28        5.34      201       1.14      250 
 18.15    15.7      25        3.56      188       .76       197 
 21.2     14        19        3.56      134       .76       250 
 24.85    16        19        2.54      141       .54       190 
 28       14.6      15        2.54      109       .54       227 
 29.7     14        13        2.54      95        .54       250 


               4500 ohm to 25 ohm PI-L Network

FREQ     Pi-Q      C1 pF     L1 uH     C2 pF     L2 uH     Mid Z

 1.8      17        261       37.78     1797      8.07      358 
 2        16        216       37.78     1413      8.07      436 
 3.5      17.3      137       18.89     958       4.03      340 
 4        16        108       18.89     706       4.03      436 
 5.4      16        80        13.99     523       2.99      436 
 7.15     16        60        10.56     395       2.25      436 
 10       16        43        7.55      282       1.61      436 
 14.15    16        30        5.34      199       1.14      436 
 18.15    17.5      27        3.56      190       .76       326 
 21.2     16        20        3.56      133       .76       436 
 24.85    17.8      20        2.54      143       .54       313 
 28       16.5      16        2.54      108       .54       391 
 29.7     16        14        2.54      95        .54       436 


               4500 ohm to 100 ohm PI-L Network

FREQ     Pi-Q      C1 pF     L1 uH     C2 pF     L2 uH     Mid Z

 1.8      14.7      243       37.78     1551      8.07      183 
 2        13.4      198       37.78     1250      8.07      202 
 3.5      15.1      128       18.89     821       4.03      178 
 4        13.4      99        18.89     625       4.03      202 
 5.4      13.4      73        13.99     463       2.99      202 
 7.15     13.4      55        10.56     349       2.25      202 
 10       13.4      39        7.55      250       1.61      202 
 14.15    13.4      28        5.34      176       1.14      202 
 18.15    15.4      25        3.56      162       .76       175 
 21.2     13.4      18        3.56      117       .76       202 
 24.85    15.7      18        2.54      121       .54       172 
 28       14.1      14        2.54      95        .54       191 
 29.7     13.4      13        2.54      84        .54       202