tions of l·iicro-c omput en::; in small business as
TRANSCRIPT
j~pplica tions of l·iicro-c omput en::; in Small Business as
An Honors Thesis (ID 499)
By
John =~. I'Jorris
ThesiG Director
Ball state University
Muncie, Indiana
October 1981
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . page
The Current System. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Radio Shack PASIC I/O statements . . . . . . . . . . . . . . . . . 5
Program ;/1 · . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
PrograE1 ,;'2 · . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1
Program · . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Program · . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
J'Toe;ram i/5 · . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Program }6 · . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 '7
Program )7 · . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
· . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . j1
Frogram //9 · . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Program ;/10 · . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ITogram ,/11 · . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7/
,Yi
~~rosram j 12 · . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
UpgradinG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
The 1980's will be the decade of the micro-computer.
According to Lawrence Fiedelman, approximately ei,ghty per
cent of the computers sold in the next ten years will be
sold to small businesses. Small business computers are
expected to flood the market similar to the growth of the
electronic calculator. (Infosyctems, Je '79, p. 104+)
BUsinessmen are attracted by the small size, relatively low
cost, small power consumption, speed and reliability of
micro-computers.
One small businessman who was attracted by the features
of wicra-computers, John [.jaryan of fliatt Netal .Froducts
Company Incorporated, recently purchased a Radio Shack
TRS-80 micro-computer.
Hiatt Vetal rroducts is a small tool and die shop
located at 720 ':Jest "!illarci ,c)treet in nuncie, Indiana. Tho
shop generally employs three office workers and ten to fif
teen shop workers. There are presently five tool makers,
two machinists, three lathe hands, two apprentices and one
general laborer. The shop occupies approximately 5,000
square feet but will expand to 10000 square feet iL the
near future. They presently serve ten to fifteen steady
customers, including Broderick, Delco-Fi emy, and V!arner Gear.
Occasional walk-in b:lsin eS[:3 is also handl ed. Biat t netal
Products manufactures tools, dies, jigs, fixtures and does
precision lathe work as weI] as CliC (Computer Kumerical Con
trol) machining.
The shop consists of three mills, one horizontal
----------_ .. --_._--_ ...
2
mill, two tracer lathes, five regular lathes, one radial
drill, two internal/external grinders, one external grind
er, two surface grinders, and assorted files and sawing
machines. The shop also has one CNC Bridgeport mill as well
as a recently purchased eNC I'JIAZA:= lathe. These la[,t two
machines are of particular interest because they are pro
grammable via the TRS-80.
Mr. Maryan originally purchased the Radio Shack
micro-computer specifically to write programs for the eNC
Bridgeport mill. Mr. Maryan can compose and edit his pro
grams on the micro-computer and when he is satisfied with
the program he can then produce a paper tape version of the
program which is fed into the CNC mill.
'rhe first three programs in the followinG sections
are designed to prepare paper tapes for the Bridgeport mill.
The tapes are fed into the mill which then drills, bores,
mills or reams according to the given specifications. The
next two programs (it and 5) are used to calculate certain
points which are needed to program the CNC mill. The sixth
program is used to create and update programs which will
be used by the CNC mill.
The remaining programs are used for office use. The
seventh program records the hours spent in each area of the
shop on a particular shop order. The eighth program figures
the cost of cylindrical or rectangular cold roll steel stock.
The ninth program adds up hours for each employee under
various categories. The tenth program computes the profit
or loss for the company each week. The eleventh program
creates data tapes to record information on the jobs done
for each customer. Finally the twelfth program is used to
update the data tapes created with the eleventh program.
Once all of the data tapes for each customer are initially
created the eleventh program is no longer needed unless
Hiatt Metal Products begins to do business regularly with
another customer. There are presently twelve data tapes
which are updated at least once per month.
Sinc e the TRS-BO j.s a ree ent addition to )hat t
Netal Products t~r. Itaryan is constantly thinking up new
programs to be written.
I:
The Current System
Badio Shack Tf~S-80 j<odel I, Level II micro-computer
Memory Size: 16K RAM
~ord Size: 8 bits
Printer Rate: 110 baud
Printer ('utput: 8-} inch paper or 8 hole ASCII paper tape
Language: BASIC
Total Cost: Approximately $1,000
Microprocessor Chip
I~AI'i: and ROIV1 ~ CRT Monitor
and Keyboard
Cassette Peripheral Pri:nter Recorder Interfaces
INPUT
nEAD
INPUT#-l
pnINT
PRINT USING
LPRINT
nadio Shack ~C IiO statements
Input values through keyboard
Reads values from DATA statementsassigns values to specified variables
Input values stored on cassette and assigns them to the specified variable names
Prints item(s) on the display
Allows programmer to specify a format for printing string and numeric values
Prints item(s) on line printer If paper tape function is on the LPnnrrf statement will also produce a paper tape (ASCII) version of the item(s)
5
PROGRAHS
Programs 5,6, 11 and 12 wore
written by John Norris, the
remainder were written by
John Haryan.
,-----,--_ .•.. _. ----- --------- .-
6
7
til
Purpose: To prepare a paper tape for the CNe Bridgeport
mill which will drill or counter bore any num-
ber of holes in any bolt circle.
Explanation of Codes:
GOO (Modal) Rapid Traverse, point-to-point positioning GOl (Modal) Line~~ Interpolation Feed G02 O'Iodal) Circular Interpolation Arc CV; G03 (Modal) Circular Interpolation Arc CCW G04 (Modal) Dwell G 1 ? 01odal) XY Plane G18 (Modal) ZX Plane G 19 (frodal) YZ Plane G30 (Modal) Cancel Mirror Image G31 01odal) Reverses Programmed Direction of X axis G32 O!;odal) Reverses Programmed Direction of Y axis 040 (Hodal) Cutter Dia'11eter Compensation OFF G41 (Modal) Cutter Compensation Left G42 (Modal) Cutter Compensation Right G70 (Modal) Select Inch Dimension System G71 (Modal) Select Metric Dimension System G72 (Modal) Transformation Off G73 (Modal) Transformation On G7l.J U1odal) Hul tiquadrant Circular Int erpolation Canc el 075 01odal) Hul tiquadrant Circular Jnt erpolation G77 (Non-Modal) Facing Cycle G78 (Non-Modal) Pocket Mill Cycle G79 (Non-Modal) ~ough Bore Milling Cycle G80 (Modal) Fixed Cycle Cancel G81 (Modal) Drill Cycle G82 (Modal) spot Facing Cycle G83 (Modal) Deep Hole Drilling Cycle G8Lt 01odal) ~lapping Cycle G85 (Modal) Boring Cycle G86 (Modal) Boring Cycle G87 (Modal) Chip Breaking Deep Hole Drilling Cycle G89 (Modal) Boring Cycle G90 (Hodal) Absolute Programming Mode G91 O'lodal) Incremental Programming Hode G92 (Hon-l'iIodal) Preset Absolute Ii'egisters G99 (Non-Modal) Deceleration Override for 2.8 ipm
and above
INPUT: NUMBER OF HOL£ 5 RADIUS OF e>oLT C.fRCLE AN6LE OF 1 ST HOLE ANGLE' BE'WEEN HOLES H EIC:,HT OF HUB NUMBER OF OPERATlcNS
INPUT: TOOL ~ C.ODE (81 OR 8"3) DEPTI-I OF )..lol..E
YES
INPUT: DEPTU ot=" 1ST PECK DEPT'"' OF ZND PE(.~
INPUi: FEEt> RATE
YES
INDEX
YES
INPUT: OPERATION NUIVlBER DEP"r14 oF c.. eoRE +. Df;
t· B. RAt). - C.UT. RAI).
PLUN&E FEED RATE
BoRE FEED RATE
NO
I~('REMENT INt>EX
ES
PvtJc.1-/ /PRtNT LINES
INCRE'MENT ,NbEX
PUNCH/PRINT LINES
10
1 CLS 2 CLEAR 1000 5 PR 1M' "'ALL DEC I HIlLS MUST BE ENTERED" . 6 PRINT-7 INPUT"ENTER 1 FeR DRILL 0R 2 FeR C0Ut..:TER B0RE";~ 10 INPUT"ENTER NUlt'J3ER 0F HeLES ";L 20 INPUTtlRADIUS 0F BeLT CIRCLE u;RS ro INPur "ANGLE 0F FIRST H0LE .. ;AS Jt) INPUTt'ANGLE BETWEEN H0LES .. ;A2S so INPUTHHEIGHT 0F HUB .. ;HS 60 It.iPUTt'H0W l"lA}lJY 0PERAT I0NS .. ;C 63 PRl~'T 65 IF .. :=2 THEIIi Get 0 1000 70 FeR 1:: 1 T" C 7S LET GS ... ·Y .. t() IftJPUT"Til0L NUt-lEER ~. INPUT"WBICH G C0DE 1 81 0R so INPUT"'DEPTH 0F H0LE + .05 se IF X (l ) -81 THEN 1 20 100 INPUT"DEPTH 0F FIRST PECK 110 INPUT"DEPTH 0F SEC0ND PECK 120 INPUTt'FEED RATE 127 INPUT" IS THE DATA ceRRECT Y 128 PRINT 129 IF GS .... N .. THEN G0T0 75 130 NEXT I
83
0R
";TS(I) ";X(I) ";ZIS(l)
";Z2S(I) to; Z3S (I)
";FS(l) Nt.; GS
135 INPUT"ARE yeu READY T 0 MAKE A TAPE"; HS 140 LPRINT"%'''' 150 F e.R I = 1 T 0 C 160 LPR INT"N"; TS <I); "GOG90XO .YO .T'·;T S <I)J ".:6" 170 LPR It.:T"R'" ;RS}" 10. JO. tf 180 LPRINT"AftJAS;"ZO~" . 190 LPRINT h NIOO=N140/ ft ;STRS(L-l) 000 LPRINT .. tH 10GOG91 Z·";HS 002 IF X ( n =83 T HE.N 214 ~O LPRIt..:T"N120G91G81AO.Z";ZIS(I);"F";FS(I) 212 G0T0 220 214 LPRItvT"N120G91G83AO. Z"; Zl S (l);" Z"; Z2S (I); "Z" Z3S (I);
"F";FS(I) 220 LPRINT"N130G91GOZ";HS 230 LPRINT"N140G0G91A";A2S 240 LPRlt-.lTttG0G91 Z-";HS 250 IF X(I)=83 THEN 280 ~O LPRINT"G91G81AO.Z";ZIS(I);"F";FS(I)
. 270 G0T0 290 280 LPR I NT" G 91 G 83AO • Z .. ; Z 1 i ( 1) ; .. Z" ; Z2 i (l ) ; " Z" ; Z3 S ( I ) ;
"F";FS(I)' ~O LPRINT"GOG90XO.YO.ZO." 3)0 NEXT 1 3)5 LPR INT··M2" 310 LPR INT" E"-320 END WOO FeR 1=1 T0 C 1005 . LET GS :"Y" 1010 INPUT " 0PERAT leN NUMBER ";TS (l) 1020 UJPUT"DEPTH 0F C. BfORE +.05";ZS(l) 1030 INPUT"C.B. RAD.··CUT. RAD.";JS(I)
1 1
112
Purpose: Prepares paper tape for Bridgeport mill. IJlill
vdll drill, counter bore, ream or bore any
number of holes in any location.
Note: See #1 for explanation of codes
r
10 CLEAR 2000 12 DItr; XSC2S) .. YSC2S) 00 CLS ~ PRINT"lNSTRUCTI0NS FeR DRILLING .. REAMING .. B0REI~G .. AND
CfVNTER S0REING H0LES IN ANY peSITI0N" I() PR INT 50 PR I NT" 1 ALL DEC I MALS MUST BE ENTERED" 60 PR INT"2 ALL QUEST I eNS MUST BE A~SWERED" W PRINT"3 I=YES AND C-N0" 00 PR I NT",", FIRST M0VE AFTER T.C. IS ALWAYS HI THE G90 ~jeDE" so UiPUT"HAVE Y8U READ THE INSTRUCTI 0I11S";B WO IF B~O THEN 30 110 CLS 120 INPUT"H0W MANY 0PERAT leNS It lC 130 INPUT"CLAJIlP 0R HUB CLEARAt.lCEtflHS 1,",0 UIPUT"X L0CAT I eN AT T. C. .. ;XS 150 INPUT"Y L0CATle~ AT T-' C'. h;yS 160 It.;PUT"H0W MANY H0LES .. ;ee 170 INPUT"ENTER G C0DE 90 0R 91";G$ reo IF GS="90" 0R GSc"91" G0T0 190 ELSE 170 190. ItJPUT" IS THE DATA ceRRECT ";S 000 IF B-O THEt.I 110 210 F0R t.1=1 T0 CC 220 PRU~T"H0LE NUU3ER"; J 230 INPUT"X VALUE ";XSCtJ) 21.10 INPUT·tV VALUE 0' lYS C ~) 250 INPUT" IS ThE DATA C0RRECT";B 260 IF B=O THEt..; 220 ~o NEXT t.1 290 F 0R I ciTe C XlO PRI~T"0PERATI0N NU~ER ";1 310 It.:PUT"ENTER G C0DI. 79 0R 81 ThRtJ 89" lAS (1) 320 IF VALCAS(I»<79 0R"VALCASCI»>89 ThE~
310 . 3"30 INPUT"T eeL NUt:BER .. ; T$ <I) 350 IF AS(l)="S2" 0R AS(1)c"S9" THE ... 360 ELSE 370 360 INPUT"DWELL 1'II":E . ";SS 310 UiPUTttDEPTH 0F H0LE ·';ZCI) 380 PRUiT·'DEPTH + .05 =";ZCI)+.05 390 INPUT"T0TAL DEJ:>TH It; ZS ( I) . J()O IF A$( I) c"79" THEN 440 ~O IF ASCI)c"S3" 0R ASCI)·"67" THEN 60T0 420 ELSE 480 ~o INPUThLEPTH eF FIRST PECK .. ; Zl S (1)
430 INPUThDEPTH 0F SEC0ND PEClI: ";Z2S(I) 435 G0T0 480 -440 UlPUT"OIA 0F ThE CUTTER "ICU ~o INPUT"DIA 0F THE C.B0RE "ICB J.6C PRI"Tt'T00L PATH RADIUS 'c";(CB-CU)/2 1(10
480 490 soo 510 520 530 540
INPUT"E~TER T. p. R. "lJS(I) INPUT"VERTICAL FEED"RATE"JFS(I) IF ASCI)c"79" THEN 500 ELSE 530 !!.iPupf}ikJa I Z0t-4TAL FEED RATE" lF2 PRINT"C. B0RE FEED RATE -";«CB-(CE-CU»/CB>*F2 UiPUT"E)/TER C. B. FEED RATE-" JF2S"( I> • INPUT"IS THE DATA C0RRECT"la IF B itO THEN 300
55 N XT I 1000 INPUT" IS THIS THE START 0F Y0UR PR0GRA!'P';B 1010 INPUT"IS THIS T}i£ END fOF THE PR "GRAM" JBB 1020 INPUTw'ARE yeU READY 1'10 MAKE TAPE" JAB 1030 IF AB=O THEN 1020 1040 IF B&O THEN 1060 1050 LPR INT"~" 1060 FfOR I-I 1'10 C 1070 LET K=VAL(T$( 1) >*100 WBO LPRIN1'"N"JK;"GOG90X"JX$J"Y";Y$;"T"JT$(I>J"M6" 1090 IFA$<l)·"82" 0R A$(l)-·'89"· TJi£N 1100 ELSE 1110 1100 LPRIN1"'G04P'';S$ 1110 LPR INT"NH'; K+IJ "X'· J X$ (1) J"Y" JY$ (1) J" z.0." 1120 BS=XS <l ) 1130 IF G$ ="9P' ThEN X$ (1) ="0. Of
1140 IF A$(1)="79" THEN 1150 ELSE 1190 1150 LPR HJ1'"N"; K+2; "G91 61 Z -" J Z$ ( I) J "F" J f $ (I) 1160 LPR Ili1' .... " J K+3; "G79J" J CJS (1)J "P') F2$ (I) 1170 LPRIN1'"N"JK+4;"GOG91Z+";Z$(})-1180 J..PR I NT"Nt' J K+5 ;o'GOG90Z+" ,;Ii$ 1185 G0T0 1250 1190 IF AS(I)."S3'· 0R AS(I)."87" TMEIw 1200 ELSE 1220 1200 LPRINT"N";K+2;"G"JGS';"G";A$(I>J"X"JXi(I)J"Z";ZS(1)J
1210 1220
1230 1240 1245 1250 1260 1270
... Z"': Z 1 $ ( I)J" Z"; Z2$ (1) :P'F"; f $ (I) • G0T0 1230 LPRIN1'''N"lK+2;"G"JGSJ"G"iAS(I)J"X''JX$(I)J"Z'';Z$(1)':"F"; F$Cl ) xs <1 )=BS LPR lNT"N" 1 K+3 P·GOG90 Z+" iliS IF CC-) 1'HE~ 1440 F lii)R "c2 T Iii) C C
IF A$ (1) c" 79" THEN 1270 ELSE 1340 LPRIN1'''N'';k+J+4;''GOG''JGSJ"X''J.XS(J)':''Y"lY$(J) "ZO." ~ .
1280 LPRl~1'··N"': K+J +5;"GOG90Z0." 1290 LPR lto/T"N"': K+J+6 ;"G91 Gl Z-" J Z$ (1) J "f" J F $ (1) ~OO LPRINT"N";K+J+7;"G79J"'CJS(I»)"F")F2S(I) ~10 LPRINT"N"iK+J+8;"GOG91Z+")ZS(1)· 1320 LPRINT"N"'K+J+9J"GOG90Z+";H$ 1330 G0T0 1420 ~40 LPRINT"N";K+J+2i"GOG"JGS;"X"iXS(J);"Y"JYS(J);
"ZO." 1350 LPRlIllT"N"; J+K+3' "GOG90Z0." ~55 LETCS=XSlJ) 1360 IF G$c"91" THEN XS(J)="O." 1370 IF A$ (1 )·"83" 0R AS (I) ="87" THEN G0T0 13eo ELSE
1400 -1380 LPRINT"Nf1 JR+J+4; "G"; GS; "G" 'AS (I)' ,':x", XS (J),.I Z" J
Z S ( I ) ; t. z" , Z 1 S ( I ) ; .. Z" , Z2 S ( I ); "F .. J F S ( I ) 1390 G0T0 1410 1400 LPR INT·'N"'; K+J+4J "G"; GS J" G" lAS (I)' "XI' J XS (J) ;0' ZIt
JZS(I»"Ft·;FS(I)- - . ~10 LPRINT"N"JR+J+5,"GOG90Z+";HS 1415 LET XS(J)=CS 1420 LET K=K+2 1430 NEXTJ 1440 NEXTI 1450 IF BB=O THEN 30 1460 LPRINT·'N", K+CC+4P'GOG90X"; )(SP'Y" J YS; "M2" 1470 LPRINT"E" 14BO END
12
#3
Purpose: Prepares paper tape which will drill any number
of holes in any number of rows
Note: See #1 for explan~tion of codes
10 CLEAR 2000 12 DIM C(50)~CCe50)~XS(50)~YS(50)~Xl$(50)~X2S(50) 20 CLS , ~ PRIt.lT"U<JSTRUCTunIlS FeR MULTIH0LE RflW DRILLING., REAMING~ taR.,
BeRING J,() PRUiT =0 PRINT"1 ALL DECllt'.ALS MUST BE ENTERED'· 60 PRINi"2 ALL QUESiI0NS MUST BE ANSWERED" ~ PRINT"3 l=YES AND Oc~0" ro PRINT'-4 FIRST H0LE peS'liI0N ALWAYS IN ABL0LUTE M0DEtf 82 PRINr"S IF x peSITI0N 0F LAST H0LE KN0WN USE G90" 84 PR INT"6 IF DISTANCE BETWEEN FIRST AND LAST H0LE KNflWN USE G9P' 8) PRINi ~ UlPUT"JiAVE Y0U READ THE INSTRUCT I 0NS";B 100 IF B:':O THEN 30 110 CLS 120 INPUT"H0W MANY 0PERAT I0NS tI;C 130 INPUT"CL.AMP 0R HUB CLEARANCE'·; HS 140 IKPUT~tX L0CATI0N AT T. C. ";X$ 150 IlIiPUTf.y L0CATI0t-l AT T-' C-' ";Y$ 160 INPUTttHew MANY RfOWS t, iCC 170 INPUTnENTER G C0DE 90 0R 91"}G$ feo IF GS="90" taR GS="'91" G0T0 190 ELSE 170 190 INPUT"-lS THE DATA C2tiRECT ";B 000 IF BsO THEt-l 110 210 F0R J-l T 0 CC 220 PRINT"R 0W NUJVJ3ER··; J 230 INPlJT"X VALUE ";XseJ) 235 UlPUTt.y VALUE tI,;ys (J)
238 IF G$~"90" THEN 240 ELSE-243 240 INPUT"X L0CATI0N 0F LAST H0LE 1.., THE R0W·';XISeJ) 242 G0T0 244 243 INPUT"T0TAL DISTANCE BETWEEN FIRST AND LAST H0L.ES •• ;XI
S(J) 244 INPUT"DISTANCE BETWEEN EACli li0LE ··;X2S(J) 250 INPUT" 15 THE DATA C0RRECT"';B a60 IF. B=O THEN 220 270 NEXT J 290 F0R 1=1 T0 C 300 PR tNT" 0PERAT I0N NU JrBER "'; I 310 INPUT"ENTER G C0DE 79 taR 81 THRU 89"';AS(1) ~O IF VAL(AS(I»<79 0R'VAL(AS(I»>89 THE~
310 ' 330 INPlJT"T001. blU~BER ";TS( I) ~O IF'ASCl)c"82" 0R AS(l)··'89" THE~ 360 ELSE 370 360 I"''PUT'''DWELL T lME tf'; S$ 370 INPUT"DEPTH flF H0LE t''; Z (1)
~O PRINT"DEPTH + .• 05 ·";Z(I)+.05 390 INPUT'fT0TAL. DEPTH ";Z$(l) 410 IF A$·(I)."83" 0R A$(1)=·~87·· THEt.) G0T0 420 ELSE 480 420 INPUT ttDEPTH eF FIRST PECK' .. ; Zl $ (1)
430 INPUT"DEPTH 0F SEC0ND PECK "; Z2$ C I ) 435 G0T0 480 ~O UiPUT"VERTICAL FEED RATE";FSCI) 485 U1PUT"IS THE DATA C0RRECT";B 490 IF B=O THEN 300 550 l'OEXT I
13
#4
Purpose: Calculates all tangent points, center of circle
and cutter compensation for two lines tangent
to a circle
5 Cl.S 10 REM *CIRCLE TAN T0 TW0 l.I~ES* 50 INPUT "Al=>';All INPUT "A2="';A2: IKPl:.1T "U=";U: It.lPUT ··V=";V: INPUT ·'R. 60 IF R=O THEN 2000 00 B=R ~ G0SUB 3000 91 0=.01745329 ~ E=C0S{Al*0>*C/2 ~ F=SI~(Al*0>*C/2 94 G=SI~(A2*0)*C/2 S6 a-CeS(A2*0>*C/2 100 INPUT "IS XL.ARGE,(l.> 0R SMALL(S>"; CS 11 0 INPUT t. I S Y. LARGE (L) 0R SMAl.L (5)·'; OS 120 IF CS="L·' ANO OS·"L" THEN 3500 130 IF CS="'S" ANO OS="L·· THEN 4000 140 IF CS c M Sit AND D$="S·' THEN 4500 150 INPUT "IS THE T00L ~0VING X+? (Y OR N)"; E$ ~O IF ES="NM THEN 360 170 IF C>O THEN 7200 190 Xl =U -52 200 YleV~S3 210 X2=U+S5 220 Y2=V+S4 230 IsU+(S5+57) 240 J=V -(53 +S6 > 250 G 0T 0 5000 360 IF C>O THE~ 7400 370 Xl =U+S3 3130 Y leV +52 390 X2=U-S4 l()0 Y2-V;"S5 410 I=U+"<S3+S6) 420 J=V-<S5+S7) 430 G 0T0 5000 2000 B= 1 12*C 2010 G0T0 90 2500 B=R+ <1 12*C > 2510 G0T0 90 3000 A3=45 - ( (AI +A2) /2) 3010 SI=TAN(A3*.01745329)*B 3020 52=SIN(Al*~01745329>*Sl 3030 53=C0S(Al*~01745329>*51 3040 S4=SINCA2*-.01745329>*Sl 3050 S5=C05 (A2*".01745329>*SI 3060 S6=SIN(Al*~01745329>*B 3070 57 =5 It-; (A2.".0 1745329>.B 3080 RETURN
~-----~---~-~-.---.-~v--r;;Z-W7---r
3500 I~PUT "IS THE. T00L HaVING X+1 (Y 0R 1\)"; HS 3510 IF HS="Y·· THEN 3710 3520 IF C>O THEN 6200 3540 Xl=U+S3 3550 Y 1 =V -S2 3560 X2=U-"S4 3570 Y:2=V +S5 3580 I=U+(S3+56) 3590 .J=V+(55+57) 3600 G 0T0' 5000 3710 IF C >0 THEt.l 6000 3720 Xl =U -S2 3730 Yl=V+53 37 40 X2 =U +S5 37 50 Y2 zoU -S4 3760 I=U+tS5+57) 3770 "}:o::V+(S3+S6) 3780 G0Tir 5000 4:>00 INPUT "15 THE TeeL M0VING x+1 (Y 0R N)"; KS IIJI0 IF KS=ttN" THEN 4210 4030 IF C>O' THE~ 6400 i()40 Xl =U-53 i()50 Yl =V~S2 4>60 X2=U+S4 1.{)70 Y2=V+55 4080 I=U-(S3+56) 4090 .J=V+(55 +S7) 4JOO G0T0 5000' Je 1 0 IF C>O THEN 6600 4220 XI =U +S2 ~30 Yl=V+53 ~40 X2=U-S5 4250 Y2-V:"S4 Je601=U-"(55+S7> 4270 .J=V=t-(53+56) Je80 G0T0 5000 4500 INPUT "IS THE TeeL M0VING X+1 (Y faR N)"lNS 1610 IF N$ =t. N" T HI.~ 4710 /620 IF C>O TliEN 6800' 4540 Xl-=U-53 4550 YI-V+S2 4560 X2=U+S4 4570 Y2=V-55 4580 I =U -'( 53 +S6 ) 4590 ,,}=V~(S5+S7)
4600 G0TlO 5000' ii710 IF C>O THEN 7000 4120 Xl=U+52 4'730 Y 1 =V -53 11140 X2-U:"55 Ji750 Y2=V+54 4160 I-U- (S5+57 ) Ji7 80 .JzoV:" ( 53 + 56 )
. III 90 G0TlO 5000 5(tOO IFC>O i\~P R>O_ THEN 5025
;;;JQ1(J PHINT -I JZ. z-n~n-l Iv.-
PRIl'liT "X2";X2: PRINT "Y2";Y2 5020 END
Il-oPUT "1'(0)";1'(0) IF QS="t.I" 0R RS=t'I\j" 0R 5$="1\1" 0R T $="I'.l" eR US="N" 0R VS="N" 0R W$:".
5025 5030
( 5060 F(1)=F~0)*«R-C/2)/R) - 5070 G0T0 5090
r'"
F(I)=F(0)*«R+C/2)/R) PRINT "Xl",;>:I: PRINT "Yl";Yl: PRINT "X2";X2: PRINT "V2"; V2: PRIt-JT8
5080 5090 5095 END 6000 6010
INPUT "15 THE T00L INSIDE? (V 0R N)"; Q$ IF QS="N" T HEl\! 6070
6020 :Xl;: W -52)+E 6030 vi = (V+U3) +1' 6040 X2=(U+55)+G 6050 Y2=(V-S4)+H 6060 G0T0 3760 6070 Xl=(U-S2)-E 6080 Vl=(V+S3)~F 6090 X2= W+S5 )"-G 6100 Y2=(V-S4)~H 6110 G0T0 3760" 6200 INPUT ~IS THE T00L INSIDE THE LIl-oES? (Y 0R N)"; R$ 6210 IF RS:;ftN" THE~ 6270 6220 Xl=(U+S3)+F 6230 Yl=(V-S2)+E 6240 X2= W"-54) +11 6250 V2::(V+S5)+G 6260 60T0 3580 6270 Xl:; (U+S3)-F 6280 Yl=(V-S2)~E 6290 X2=(U~S4)~H 6300 Y2=(V+S5 )~G 6310 G~T0 3580' 6400 INPUT "15 ThE T0eL INSIDE? (Y 0R l-o)";SS 64 1 0 I I' S $ = •• r.. ,. T HE 1\1 6470 6420 Xl=(U-S3)-F 6430 Yl=(V~S2>+E 6440 X2='W""'S4)-1i 6450 Y2='(V+S5 )+G 6460 60T0 4080 6470 Xl=(U-S3)+F 6480 Y1 = (V~52)-E 6490 X2='<u+S4)+}i 6500 Y2= (V+S5 )-G OS 10 60T0 4080' 6600 INPUT "IS THE T00L INSIDE? (Y 0R N)";TS 6610 IF T$ :t ... " THEN 6670 6620 Xl =(U+S2)-E 6630 Yl=(V+S3)+F 6640 X2:: W -55) -G 6650 Y2=(V~S4) +H 6660 GeT" 21260 6670 Xl=(U+52)+E 6680 YI=(V+53)-F
'OU .o~:~~ .. 301m.~li£ lUHl'J -----,~-.---,
6700 Y2=-(V~S4)-H 6710 G0T0 l£260" 6800 INPUT "IS THE T0"L It.:5IDE.? (Y lOR N)U;US 6810 IF US ::Ol\j" THEtIi 6870 6820 Xl ~ (U -S3)-F 6830 Yl=(V+S2):"E 6840 X2 =(U +S 4) "-H 6850 Y2 =(V -S5 ) ~G 6860 GeT0 1&580" 6870 Xl=(U-53)+F 6890 Y 1 =(V .S2) +E 6900 X2:: (U +S4 ) +H 6910 Y2=-(V-S5)+G 6920 G0TE 4580 7000 I~PUT uiS THE T0~L INSIDE? (Y 0R N)t'·; VS 7010 IF VS;O~·' THEN 7070 7020 Xl =CU+S2)-E 7030 Yl=(V-S3)"-F '7040 X2 =(U :"S5 ) ~G 7050 Y2=-(V=t.S4) '-H 7060 Gflrf 0 4760-7070 Xl=CU+S2)+E 7080 Yl =-(V -S3) +F 7090 X2=CU:-S5)+G 7100 Y2=(V+S4)+H '7110 G0T0 4760 1200 ItiiPUT 9'IS THE T00L INSIDE? <Y lOR N)U; WS '1210 IF \1$=ff},j.' THEN 7270 72 2 0 Xl == (U - 52) + E 7230 X2 .:(U+55 )-G 7240 Y2= (V +54) +H '7'250 Y2=(V+54)-H 7260 G0TfO 230 . 7270 Xl =CU -52)-E 7280 Yl=(V"-S3).F 7290 X2=<U.55)-G '7300 Y2 =-CV+54) +H 7310 G"T0 230 '7400 INPUT "IS THE T"0L INSIDE? ( Y fOR N)"; XS 7410 IF XS :I'N" T HElIi 7470 7420 Xl=<U +53) +F
• 7430 Yl =(V +52)-E ..,440 X2=CU-S4).H 7450 Y2=(V :"S5) -G 7460 GeT" ~10 . 7470 Xl =CU +S3)-F 7480 Yl=CV+52)+E '7490 X2=(U-54)-H 7500 Y2=<V"-55 )+G 7510 G0T0 2&10
----------- r- ____ _
1 ij
flC. IF;;
Purpose: rco compute the center of circle 2, Pl·· line 1,
circle 1 tC:l.11tjent point, P2 - line 2 cj.rclc 1,
F3 - circle 1, circle 2 tangent point and :24 -
circle 2, line 2 tangent point.
These points are necesGary to program the
CIiC BricgelJort mill to cut an S-curve (red line)
given tte radius of circle 1, the angle Rl,
the angl eo(, the angl e 92, and th c radius of
the second circle.
To rind
11
Circle C2 is tangent to
12. 12 given by P2 (from ) and g2
15
f;?-curve Plot Frogram
Given: Circle 1, radius of circle
tine 11 srecifiec' by angle e1 and tancent to circle
r:::quation 11: cO[:J(~l + 90 o )X + sin('-ll -I- 90 0 )y - r1 - 0
Given: Poinl;:2 = (X2, Y2) on circle 1
Given by angJe ~
X2 :co r 1 cos 0( ,Y2 = r 1 sino(
Line 12 through (X2,Y2) and has angle 82
-'-::quatioI: of 12: (cos(~2 + 90°)) ex - ::-:2) + (sin(~2 + SOo) (Y - 'i2) __ 0
~o find: Circ18 C2, whose radius is r2, which is tangent
to lino 12, circle C1
To find: ( ,r('I "T.ri) ].\..; , -'- ,-' center of circle 22
+ (sin(Q2 + 90 0 ))(yC - Y2) _ r2
oxpres88S tangency of 12 to C2
expresses taagency of C1 with C2
;·Iethod: B.nd (++) simultaneously for XC,YC
other ~uantities:
F3 = r 1/ (r 1 + r 2) ( XC , Y C)
Hl -- (XC, Ye) - r2(cos(.g2 + 90°), sin(fi2 + 9( 0)
Variable Dictionary
Rl# Radius of circle 1
T1J Theta - the angle from horizontal of line 1
AL,:j1 Al pha - t h.e angl e of circle 1 whic}} produc e,::; P2
T2J Theta 2 - the angle from horizontal of line 2
R2# HadiuG of circle 2
X1 /~
Y 1;/
x2;i
Y2:?
'1(' if L .... 'v ii
Y3/1
X4!i
X value
y value
X value
y valuE~
.... ·l value -'-'
Y value
X value
y value
X value
y value
of Pl
of Pl
of TJ2
of P2
of center
of center
of P3
of c?, .L ../
of a~
of F4
of circle 2
of circle 2
16
10 INPUT"GIVE RP'JRll 00 INPUT"G IVE THETA'" JT 1 # 30 INPUT"GIVE ALPHA"JALI 40 INPUT"GIVE THETA2"iT21 !O UIPUT"GIVE R2"iR21 60 LET PI=4 * AT~(1.0) 70 LET X 1 I =R I I • C 0S «T I I + 90) * PI / 180 ) SO LET Yl1=RII * SIN«TII + 90) * PI/180) ~ LET X21 a Rl I * CIOS (ALI * PI/180) 100 LET Y21=RI# * SI~(AL' * PI/180) 110 LET T,=(T21 + 90) * PI/180 120 LET AI=X21 + <1/ceS(TI».(R21 + Y21 * SINeTI» 130 LET BI=-SIN(TI)/C0seTI) ~o LET AII~BI[2+1 150 LET Bl,=2*AI*BI ~O LET CII=AI[2-(RII+R21)[2 170 LET YC'=(-Bl~~SQR(Bll[2-4*All*Cll»/2*Ali 180 LET XCI=A'+BI*YCI 190 LET X31=<Rll/(RII+R21»*XCI a)0 LET Y31=<Rll/(Rll+R21»*YCI 210 LET THI=(T21+90)*PI/180 220 LET X41=XCI-R21*C0S<THI) 230 LET Y41=YCI~R21*SIN(THI) 240 PRINT :PRIIIlT XCI;" "lye,;" CEl\iTER IOF CIRCLE 2" ~o PRINT XIII" "IYI~J" P1, LINE 1~ CIRCLE I, TANGENT pel~T" ~o PRI~T X21;" "IY211" P2~ LINE 2~ CIRCLE 1" 270 PRINT X31,," ";Y31;" P3, CIRCLE I" CIRCLE 2, TANGENT peUiT" ~o PRINT X41)" ";Y41;" P4, CIRCLE 2# LINE 2, TANGENT peINT" 290 Ef.;D
17
t6
Purpose:. To create and update programs for use on the CIIIC
Bridgeport r>;ill
E'Verytime the Bridgeport mill i.s used to manufacture
a part a new program must be vrri t ten. J';any times
these programs may be very similar except for a few
lines, where some specification is different. This
program would allow someone to edit an existing pro
gram without having to retype the entire program.
Since many programs written for the Bridgeport may
be over a hund.red lines this editing prograrn VJould
save much time in reprogramming instructions for the
Bridgeport mill.
This program creates new programs for the CNC mill
and stores them on tape. Once a program has been
created it can be edj.ted. If a program is to be
edited the old program tape is read in. The operator
can then:
(1) Display the entire fi.le
(2) Display a sinel e line (referc!nced by IT-number)
(3) Insert a new line (plac ed in correct sequence)
(4) Chanee an old line
(5 ) Delete an old li.ne (lines renumbered)
(6) Create a new file (stored on tape)
A~H I)
B~i> (I )
C
(7) Get a printout of the program
(8) ~xit from the editing program
Variable Dictionary
Array of IT-numbers
Array of code numbers for each N-number
Line Counter
Interval between N values
IT values
Temporary N-number -- used for insertion
Temporary partial line -- used for insertion
Purpose of tape
._--------_._-_._--
1 8
Allows progra.ms up to 275 lines
C LEAR STRING SPAc.E
OLD
PRINT lNSTRUCTIOf\lS
INPUT: PultPoSE STARTIN& N-VALUE INTERVAL BETWEEN N1S
INCREMENT N-NUMBER
INC.REMENT IND~ X
COMPUTE # OF LINES IN P6M
19
E5
YES
INc.itElV\rnl LINE <:.QuNTER
No
25
l~ISERT
NEW LINE
If end or array is reached then the number to be inserted is larger than any or the numbers presently in the file
Search 'lor correct insertion position for new line to ma.intain proper numerica.l ordering of lines
Renumber the indexes for the lines in the file after the new inserted line
ENTER N-NUMaE
YES
27
DELET[ OLD L\NE
N-number for line to be deleted
DECREMENT LI NE COVNTER
RENuM 8ER. LINE
INL~EMENT INDEX
NO
s Renumber lirlee following deleted line