1 COMMON A, AL, B, BASEONLY, C, C$, C1, CAT$, CC, CKT$, D, D$, DD, DIA, DIMN$, DMS, E, EO, EX$, F, F$, FD, FF, FQ, FRQ, G$, GO$, I, I$, L, LATLONG, LD, LL, LN, LS, LW, LX, MAX, MENU, MIN, MX, N, NN, NT, OV, P, PI, PROG$, Q, QQ, QU, R, RA, RC, T, T$, U, U$, UH, UL$, V$, VC, W, WHIP, WIRD, WW, X, X$, X1, XS, Z$, ZP, ZS
5 'OMMON EX$
10 'CHAIN : 2 DEC 85  rev. 20 MAR 2000
20 IF EX$=""THEN EX$="exit"
30 
40 CLS:KEY OFF
50 COLOR 7,0,4
60 DIM A$(255,3),B$(255),C(15,3):PI=3.141592
70 U1$="##,###.###":U2$="######"
80 UL$=STRING$(80,205)
90 RESTORE
100 DATA 0,0,0,25,.25,925,35,.375,2100,40,.5,3700,50,.625,6100,60,.75,8500
110 DATA 80,1,14500,100,1.25,24000,120,1.5,34000,140,1.75,46000
120 DATA 160,2,58000,180,2.25,80000,200,2.5,95000,240,3,130000,500,3,1E7
130 RESTORE
140 FOR Z=1 TO 15:FOR Y=1 TO 3
150 READ C(Z,Y):NEXT Y:NEXT Z
160 ON ERROR GOTO 190
170 GOTO 340
180 '
190 CLS:PRINT "Error";ERR;;"in line";ERL:END
200 '
210 IF X/Y<6 THEN RETURN ELSE BEEP
220 COLOR 7,0
230 PRINT:PRINT ;"Ratio greater than 6:1 not recommended !";:PRINT
240 PRINT "Try an intermediate jack shaft with the following R.P.M.'s :"
250 Z=SQR(X/Y)
260 PRINT:PRINT USING "#####,###.###";Y,Y*Z,X;:PRINT SPACE$(6);
270 PRINT "Double";USING "##.###";Z;:PRINT ;":1 reduction";
280 PRINT:PRINT ;"Press any key to start over........";
290 IF INKEY$=""THEN 290 ELSE 10
300 '
310 LOCATE C1,1:Z$=STRING$(80,32):FOR U=C2 TO C3:LOCATE U,1
320 PRINT Z$;:NEXT U:RETURN
330 '
340 '.....start
350 COLOR 11,1:PRINT " TRANSMISSION CHAIN";TAB(57);"by George Murphy VE3ERP ";
360 COLOR 4,0:PRINT STRING$(80,"ß");
370 COLOR 7,0
380 PRINT TAB(24);"  Press number in ( ) to select program";
390 PRINT UL$;
400 PRINT TAB(19);"  (1)  Sprockets known    - chain data required";
410 PRINT TAB(19);"  (2)  Shaft speeds known - sprocket & chain data required";
420 PRINT TAB(19);"  (3)  Exit";
430 Z$=INKEY$
440 IF Z$="1"THEN CLS:GOTO 480
450 IF Z$="2"THEN CLS:GOTO 550
460 IF Z$="3"THEN CLS:CHAIN"mechmenu"
470 GOTO 430
480 COLOR 0,15
490 INPUT " No. of teeth in sprocket A ..........";X
500 INPUT " No. of teeth in sprocket B ..........";Y
510 COLOR 7,0
520 IF Y>X THEN SWAP X,Y
530 A=X:B=Y:R=A/B:IF R<1THEN R=1/R
540 GOTO 1520
550 COLOR 0,15
560 INPUT " RPM Sprocket A ..................";X
570 INPUT " RPM Sprocket B ..................";Y
580 RP=1:IF Y>X THEN SWAP X,Y
590 GOSUB 210:K=X:J=Y
600 INPUT " Minimum teeth, small sprocket ...";W:W1=W
610 COLOR 7,0
620 IF W>=17 THEN 680
630 PRINT "Less than 17 teeth not advised. Press any key to continue.";
640 Z$=INKEY$:IF Z$<>""THEN 680
650 GOTO 640
660 '
670 '.....screen display
680 C1=1:C2=1:C3=4:GOSUB 310:LOCATE 1,1
690 PRINT TAB(21);"Desired RPM's are";X;;"&";Y
700 LOCATE 5,1:PRINT "CALCULATING...........";
710 Z=CINT(W*K/J):YY=Y
720 IF W*X=Y*Z THEN A$(W,3)=" *"ELSE A$(W,3)="  "
730 A$(W,1)=STR$(W):A$(W,2)=STR$(Z)
740 IF Z<120 THEN W=W+1:GOTO 710
750 C1=5:C2=5:C3=5:GOSUB 310:LOCATE 5,1
760 PRINT "Possible tooth combinations: ( * denotes exact ratio )";
770 PRINT:PRINT ;"MORE CALCULATING......";
780 FOR Z=1 TO W
790 B$(Z)=A$(Z,1)+" &"+A$(Z,2)+A$(Z,3)
800 FOR U=1 TO 4-LEN(A$(Z,1)):B$(Z)=" "+B$(Z):NEXT U:NEXT Z
810 LOCATE 7,1
820 Y=INT((W-W1)/6)+1:FOR Z=W1 TO W
830 IF Z=Y+W1 THEN 870
840 PRINT B$(Z);TAB(13);B$(Z+Y);TAB(26);B$(Z+2*Y);TAB(39);B$(Z+3*Y);
850 PRINT TAB(52);B$(Z+4*Y);TAB(65);B$(Z+5*Y)
860 NEXT Z
870 C1=2:C2=2:C3=3:GOSUB 310
880 COLOR 0,15
890 LOCATE 2,1:INPUT " Choose a small sprocket ... how many teeth";B
900 COLOR 7,0
910 IF B>=17 THEN 950
920 PRINT "Less than 17 teeth not advised. Press any key to continue.";
930 Z$=INKEY$:IF Z$<>""THEN 950
940 GOTO 930
950 A=INT((10*K*B/J+5)/10):R=A/B:E=J*R:D=K/R
960 C1=2:C2=2:C3=2:GOSUB 310
970 IF E<>K THEN Y$=" either":Z$="or"ELSE Y$="":Z$="*"
980 LOCATE 2,1:PRINT "With";B;;"T.&";A;;"T.sprockets, RPM's are";Y$;
990 PRINT E;;"&";J;Z$;:IF E<>K THEN PRINT K;;"&";D ELSE PRINT ;" "
1000 COLOR 0,15
1010 PRINT " Press SPACE BAR if OK, or press [0] to choose another combination "
1020 COLOR 7,0
1030 Z$=INKEY$
1040 IF Z$=" "THEN CLS:GOTO 1070
1050 IF Z$="0"THEN 870
1060 GOTO 1030
1070 IF E=K THEN 1190
1080 CLS
1090 PRINT "RPM options are: (a) ";USING U1$;E,J
1100 PRINT "                 (b) ";USING U1$;K,D
1110 PRINT
1120 COLOR 0,15
1130 PRINT " Press letter in ( ) to select RPM option........."
1140 COLOR 7,0
1150 Z$=INKEY$
1160 IF Z$="a"THEN X=E:Y=J:GOTO 1190
1170 IF Z$="b"THEN X=K:YY=D:GOTO 1190
1180 GOTO 1150
1190 CLS:C1=2:C2=2:C3=3:GOSUB 310:LOCATE 2,19
1200 IF RP=0 THEN 1680
1210 PRINT"( Press [ ENTER ] if not applicable )";
1220 COLOR 0,15
1230 INPUT" ENTER: Drive horsepower.....";H
1240 COLOR 7,0
1250 IF H=0 THEN R=A/B:IF R<1 THEN R=1/R
1260 IF H=0 THEN 1520
1270 NO=25:CH=0
1280 Y=0:FOR Z=1 TO 14:IF C(Z,1)=NO THEN P=C(Z,2):TS=C(Z,3):Y=Z
1290 NEXT Z
1300 SP=A*P*((D+J)/2)/60
1310 Q=6600*H/SP
1320 IF CH>0 THEN 1340
1330 IF Q*1.100000>C(Y,3) THEN P=C(Y+1,2):Y=Y+1:GOTO 1300
1340 SN=C(Y,1)
1350 IF CH=2 THEN 1680
1360 NS=INT(Q/TS)+1:IF NS*TS<1.100000*Q THEN NS=NS+1
1370 IF CH=0 AND SN<>500 THEN NS=1:NO=SN
1380 IF NS=1 THEN S$="strand" ELSE S$="strands"
1390 C1=2:C2=2:C3=3:GOSUB 310:LOCATE 2,1
1400 PRINT "This drive requires";NS;S$;;" of #";NO;;"chain";
1410 IF SN=500 THEN PRINT " ";:GOTO 1430
1420 IF NS>1 THEN PRINT " or 1 strand of #";SN;;"chain";ELSE PRINT ;" "
1430 COLOR 0,15
1440 PRINT " Press SPACE BAR if #";NO;
1450 PRINT "is OK, or press [0] to choose another chain "
1460 COLOR 7,0
1470 Z$=INKEY$
1480 IF Z$=" "THEN CH=2:GOTO 1280
1490 IF Z$="0"THEN CH=1:GOTO 1510
1500 GOTO 1470
1510 C1=2:C2=2:C3=3:GOSUB 310
1520 COLOR 0,15
1530 LOCATE 3,1:INPUT " ENTER: Chain No., or pitch in decimal inches ...";NO
1540 COLOR 7,0
1550 IF (NO>=2.500000E-01 AND NO <=3) OR (NO>=25 AND NO<=240) THEN 1600
1560 PRINT "NO SUCH CHAIN ! ....Press SPACE BAR to continue";
1570 Z$=INKEY$:IF Z$=" "THEN 1590
1580 GOTO 1570
1590 C1=3:C2=3:C3=4:GOSUB 310:GOTO 1520
1600 IF NO>=40 THEN NO=INT(NO/10)*10
1610 IF NO<40 AND NO>3 THEN NO=INT(NO/10)*10+5
1620 FOR Z=2 TO 14:FOR Y=1 TO 2
1630 IF NO>(C(Z-1,Y)+C(Z,Y))/2 AND NO<(C(Z,Y)+C(Z+1,Y))/2 THEN 1660
1640 NEXT Y:NEXT Z:GOTO 1560
1650 '
1660 NO=C(Z,1):P=C(Z,2):TS=C(Z,3)
1670 IF CH=1 THEN 1300
1680 I=P/SIN(PI/B):S=P/SIN(PI/A)
1690 CLS:LOCATE 5,1:NL=0
1700 PRINT "Chain Number ..............";USING U2$;NO
1710 PRINT "Chain pitch   (inches).....";USING U1$;P
1720 PRINT "SMALL SPROCKET-No.teeth....";USING U2$;B
1730 PRINT "              -Pitch dia...";USING U1$;I
1740 IF RP=1 THEN NL=NL+1 ELSE GOTO 1760
1750 PRINT "              -R.P.M. .....";USING U1$;X
1760 PRINT "LARGE SPROCKET-No.teeth ...";USING U2$;A
1770 PRINT "              -Pitch dia...";USING U1$;S
1780 IF RP=1 THEN NL=NL+1 ELSE GOTO 1800
1790 PRINT "              -R.P.M.......";USING U1$;YY
1800 PRINT "Ratio .....................";USING U1$;R;:PRINT ;":1"
1810 V1=(I+S)/2+P
1820 PRINT "Minimum c.c.  (inches).....";USING U1$;V1
1830 LOCATE 1,1
1840 PRINT "( Press [ ENTER ] if not applicable )";
1850 COLOR 0,15
1860 INPUT "ENTER desired approx. c.c. ........";V2
1870 COLOR 7,0
1880 IF V2<>0 THEN 1900
1890 C1=1:C2=1:C3=3:GOSUB 310:C1=NL+12:GOSUB 310:NL=NL-1:GOTO 2060
1900 NL=NL+4:IF V2>=V1 THEN 1940
1910 PRINT "Minimum c.c. is";V1;;"inches. Press SPACE BAR to continue";
1920 Z$=INKEY$:IF Z$=" "THEN C1=1:C2=1:C3=3:GOSUB 310:NL=NL-4:GOTO 1830
1930 GOTO 1920
1940 C1=1:C2=1:C3=3:GOSUB 310:LOCATE 9+NL,1
1950 PRINT "Desired c.c.  (inches).....";USING U1$;V2
1960 N=V2/P:L=INT(2*N+A/2+B/2+(((A-B)/(2*PI))^2)/N)
1970 L=2*INT((5*L+5)/10)
1980 '
1990 T=2*L-A-B:U=8.100000E-01*(A-B)^2:C=P/8*(T+SQR(T^2-U))
2000 IF C<V1 THEN L=L+2:GOTO 1990
2010 '
2020 LOCATE 10+NL,1
2030 PRINT "Actual  c.c.  (inches).....";USING U1$;C
2040 PRINT "Chain length  (inches).....";USING U1$;P*L
2050 PRINT "Chain length  (pitches)....";USING U2$;L
2060 LOCATE 13+NL,1
2070 IF RP=1 THEN PRINT "Chain speed   (in./sec.)...";USING U1$;SP
2080 IF H=0 THEN 2200
2090 LOCATE 3,1
2100 PRINT "Chain Number ..............";USING U2$;NO
2110 PRINT "Tensile strength (lbs.) ...";USING U2$;TS
2120 LOCATE 14+NL,1
2130 PRINT "Drive horsepower ..........";USING U1$;H
2140 Q=6600*H/SP:X=Q*I/2:Y=Q*S/2
2150 PRINT "Chain tension (lbs.).......";USING U2$;Q
2160 PRINT "In.Lb., small sprkt.shaft..";USING U2$;X
2170 PRINT "In.Lb., large sprkt.shaft..";USING U2$;Y
2180 LOCATE 5,1
2190 PRINT "Number of strands .........";USING U2$;NS
2200 C1=1:C2=1:C3=2:GOSUB 310
2210 COLOR 0,15
2220 LOCATE 1,1:PRINT " CHAIN DRIVE SPECIFICATIONS "
2230 COLOR 7,0
2240 GOSUB 2260:CLS:GOTO 340
2250 '
2260 'PRT
2270 KEY OFF:GOSUB 2340:LOCATE 25,5:COLOR 0,2
2280 PRINT " Send this page to:(1)Printer Queue? (2)Printout? ";
2290 PRINT "(3)Next page? (1/2/3)";:COLOR 7,0
2300 Z$=INKEY$:IF Z$<"1"OR Z$>"3"THEN 2300 ELSE GOSUB 2340
2310 IF Z$="3"THEN RETURN
2320 FOR I%=1 TO 24:FOR J%=1 TO 80:LPRINT CHR$(SCREEN(I%,J%));:NEXT J%:NEXT I%
2330 IF Z$="2"THEN LPRINT CHR$(12) ELSE 2270
2340 LOCATE 25,1:PRINT STRING$(80,32);:RETURN
