10 '>>>>>>>>>>>>>>>>>>>>>>> DL6WU-1 - RSS - 4/18/84 <<<<<<<<<<<<<<<<<<<<<<<<<
20 '9/14/85 - RSS - Changed program name from ANTENNA.BAS to DL6WU-1.BAS.
22 'Changed factor for driven element length, per correspondence with DL6WU:
24 'Experimental data indicates that length of folded dipole driven element is
26 'independent of element diameter.  If folded element spacing is relatively
28 'large (.05 to .1 wavelength), the antenna is quite broadband.
30 CLS
35 KEY OFF
40 PRINT STRING$(20,42);" DL6WU ANTENNA DESIGN PROGRAM ";STRING$(20,42)
90 DIM S(100),D(100),DH(100),DL(100),T(100)
110 PRINT : INPUT"YOUR CALL SIGN ?		",S$
120 PRINT : INPUT"TODAY'S DATE ?			",D$
130 PRINT : INPUT"DESIGN FREQUENCY (MHz) ?	",F
132 IF F>0 GOTO 140
134 PRINT : PRINT"---> STOP FOOLING AROUND - ENTER A FREQUENCY!"
136 PRINT : GOTO 130
140 CLS
145 CM=29979.3 : I=11802.9	'Wavelength factors for cm and in.
150 PRINT"DO YOU WANT TO ENTER ALL PHYSICAL DIMENSIONS IN:"
160 PRINT : PRINT"	1 - INCHES ?"
170 PRINT : PRINT"	2 - CENTIMETERS ?"
180 PRINT : PRINT"	3 - WAVELENGTHS ?"
190 PRINT : INPUT"SELECT ONE OF THE ABOVE OPTION NUMBERS	",P$
200 IF P$="1" OR P$="2" OR P$="3" GOTO 230
210 PRINT : GOSUB 1862
220 GOTO 140
230 CLS
240 PRINT"DO YOU WANT TO SPECIFY:"
250 PRINT : PRINT"     1 - ANTENNA GAIN (IN dBd) AND ACCEPT CALCULATED BOOM LENGTH ?" 
260 PRINT : PRINT"     2 - BOOM LENGTH AND ACCEPT CALCULATED GAIN ?"
270 PRINT : INPUT"SELECT ONE OF THE ABOVE OPTION NUMBERS	",B$
280 IF B$="1" OR B$="2" GOTO 310
290 PRINT : GOSUB 1862
300 GOTO 230
310 CLS
320 PRINT"YOU HAVE THE FOLLOWING CHOICES FOR BOOM MATERIAL AND MOUNTING THE ELEMENTS:"
330 PRINT : PRINT"     1 - ELEMENTS PASS THROUGH AND ARE NOT INSULATED FROM A METAL BOOM"
340 PRINT : PRINT"     2 - ELEMENTS PASS THROUGH AND ARE INSULATED FROM A METAL BOOM"
350 PRINT : PRINT"     3 - A NON-METALLIC BOOM IS USED"
355 PRINT"         --- OR ---"
360 PRINT"         ELEMENTS ARE MOUNTED ON INSULATORS ABOVE OR BELOW THE BOOM"
370 PRINT"         WITH METAL-TO-METAL SPACING GREATER THAN THE BOOM RADIUS"
380 PRINT : INPUT"SELECT ONE OF THE ABOVE OPTION NUMBERS	",E$
390 IF E$="1" OR E$="2" OR E$="3" GOTO 420
400 PRINT : GOSUB 1862
410 GOTO 310
420 IF B$="2" GOTO 570
430 CLS
440 PRINT"ANTENNA GAIN MUST BE BETWEEN 11.8 dBd AND 21.6 dBd"
450 PRINT : INPUT"ANTENNA GAIN (dBd) ?	",G
460 IF G<11.8 OR G>21.6 THEN PRINT : PRINT"---> GAIN IS OUT OF RANGE - TRY AGAIN!" ELSE GOTO 470
465 GOSUB 1865
466 GOTO 430
470 BL=EXP((G-9.2)/3.39)	'Boom wavelengths for specified gain
480 B1=BL*I/F			'Boom length in in.
490 B2=BL*CM/F			'Boom length in cm
500 B3=B1/12			'Boom length in ft
520 PRINT
530 PRINT"THEORETICAL BOOM LENGTH FROM REFLECTOR TO LAST DIRECTOR:"
535 PRINT USING"   ##.## FT = ###.### IN. = ####.# CM";B3,B1,B2
540 PRINT
550 INPUT"DO YOU WANT TO USE THIS BOOM LENGTH (Y/N) ?	",C$
560 IF C$<>"Y" AND C$<>"y" GOTO 230 ELSE 710
570 CLS
580 PRINT"BOOM LENGTH FROM REFLECTOR TO LAST DIRECTOR MUST BE BETWEEN"
581 PRINT"2.2 AND 39 WAVELENGTHS"
585 PRINT
590 IF P$="1" THEN PRINT USING"LENGTH AT ####.# MHz MUST BE BETWEEN ###.### AND ####.### IN.";F,2.2*I/F,39*I/F
600 IF P$="2" THEN PRINT USING"LENGTH AT ####.# MHz MUST BE BETWEEN ####.# AND ####.# CM";F,2.2*CM/F,39*CM/F
610 PRINT : INPUT"BOOM LENGTH ?	",BL
611 IF P$="1" AND BL=>2.2*I/F AND BL=<39*I/F GOTO 620
612 IF P$="2" AND BL=>2.2*CM/F AND BL=<39*CM/F GOTO 620
613 IF P$="3" AND BL=>2.2 AND BL=<39 GOTO 620
614 PRINT
615 GOSUB 1862
616 GOTO 570
620 A=BL
630 GOSUB 1750
650 BL=A		'Boom wavelengths
660 G=9.2+3.39*LOG(BL)	'Gain in terms of boom length
670 PRINT : PRINT USING"THEORETICAL MAX. ANTENNA GAIN = ##.# dBd -- IT MAY BE LESS";G
680 PRINT
690 INPUT"DO YOU WANT TO ACCEPT THIS GAIN (Y/N) ?	",A$
700 IF A$<>"Y" AND A$<>"y" GOTO 570
710 IF E$="3" GOTO 800
715 CLS
720 PRINT"BOOM DIAMETER MUST BE LESS THAN 0.075 WAVELENGTH"
725 PRINT
730 IF P$="1" THEN PRINT USING"0.075 WAVELENGTH AT ####.# MHz = ##.### IN.";F,.075*I/F
740 IF P$="2" THEN PRINT USING"0.075 WAVELENGTH AT ####.# MHz = ##.## CM";F,.075*CM/F
750 PRINT : INPUT"BOOM DIAMETER ?		",BD
752 IF P$="1" AND BD=<.075*I/F GOTO 760
754 IF P$="2" AND BD=<.075*CM/F GOTO 760
755 IF P$="3" AND BD=<.075 GOTO 760
756 PRINT
757 GOSUB 1862
758 GOTO 710
760 A=BD
770 GOSUB 1750
790 BD=A	'Boom diameter in wavelengths
800 CLS
810 PRINT"ELEMENT DIAMETER MUST BE BETWEEN 0.001 AND 0.02 WAVELENGTH"
815 PRINT
820 IF P$="1" THEN PRINT USING"DIAMETER AT ####.# MHz MUST BE BETWEEN #.### AND #.### IN.";F,.001*I/F,.02*I/F
830 IF P$="2" THEN PRINT USING"DIAMETER AT ####.# MHz MUST BE BETWEEN #.## AND #.## CM";F,.001*CM/F,.02*CM/F
840 PRINT : INPUT"PARASITIC ELEMENT DIAMETER ?	",ED
842 IF P$="1" AND ED=>.001*I/F AND ED=<.02*I/F GOTO 850
843 IF P$="2" AND ED=>.001*CM/F AND ED=<.02*CM/F GOTO 850
844 IF P$="3" AND ED=>.001 AND ED=<.02 GOTO 850
845 PRINT : GOSUB 1862
846 PRINT : GOTO 840
850 A=ED
860 GOSUB 1750
880 ED=A 	        'Element diameter in wavelengths
890 SR=.216144		'Reflector spacing
900 LA=BL-SR		'Subtract reflector spacing from boom length
910 FOR N=1 TO 14	'First 14 directors
920 S(N)=.081444+.12178*LOG(N)	'Director spacing from previous element
925 IF N=1 THEN T(N)=SR+S(N) ELSE T(N)=T(N-1)+S(N)  'Total distance from reflector
930 LA=LA-S(N)		'Subtract from boom length
940 IF LA<0 THEN M=N-1 : LA=LA+S(N) : GOTO 1010	'Last director number
950 NEXT N
960 FOR N=15 TO 100     'From director 15 on
970 S(N)=S(14)		'Constant spacing after director 14
975 T(N)=T(N-1)+S(N)	'Total distance from reflector
980 LA=LA-S(N)		'Subtract from boom length
990 IF LA<0 THEN M=N-1 : LA=LA+S(N) : GOTO 1010	'Last director number
1000 NEXT N
1010 LL=BL-LA		'Boom length from reflector to last director
1015 G1=9.2+3.39*LOG(LL)   'Actual gain based on active boom length
1017 IF G1<11.8 THEN BL=1.05*BL ELSE GOTO 1020	'Increment until G1=9.8
1018 GOTO 900
1020 'Calculate factors for element length equation
1030 FOR Q=1 TO 7
1040 READ K,K1,K2,K3,K4	   'K=standard element diameter
1050 IF K=ED THEN J=0 : GOTO 1140
1060 IF K<ED THEN L=K ELSE GOTO 1080
1070 KL1=K1 : KL2=K2 : KL3=K3 : KL4=K4
1080 IF K>ED THEN H=K ELSE GOTO 1110
1090 KH1=K1 : KH2=K2 : KH3=K3 : KH4=K4
1100 GOTO 1130
1110 NEXT Q
1130 J=(ED-L)/(H-L)	'Interpolation factor
1140 R=.476945		'Reflector length
1150 IF E$="1" OR E$="2" THEN X=R ELSE GOTO 1180
1160 GOSUB 1780
1170 R=X
1180 DE=.47192		'Driven element length
1220 'Calculate director lengths
1230 FOR N=1 TO M
1240 IF J=0 THEN D(N)=(K1-K2*LOG(N))*(1-K3*EXP(-K4*N)) ELSE GOSUB 1820   'Dir length
1250 IF E$="1" OR E$="2" THEN X=D(N) ELSE GOTO 1280
1260 GOSUB 1780
1270 D(N)=X
1280 NEXT N
1282 CLS
1285 PRINT"--> YOUR PRINTER MUST BE TURNED ON AT THIS TIME <--"
1287 PRINT : PRINT : INPUT"    PRESS <CR> WHEN PRINTER IS ON ",Z$
1290 LPRINT
1300 CLS
1310 LPRINT STRING$(80,42)
1320 LPRINT TAB(30);"DL6WU ANTENNA DESIGN"
1330 LPRINT
1340 LPRINT TAB(10);"Program written by Jerry Haigwood, KY4Z, and Bob Stein, W6NBI -"
1350 LPRINT TAB(10);"Based on article 'Extremely Long Yagi Antennas' by Gunter Hoch,
1360 LPRINT TAB(10);"DL6WU; VHF Communications, 3/82"
1370 LPRINT : LPRINT TAB(10);"DESIGNED FOR      :  ";S$;TAB(65);D$
1380 LPRINT
1390 LPRINT TAB(10);"CENTER FREQUENCY  = ";F;" MHz"
1395 LPRINT
1400 LPRINT TAB(10);USING"GAIN              = ##.# dBd";G1
1402 LPRINT
1405 LPRINT TAB(10);"DRIVE IMPEDANCE   =  200 OHMS (APPROX), WITH FOLDED DIPOLE D.E."
1410 LPRINT
1430 LPRINT TAB(10);"BOOM LENGTH:"
1433 LPRINT TAB(13);"REFLECTOR TO"
1435 LPRINT TAB(13);USING"LAST DIRECTOR  = ##.## FT  = ###.# IN. = ####.# CM";LL*I/(F*12),LL*I/F,LL*CM/F
1437 LPRINT
1438 IF E$="3" GOTO 1450
1440 LPRINT TAB(10);USING"BOOM DIAMETER     = #.### IN. = #.## CM";BD*I/F,BD*CM/F
1445 LPRINT
1450 LPRINT TAB(10);"ELEMENT DIAMETERS:"
1452 LPRINT TAB(13);"DRIVEN           ANY DIAMETER"
1454 LPRINT TAB(13);USING"PARASITIC      = #.### IN. = #.## CM";ED*I/F,ED*CM/F
1460 LPRINT
1470 IF E$="1" THEN LPRINT TAB(10);"Elements pass through and are NOT insulated from a metal boom"
1480 IF E$="2" THEN LPRINT TAB(10);"Elements pass through and are insulated from a metal boom"
1490 IF E$="3" THEN LPRINT TAB(10);"A non-metallic boom is used ---OR---"
1500 IF E$="3" THEN LPRINT TAB(10);"elements are mounted on insulators above or below a metal boom"
1510 IF E$="3" THEN LPRINT TAB(10);"with metal-to-metal spacing greater than the boom radius"
1520 LPRINT STRING$(80,42)
1530 LPRINT
1535 LPRINT TAB(14);"CUMULATIVE";TAB(67);"ELEMENT"
1540 LPRINT TAB(15);"SPACING";TAB(67);"LENGTH"
1550 LPRINT TAB(12);"-------------";TAB(63);"--------------"
1560 LPRINT TAB(13);"CM";TAB(22);"IN.";TAB(64);"CM";TAB(74);"IN."
1570 LPRINT
1572 LPRINT TAB(13);"Ref";
1573 LPRINT TAB(22);"Ref";
1575 LPRINT TAB(31);USING"REFL ----------|----------   ####.##    ";R*CM/F;
1581 LPRINT TAB(71);USING"###.###";R*I/F
1587 LPRINT TAB(46);"|"
1588 LPRINT TAB(10);USING"###.##";SR*CM/F;
1591 LPRINT TAB(21);USING"##.###";SR*I/F;
1600 LPRINT TAB(31);USING"D.E.  =========|=========    ####.##    ";DE*CM/F;
1605 LPRINT TAB(71);USING "###.###";DE*I/F
1607 FOR N=1 TO M
1608 LPRINT TAB(46);"|"
1609 LPRINT TAB(10);USING"###.##";T(N)*CM/F;
1611 LPRINT TAB(20);USING"###.###";T(N)*I/F;
1615 LPRINT TAB(31);
1616 IF N=<9 THEN LPRINT USING"D"+STR$(N)+"    --------|--------     ####.##    ";D(N)*CM/F;
1617 IF N>9 THEN LPRINT USING"D"+STR$(N)+"   --------|--------     ####.##    ";D(N)*CM/F;
1618 LPRINT TAB(71);USING"###.###";D(N)*I/F 
1640 NEXT N
1680 LPRINT
1690 PRINT STRING$(80,42)
1700 INPUT"DO YOU WANT TO RUN THE PROGRAM AGAIN FOR THE SAME USER (Y/N) ?	",R$
1710 IF R$<>"Y" AND R$<>"y" GOTO 1740 
1715 RESTORE
1725 CLS
1730 GOTO 130
1740 KEY ON : END
1750 IF P$="1" THEN A=A*F/I 		'Convert in. to wavelength 
1760 IF P$="2" THEN A=A*F/CM		'Convert cm to wavelength 
1770 RETURN
1780 'Correction factors for element lengths
1790 IF E$="1" THEN X=X+.6*BD
1800 IF E$="2" THEN X=X+.25*BD
1810 RETURN
1820 'Interpolate for D(N)
1830 DL(N)=(KL1-KL2*LOG(N))*(1-KL3*EXP(-KL4*N))
1840 DH(N)=(KH1-KH2*LOG(N))*(1-KH3*EXP(-KH4*N))
1850 D(N)=DL(N)+J*(DH(N)-DL(N))
1860 RETURN
1862 PRINT"---> INCORRECT ENTRY - TRY AGAIN!"
1865 FOR Q=1 TO 3000    'Delay loop
1867 NEXT Q
1868 RETURN
1870 'First number in each data line is element diameter.  Next 4 numbers are
1880 'K1-K4, used to determine element lengths.
1890 DATA .001,.4711,.018,.08398,.965
1900 DATA .003,.462,.01941,.08543,.9697
1910 DATA .005,.4538,.02117,.0951,1.007
1920 DATA .007,.4491,.02274,.08801,.9004
1930 DATA .01,.4421,.02396,.1027,1.038
1940 DATA .015,.4358,.02558,.1149,1.034
1950 DATA .02,.4268,.02614,.1112,1.036
1960 '>>>>>>>>>>>>>>>>>>>>>>>>>> ANTENNA <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
