0% found this document useful (0 votes)
2 views

05 Multiple Machining Subprogram St

The document provides detailed instructions on using G codes for multiple machining operations, including bolt hole patterns and subprograms in CNC programming. It explains the syntax and examples for various G codes such as G70, G71, and G72, which are used for drilling holes in different configurations. Additionally, it covers the use of subroutines to streamline programming by allowing repeated commands to be called efficiently.

Uploaded by

MOHAMMED WESSAM
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

05 Multiple Machining Subprogram St

The document provides detailed instructions on using G codes for multiple machining operations, including bolt hole patterns and subprograms in CNC programming. It explains the syntax and examples for various G codes such as G70, G71, and G72, which are used for drilling holes in different configurations. Additionally, it covers the use of subroutines to streamline programming by allowing repeated commands to be called efficiently.

Uploaded by

MOHAMMED WESSAM
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 20

Faculty of Engineering

Mechatronics Engineering Dept.


2nd level

Computerized Design
and Manufacturing
Lect. No.5
Today Lecture

Multiple Machining (Continue)

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

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
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
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

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
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

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
N3G99 G81 Z-5 R1.1 F0.4 Program
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-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

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

You might also like