05 Multiple Machining Subprogram St
05 Multiple Machining Subprogram St
Computerized Design
and Manufacturing
Lect. No.5
Today Lecture
2
Standard Fixed
Cycles
Y
Loop Command Cycles
X
N10 G90 G20
G91 X1 L9
G90 Y-2
G91 X-1 L9
Y
G90 Y-3
X
G91 X1 L9
G90 Y-4
G91 X-1 L9
……………
G90 Y-10
G91 X-1 L9
M30
Bolt Hole Patterns
G70 I J L
L: Number of Holes
Y
Example X
N10 G90 G20 G00 X6 Y5 Z1 T01 M06
hole circle)
Note : L0 will cause machine
N50 G99 G81 Z-0.5 R0.1 F0.4 L0
to not do this command until
N60 G70 I1.25 J10 L8 the control reads the next
line, so as not to drill a hole
N70 G80 G00 X6 Y5 Z1 M05 M09
in the center of bolt circle
N80 M30
G71: Bolt Hole Arc
G71 I J K L
L: Number of Holes
Example Y
N10 G90 G20 G00 X6 Y5 Z1 T01 M06 X
N80 M30
G72: Bolt Hole along an angle
G72 I J L
L: Number of Holes
Y
Example X
N40 G00 X0.65 Y-1.5 (Start position of bolt holes along an angle)
N80 M30
Example No.1 Y
N10 G90 G20
N20 G00 X5 Y5 Z1 T01 M06
N30 S1000 M03 M08
N40 G00 X1 Y1
N50 G99 G81 Z-1.5 R0.1 F0.4 L0
N60 G70 I0.5 J0 L6
X
N70 G80 G00 X3 Y1
N80 G99 G81 Z-1.5 R0.1 F0.4 L0
N90 G70 I0.5 J0 L6
Y
N100 G80 G00 X3 Y3
N170 M30
Subprogram
Subprogram call M97
instead of repeating them many times, they can be “called up” when
needed.
The most common use of subroutines is in the definition of a series of
holes which may need to be center drilled, peck drilled, tapped, and/or
chamfered.
holes, the main program can define the canned cycles, and the hole
operations.
Thus, the X-Y positions can be entered only once and used several
with the subroutine call it is repeated that number of times before the
M99 which sends it back to the next line after the subroutine call in
O100 (Subprogram)
X2.5
X4.5
X3.5 Y1.5
…………Listing all the hole locations
M99 (ends a sub-program and returns back to
the next line in the main program)
Write a G code program for milling the shown 4 rectangular pocket,
use subroutine
Y call.
20
25
30
20 X
N1 G90 G21 G00 X200 Y80 Z50 T01 M06
N2 G00 X20 Y20 Z5 S1000 M03 M08
N4 M97 O100 L1
N6 G00 X70 O100 (Subprogram)
N7 M97 P100 L1 G92 X0 Y0 (set current
N8 G00 X120 Main Program position to X=0,Y=0)
N9 M97 O100 L1 G01 Z-10 F4
N10 G00 X200 Y 50 Z20 M05 M09 Y25
N11 M30 (End of main program) X30
Y0
X0
Z2
M99