0% found this document useful (0 votes)
65 views24 pages

1st - T - Lect No.11 - CAM - Multiple Machining - Subprogram

The document discusses multiple machining cycles, standard fixed cycles, and subprograms in CNC programming. It provides examples of loop command cycles, bolt hole patterns using G70, G71 and G72, and calling a subprogram using M97. It includes a sample program for milling 4 rectangular pockets using a subprogram call.

Uploaded by

Hazem Ahmed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
65 views24 pages

1st - T - Lect No.11 - CAM - Multiple Machining - Subprogram

The document discusses multiple machining cycles, standard fixed cycles, and subprograms in CNC programming. It provides examples of loop command cycles, bolt hole patterns using G70, G71 and G72, and calling a subprogram using M97. It includes a sample program for milling 4 rectangular pockets using a subprogram call.

Uploaded by

Hazem Ahmed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

Today Lecture

Multiple Machining

2
Standard Fixed Cycles
Y
Loop Command Cycles
N10 G90 G20 X

N20 G00 X12 Y2 Z1 T01 M06

N30 S1000 M03 M08

N40 G00 X1 Y-1

N50 G99 G81 Z-1.5 R0.1 F0.4

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

G80 G00 G90 X12 Y2 M05 M09

M30
Y
Loop Command Cycles
X

Student
activity
Y
Loop Command Cycles
N10 G90 G20 X

N20 G00 X12 Y2 Z1 T01 M06

N30 S1000 M03 M08

N40 G00 X1 Y-1

N50 G99 G81 Z-1.5 R0.1 F0.4

G91 X1 L9

G91 Y-1 L9 Student


activity
Y
G91 X-1 L9
X
G91 Y 1 L8

G91 X 1 L8

G90 X9 Y-3

G91 Y -1 L6

……………

G80 G00 G90 X12 Y2 M05 M09


Student
M30
activity
Bolt Hole Patterns

G72: Bolt Hole along


G70: Bolt Hole Circle G71: Bolt Hole Arc
an angle

These G codes must be used with one of canned cycles (G81-G76)

The tool must be positioned at the center of circle either in


a previous block or in the G70/71 )
G70: Bolt Hole Circle

G70 I J L

I: Radius (Minus Reverse Starting Position)

J: Starting Angle (0 To 360 Deg. CCW Form Horizontal)

L: Number of Holes
Y
Example X
N10 G90 G20 G00 X6 Y5 Z1 T01 M06

N30 S1000 M03 M08

N40 G00 X2 Y-1.5 (Center position of bolt

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

N70 G80 G00 X6 Y5 Z1 M05 M09 line, so as not to drill a hole


in the center of bolt circle
N80 M30
G71: Bolt Hole Arc

G71 I J K L

I: Radius (Minus Reverse Starting Position)

J: Starting Angle (0 To 360 Deg. CCW Form Horizontal)

K: Angular Spacing of Holes (+ or -)

L: Number of Holes
Example Y
N10 G90 G20 G00 X6 Y5 Z1 T01 M06 X

N30 S1000 M03 M08

N40 G00 X2 Y-1.5 (Center position of bolt hole arc)

N50 G99 G81 Z-0.5 R0.1 F0.4 L0

N60 G71 I0.875 J45 K36 L6

N70 G80 G00 X6 Y5 Z1 M05 M09

N80 M30
G72: Bolt Hole along an angle

G72 I J L

I: Distance Between Holes

J: Angle Form Three o’clock position

L: Number of Holes
Y
Example X

N10 G90 G20 G00 X6 Y5 Z1 T01 M06

N30 S1000 M03 M08

N40 G00 X0.65 Y-1.5 (Start position of bolt holes along an angle)

N50 G99 G81 Z-0.5 R0.1 F0.4 G72 I0.5 J20 L7

N70 G80 G00 X6 Y5 Z1 M05 M09

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 X

N60 G70 I0.5 J0 L6

N70 G80 G00 X3 Y1

N80 G99 G81 Z-1.5 R0.1 F0.4 L0

N90 G70 I0.5 J0 L6


N100 G80 G00 X3 Y3 Y

N110 G99 G81 Z-1.5 R0.1 F0.4 L0

N120 G70 I0.5 J0 L6

N130 G80 G00 X1 Y3

N140 G99 G81 Z-1.5 R0.1 F0.4 L0


X
N150 G70 I0.5 J0

N160 G00 G80 X5 Y5 Z1 M05 M09

N170 M30
Subprogram
Subprogram call M97

A subprogram is a separate program called up by another program.

The use of subprograms can significantly reduce the amount of

programming on some parts.

Subroutines allow the CNC programmer to define a series of

commands which might be repeated several times in a program and,

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.

If a subroutine is defined that consists only of the X-Y position of the

holes, the main program can define the canned cycles, and the hole

locations can be called up in the subroutine to do each of the tool

operations.

Thus, the X-Y positions can be entered only once and used several

times for each tool.


Another important feature of a "subroutine call" is that the M97

block may also include an L (loop) or repeat count. If there is an Ln

with the subroutine call it is repeated that number of times before the

main program continues with the next block.

To return back to the main program, you end a subroutine with an

M99 which sends it back to the next line after the subroutine call in

the main program.


Subroutine call M97
N1 G90 G20 G00 X6 Y4 Z2 T01 M06
N2G00 X0.5 Y0.5 S1000 M03 M08

Main Program
N3G99 G81 Z-1.5 R1.1 F0.4
N4 M97 O100 L1
N5 M05 G80
N6 G00 X6 Y4 Z2 T02 M06
N7G00 X0.5 Y0.5 S300 M03 M08
N8G99 G84 Z-0.5 R1.1 F0.1
N9 M97 O100 L1
N10 G80 G00 X6 Y4 Z2 M05
N11 M30 (End of main program)

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

20
30
X
N1 G90 G21 G00 X200 Y80 Z50 T01 M06

Main Program
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 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
24
24

You might also like