1 ' BARNDOOR Barndoor mounting error study & design aid. 2 ' Combined tangent and design errors are displayed graphically. 3 ' Plotted error is equivalent trailing time in seconds. 4 ' Horizontal lines are +/- .1 of largest error line drawn. 5 ' X-axis ticks are 5 minutes apart. 6 ' 7 ' Given any 2 parameters, calculates reasonable value of 3rd. 8 ' Keys: d - double scale; D - half scale; ^d - original scale 9 ' l - shorten base; L - increase base; ^L - original base 1000 ' b - " ; B - " ; ^B - " 1010 ' t - enlarge tip ; T - shrink tip ; ^T -original tip 1020 ' s - speed up rotation; S slow rotation; ^S - restore 1030 ' g - Graph dump ; G - Graph dump 1040 ' r - rerun ; x - exit 1050 ' ? - help 1060 ' ALT+[Initial]: direct specification of parameter 1070 ' 1080 ' Changed Dec 19, 1990, to include effects of radiussing the 1090 ' tip of the thrust bolt. (Reiterative process Dec 20.) 1100 ' 1110 ' Added ability to dump graphics to disk files so I can 1120 ' show off results (Dec 20, 1990). 1130 ' 1140 ' Dec 23, cleaning up, changing to Hi res, keep log of trials. 1150 ' 1160 CLS : KEY OFF: SCREEN 0, 0, 0: WIDTH 80 1170 Y.SCALE = 1 1200 YMAX = 480: YMID = 200: XMAX = 630 ' high res 1210 X.SCALE = 600 / 3600 1220 ' 1230 RADIANS = 57.29583 1240 REMAINDER = 90 / RADIANS - 180 / RADIANS' Remaining 2 angles of triangle. 1250 INTERVAL = 10 ' Data points every ten seconds. 1260 TOL = .01 ' breakout tolerance in reiterative cam calculations 1270 ' 1280 DIM MIFTAKE(361) ' Internal storage of error equivs. 1290 CTRL.D$ = CHR$(4) ' Keychord returns to orig graph. 1300 CTRL.S$ = CHR$(19) ' Keychord to return to orig speed. 1310 CTRL.L$ = CHR$(12) ' Keychords to return to orig length. 1320 CTRL.B$ = CHR$(2) ' return to orig bolt pitch 1330 CTRL.T$ = CHR$(20) ' return to orig tip radius 1340 'CTRL.A$ = CHR$(1) ' return to orig lean angle 1350 ' 1360 SID.DAY = 8616.409 ' = .1 * ((23*60)+56)*60 + 4.09 seconds 1370 SID.DAY = SID.DAY * 10 ' Avoid overflow on compile step. 1380 D.THETA.SEC = 360 / SID.DAY ' = 15.04107 arc seconds per second 1390 D.THETA.SEC = D.THETA.SEC / RADIANS' Radians 1400 ' 1410 LOCATE 1, 1: PRINT "TANGENT ARM DESIGN (answer 5 questions, then we'll draw pictures...)" 1420 PRINT STRING$(79, "=") 1430 PRINT 1440 INPUT "Base, in inches : ", BASS 1450 INPUT "Pitch of thrust bolt : ", P 1460 INPUT "Seconds per revolution : ", R 1470 INPUT "Radius of tip of thrust bolt (inches) <0> : ", TIP 1480 ' 1490 IF P <> 0 AND R <> 0 THEN 1530 ' We have pitch and rate. 1500 IF BASS <> 0 AND R <> 0 THEN 1530 ' We have base and rate. 1510 IF BASS <> 0 AND P <> 0 THEN 1530 ' We have bass and pitch. 1520 RUN ' Hey! Give me at least 2! 1530 ' 1540 INPUT "File name for log of trials : ", LOGFILE$ 1550 IF LOGFILE$ = "" THEN LOGFILE$ = "C:@barn.dat" 1560 OPEN LOGFILE$ FOR OUTPUT AS #2 1561 PRINT #2, "BASE / PITCH / SECONDS PER REV / TIP RADIUS / MIN. THRUST-FACE DIA." 1562 PRINT #2, "ERROR in seconds of RA at 5 minute intervals, 5 - 60 minutes." 1570 IF R THEN RATE = 1 / R ' Invert them if you have them. 1580 IF P THEN PITCH = 1 / P 1590 IF BASS * P * R = 0 THEN GOSUB 2980 ' Find the 3rd parameter. 1600 DEF.BASS = BASS: DEF.RATE = RATE ' Set defaults. 1610 DEF.TIP = B 1620 DEF.LEAN = LEAN 1630 P = 1 / PITCH: R = 1 / RATE 1640 ' 1790 ' 1800 ' *********************************** 1810 ' * Compute errors and store them. * 1820 ' *********************************** 1830 KK = 0 1840 FOR K = 0 TO 3600 STEP INTERVAL ' K in seconds. 1850 IDEAL.THETA = K * D.THETA.SEC ' Earth rate. 1860 IDEAL.PHI = REMAINDER - IDEAL.THETA 1870 THRUST = K * RATE * PITCH ' Drive geometry 1880 ACTUAL.PHI = REMAINDER - ATN(THRUST / BASS) 1890 ' 1900 IF TIP = 0 THEN 1980 ' no need for cam computations. 1910 HOLD.BASS = BASS: HOLD.THRUST = THRUST 1920 EFF.BASS = BASS: EFF.THRUST = THRUST 1930 EFF.BASS = BASS - TIP * SIN(ATN(EFF.THRUST / EFF.BASS)) 1940 EFF.THRUST = THRUST - TIP + TIP * COS(ATN(EFF.THRUST / EFF.BASS)) 1950 IF ABS(HOLD.BASS - EFF.BASS) > TOL OR ABS(HOLD.THRUST - EFF.THRUST) > TOL THEN HOLD.BASS = EFF.BASS: HOLD.THRUST = EFF.THRUST: GOTO 1930 1960 ACTUAL.PHI = REMAINDER - ATN(EFF.THRUST / EFF.BASS) 1970 ' 1980 KK = KK + 1 1990 IF KK / 20 = INT(KK / 20) THEN LOCATE 23, 1: PRINT USING "###%"; KK / 360 * 100 2000 MIFTAKE(KK) = (ACTUAL.PHI - IDEAL.PHI) / D.THETA.SEC 2010 NEXT K 2020 LOCATE 23, 1: PRINT " " 2030 DATA.POINTS = KK 2040 ' 2050 ' ********************************** 2060 ' ** Store results in log file. ** 2070 ' ********************************** 2080 PRINT #2, " " 2090 PRINT #2, USING "###.### /"; BASS; 2100 PRINT #2, USING "###.### /"; P; 2110 PRINT #2, USING "###.### /"; R; 2120 PRINT #2, USING "##.### "; TIP; 2130 IF TIP > 0 THEN PRINT #2, USING "/ #.###"; 2 * ABS(EFF.BASS - BASS) ELSE PRINT #2, " " 2150 FOR KK = 30 TO 360 STEP 30 2160 PRINT #2, USING "###.# "; MIFTAKE(KK); 2170 NEXT KK 2180 PRINT #2, " " 2200 ' 2210 ' *********************************** 2220 ' * Display results graphically. * 2230 ' *********************************** 2240 SCREEN 12, 0, 0: CLS 2250 LOCATE 2, 9: PRINT "(Slow)"; 2260 LOCATE 25, 9: PRINT "(Fast)"; 2270 LOCATE 25, 23: PRINT "Base: "; : PRINT USING "###.###"; BASS; 2280 LOCATE 26, 23: PRINT "Pitch: "; : PRINT USING "###.###"; P; 2290 LOCATE 27, 23: PRINT "Sec/Rev: "; : PRINT USING "###.###"; R; 2300 LOCATE 28, 23: PRINT "Tip Radius: "; : PRINT USING "#.###"; TIP; 2310 LOCATE 29, 23 2320 IF TIP > 0 THEN PRINT "Thrust dia: "; : PRINT USING "#.###"; 2 * ABS(EFF.BASS - BASS); ELSE PRINT " "; 2330 ' 2340 LIMITS = 60 / Y.SCALE 2350 LOCATE 2, 1: PRINT USING "+###.##"; LIMITS 2360 LOCATE 13, 1: PRINT " 0" 2370 LOCATE 25, 1: PRINT USING "+###.##"; -LIMITS 2380 ' 2390 YPLOT = 144: INCR = YPLOT / 10 2400 FOR KK = 0 TO YPLOT STEP INCR ' Error lines 2410 LINE (30, YMID - KK)-(XMAX, YMID - KK), 1 2420 LINE (30, YMID + KK)-(XMAX, YMID + KK), 1 2430 NEXT KK 2440 ' 2450 FOR KK = 0 TO 3600 STEP 300 2460 LINE (30 + X.SCALE * KK, YMID + 2)-(30 + X.SCALE * KK, YMID - 2), 3'5 minute ticks 2470 NEXT KK 2480 ' 2490 FOR KK = 0 TO 3600 STEP 30 2500 LINE (30 + X.SCALE * KK, YMID + YPLOT)-(30 + X.SCALE * KK, YMID + 3), 0'chop lines 2510 LINE (30 + X.SCALE * KK, YMID - YPLOT)-(30 + X.SCALE * KK, YMID - 3), 0'chop lines 2520 NEXT KK 2530 ' 2540 Y.OUT = YMID - MIFTAKE(1) * Y.SCALE 2550 X.OUT = 30 + X.SCALE 2560 LINE (X.OUT, Y.OUT)-(X.OUT, Y.OUT), 0 'first point 2570 FOR KK = 0 TO DATA.POINTS 2580 Y.OUT = YMID - MIFTAKE(KK) * Y.SCALE 2590 IF Y.OUT > YMAX OR Y.OUT < 0 THEN 2620 'avoid overflow at big scale 2600 X.OUT = 30 + X.SCALE * KK * INTERVAL 2610 LINE -(X.OUT, Y.OUT), 3 'subsequently, draw lines 2620 NEXT KK 2630 ' 2640 ' *********************************** 2650 ' * Change parameters interactively * 2660 ' *********************************** 2670 A$ = INKEY$: IF A$ = "" THEN 2670 2680 IF A$ = "d" THEN Y.SCALE = Y.SCALE * 2: CLS : GOTO 2250' double scale 2690 IF A$ = "D" THEN Y.SCALE = Y.SCALE / 2: CLS : GOTO 2250' half scale 2700 IF A$ = CTRL.D$ THEN Y.SCALE = 1: CLS : GOTO 2250 ' original scale 2710 ' 2720 IF A$ = "s" THEN RATE = RATE * 1.001: GOTO 1630' rate - .1% 2730 IF A$ = "S" THEN RATE = RATE / 1.001: GOTO 1630' rate + .1% 2740 IF A$ = CTRL.S$ THEN RATE = DEF.RATE: GOTO 1630' original rate 2750 ' 2760 IF A$ = "l" OR A$ = "b" THEN BASS = BASS - .005: GOTO 1630' shorter 2770 IF A$ = "L" OR A$ = "B" THEN BASS = BASS + .005: GOTO 1630' longer 2780 IF A$ = CTRL.L$ OR A$ = CTRL.B$ THEN BASS = DEF.BASS: GOTO 1630' orig 2790 ' 2800 IF A$ = "t" THEN TIP = TIP - .005: GOTO 1630' smaller tip radius 2810 IF A$ = "T" THEN TIP = TIP + .005: GOTO 1630' larger 2820 IF A$ = CTRL.T$ THEN TIP = DEF.TIP: GOTO 1630' original tip 2830 ' 2840 IF LEN(A$) = 2 THEN A$ = RIGHT$(A$, 1): GOTO 2850 ELSE 2910 2850 LOCATE 29, 50: PRINT "ompute changes."; 2860 IF A$ = CHR$(25) THEN GOSUB 3560: GOTO 2670 ' change pitch 2870 IF A$ = CHR$(31) THEN GOSUB 3650: GOTO 2670 ' change speed 2880 IF A$ = CHR$(38) OR A$ = CHR$(48) THEN GOSUB 3740: GOTO 2670' base 2890 IF A$ = CHR$(20) THEN GOSUB 3830: GOTO 2670 ' tip radius 2900 ' 2910 IF A$ = "C" OR A$ = "c" THEN LOCATE 24, 50: PRINT SPACE$(29); : GOTO 1570 2920 IF A$ = "?" THEN GOSUB 3060: CLS : GOTO 2250 ' help 2930 IF A$ = "G" OR A$ = "g" THEN GOSUB 3980: CLS : GOTO 2250 2940 IF A$ = "r" THEN RUN 2950 IF A$ = "x" THEN END ' CHAIN "catm" 2960 GOTO 2670 2970 ' 2980 ' *********************************************** 2990 ' * Compute unspecified third parameter. * 3000 ' *********************************************** 3010 IF BASS = 0 THEN BASS = PITCH * RATE / TAN(D.THETA.SEC) BASS = FIX(BASS * 10000) / 10000 GOTO 3040 END IF 3020 IF R = 0 THEN RATE = TAN(D.THETA.SEC) / (PITCH / BASS) RATE = FIX(RATE * 10000) / 10000 GOTO 3040 END IF 3030 IF P = 0 THEN PITCH = (BASS * TAN(D.THETA.SEC)) / RATE PITCH = FIX(PITCH * 10000) / 10000 GOTO 3040 END IF 3040 RETURN 3050 ' 3060 ' *********** 3070 ' ** HELP! ** 3080 ' *********** 3090 CLS ' : SCREEN 0, 0, 0: WIDTH 80 3100 LOCATE 2, 30: PRINT "BARNDOOR MOUNTINGS" 3110 LOCATE 4, 1: PRINT STRING$(79, "=") 3120 LOCATE 6, 1: PRINT "Definitions --" 3130 LOCATE 8, 1: PRINT "BASE-- dist. from center of rotation to fixed bearing of thrust bolt (inches)" 3140 PRINT "THRUST BOLT-- the tangent screw, the thing you turn, it lifts the camera" 3150 PRINT "PITCH of THRUST BOLT-- how many times you got to turn it to move it 1 inch" 3160 PRINT 3170 PRINT " The graphs generated by this program show the error accrued from dimensional" 3180 PRINT "errors and from tangent error (combined) as the number of seconds the driven" 3190 PRINT "platform is behind or ahead of the earth's rotation. Divergences 'up' the " 3200 PRINT "screen indicate that the platform is falling behind the earth. The light hor-" 3210 PRINT "izontal lines indicate errors of 1/10 the number of seconds shown along the" 3220 PRINT "left edge of the screen (these are the number of seconds shown by the top and" 3230 PRINT "bottom lines). Horizontal tick marks are 5 minutes of time apart." 3240 PRINT 3250 PRINT " You can supply all 3 parameters which describe a barndoor mounting or supply" 3260 PRINT "any 2. If you supply only 2, the program will compute an initial value for the" 3270 PRINT "third. To change parameters, rerun the program or use the following keys:" 3280 LOCATE 28, 1: PRINT "Press any key to continue..."; 3290 A$ = INKEY$: IF A$ = "" THEN 3290 ELSE CLS 3300 PRINT " KEY WHAT IT DOES..." 3310 PRINT " ------- --------------------" 3320 PRINT " B or L ength of ase is lengthened (slowing down rotation)" 3330 PRINT " b or l ength of ase is shortened (speeding up rotation)" 3340 PRINT " ^b or ^l <^l>ength of <^>base is restored to original value." 3350 PRINT 3360 PRINT " T or t ip radius is increased. ip radius is decreased." 3370 PRINT " ^t <^t>ip radius is restored to original value." 3380 PRINT 3390 PRINT " S peed of rotation is decreased (platform is slowed)" 3400 PRINT " s peed of rotation is increased (platform runs faster)" 3410 PRINT " ^s <^s>peed of rotation is restored to original value." 3420 PRINT 3430 PRINT " d oubles resolution of errors displayed" 3440 PRINT " D halves the resolution of errors displayed" 3450 PRINT " ^D restores the original scale of display" 3460 PRINT 3470 PRINT " G or g dump raphics to disk file for later printing" 3480 PRINT " r estarts the program" 3490 PRINT " x eits the program" 3500 PRINT 3510 PRINT "[ALT]+ase,

itch, ec/Rev, ip radius. Specify value directly." PRINT "If you wish to optimize base, pitch, or seconds per rotation, enter zero." 3520 PRINT 3530 LOCATE 25, 1: PRINT "Press any key to return to program."; 3540 A$ = INKEY$: IF A$ = "" THEN 3540 ELSE CLS : SCREEN 12, 0, 0: RETURN 3550 ' 3560 ' ************* 3570 ' ** Pitch ** 3580 ' ************* 3590 LOCATE 28, 50: INPUT "Pitch: ", P ' prompt for new value 3600 LOCATE 28, 50: PRINT SPACE$(20); ' remove prompt 3610 LOCATE 26, 42: PRINT SPACE$(8); ' clear space for pending value 3620 LOCATE 26, 42: PRINT P; ' and show coming attraction 3630 RETURN 3640 ' 3650 ' ************* 3660 ' ** Rate ** 3670 ' ************* 3680 LOCATE 28, 50: INPUT "Sec/Rev: ", R 3690 LOCATE 28, 50: PRINT SPACE$(20); 3700 LOCATE 28, 42: PRINT SPACE$(8); 3710 LOCATE 27, 42: PRINT R; 3720 RETURN 3730 ' 3740 ' ************* 3750 ' ** BASE ** 3760 ' ************* 3770 LOCATE 28, 50: INPUT "Base: ", BASS 3780 LOCATE 28, 50: PRINT SPACE$(20); 3790 LOCATE 25, 42: PRINT SPACE$(8); 3800 LOCATE 25, 42: PRINT BASS; 3810 RETURN 3820 ' 3830 ' ************* 3840 ' ** Tip ** 3850 ' ************* 3860 LOCATE 28, 50: INPUT "Tip R: ", TIP 3870 LOCATE 28, 50: PRINT SPACE$(20); 3880 LOCATE 28, 42: PRINT SPACE$(8); 3890 LOCATE 28, 42: PRINT TIP; 3900 RETURN 3910 ' 3920 ' ************* 3930 ' ** What key** 3940 ' ************* 3950 A$ = INKEY$: IF A$ = "" THEN 3950 ELSE PRINT ASC(A$): GOTO 3950 3960 A$ = INKEY$: IF A$ = "" THEN 3960 ELSE PRINT ASC(RIGHT$(A$, 1)): GOTO 3960 3970 ' 3980 ' ************************************** 3990 ' ** Screen dump, medium res to disk ** 4000 ' ************************************** 4010 LOCATE 23, 50: INPUT "File: ", GFILEOUT$ 4020 LOCATE 23, 50: PRINT SPACE$(LEN(GFILEOUT$) + 6); 4030 OPEN GFILEOUT$ FOR OUTPUT AS #1 4040 CLOSE #1 4050 KILL GFILEOUT$ 4060 OPEN GFILEOUT$ FOR RANDOM AS #1 LEN = 200 4070 FIELD #1, 200 AS SCRN.RCD$ 4080 SCRN.LIN$ = "" 4090 FOR X.SCRN = 639 TO 0 STEP -8 ' 0 - 193 step 8 4100 FOR Y.SCRN = 0 TO 199 ' 0 - 640 4110 A$ = INKEY$ 4120 IF A$ = "x" THEN X.SCRN = 0: GOTO 4350 4130 BIT.0 = 0: BIT.1 = 0: BIT.2 = 0: BIT.3 = 0: BIT.4 = 0 4140 BIT.5 = 0: BIT.6 = 0: BIT.7 = 0 4150 ' 4160 IF POINT(X.SCRN - 7, Y.SCRN) THEN BIT.0 = 1 4170 IF POINT(X.SCRN - 6, Y.SCRN) THEN BIT.1 = 1 4180 IF POINT(X.SCRN - 5, Y.SCRN) THEN BIT.2 = 1 4190 IF POINT(X.SCRN - 4, Y.SCRN) THEN BIT.3 = 1 4200 IF POINT(X.SCRN - 3, Y.SCRN) THEN BIT.4 = 1 4210 IF POINT(X.SCRN - 2, Y.SCRN) THEN BIT.5 = 1 4220 IF POINT(X.SCRN - 1, Y.SCRN) THEN BIT.6 = 1 4230 IF POINT(X.SCRN - 0, Y.SCRN) THEN BIT.7 = 1 4240 ' 4250 SCRN.CHAR = 128 * BIT.7 + 64 * BIT.6 + 32 * BIT.5 + 16 * BIT.4 + 8 * BIT.3 + 4 * BIT.2 + 2 * BIT.1 + BIT.0 4260 IF SCRN.CHAR = 13 THEN SCRN.CHAR = 11 'Tandy pukes on 13 4270 SCRN.LIN$ = SCRN.LIN$ + CHR$(SCRN.CHAR) 4280 ' 4290 NEXT Y.SCRN 4300 SCRN.CNT = SCRN.CNT + 1 4310 LINE (X.SCRN, 1)-(X.SCRN, 5), 1 4320 LSET SCRN.RCD$ = SCRN.LIN$ 4330 PUT #1, SCRN.CNT 4340 SCRN.LIN$ = "" 4350 NEXT X.SCRN 4360 CLOSE #1 4370 RETURN