CNC SUBROUTINES AND MACROS Machinery's Handbook, 31st Edition
1386
O7051 (BOLT HOLE CIRCLE MACRO) #10 = #4003 (STORE CURRENT G90 OR G91) IF [#7 LE 0] GOTO 9101 IF [#11 NE FUP[#11]] GOTO 9102 IF [#11 LE 0] GOTO 9103 IF [#19 EQ #0] THEN #19 = 1 IF [#19 NE FUP[#19]] GOTO 9102 IF [#19 LT 1] GOTO 9104 IF [#19 GT #11] GOTO 9105 #7 = #7⁄2 (BOLT CIRCLE RADIUS) WHILE [#19 LE #11] DO1 #30 = [#19—1] * 360 / #11 + #1 X[COS[#30] * #7 + #24] Y[SIN[#30] * #7 + #25] #19 = #19 + 1 END1 GOTO 9999 N9101 #3000=101 (DIA MUST BE POSITIVE)
N9102 #3000=102 (ONLY INTEGER NUMBER ALLOVED) N9103 #3000=103 (ONLY POSITIVE NUMBER OF HOLES) N9104 #3000=104 (START HOLE MUST BE AN INTEGER) N9105 #3000=105 (START HOLE NUMBER IS TOO HIGH) N9999 G#10 (RESTORE ORIGINAL G90 OR G91) M99 % The macro call in block N5 includes six arguments that will be passed to the macro:
X = #24 = Bolt circle center distance from X0 (X3.0) Y = #25 = Bolt circle center distance from Y0 (Y6.5) D = #7 = Bolt circle diameter (D4.5) H = #11 = Number of EQSP holes (H6) A = #1 = Bolt circle angular orientation (default is 0) (A5.0) S = #19 = Start hole number (default is 1) (S1) Axis Nomenclature
To distinguish among the different motions, or axes, of a machine tool, a system of letter addresses has been developed. A letter is assigned, for example, to the table of the ma- chine, another to the saddle, and still another to the spindle head. These letter addresses, or axis designations, are necessary for the electronic control system to assign movement instructions to the proper machine element. The assignment of these letter addresses has been standardized on a worldwide basis and is contained in three standards, all of which are in agreement. These standards are EIA RS-267-B, issued by the Electronics Industries Association; AIA NAS-938, issued by the Aerospace Industries Association; and ISO/R 841, issued by the International Organization for Standardization. The standards are based on a “right-hand rule,” which describes the orientation of the motions as well as whether the motions are positive or negative. If a right hand is laid palm up on the table of a vertical milling machine, as shown in Fig. 1, for example, the thumb will point in the positive X -direction, the forefinger in the positive Y -direction, and the erect middle finger in the positive Z -direction, or up. The direction signs are based on the motion of the cutter relative to the workpiece. The movement of the table shown in Fig. 2 is therefore positive, even though the table is moving to the left, because the motion of the cutter relative to the workpiece is to the right, or in the positive direction. The motions are considered from the part programmer’s viewpoint, which assumes that the cutter always moves around the part, regardless of whether the cutter or the part moves. The right-hand
Copyright 2020, Industrial Press, Inc.
ebooks.industrialpress.com
Made with FlippingBook - Share PDF online