Advance Manufacturing Process
[MEEG317]
Krishna Prasad Shrestha, PhD
Associate Professor
DoME
[email protected] Program Format
A typical format for a mill or router is:
N G M X Y Z I J K F S P Q R T
These are the headings used on the programming sheet, where:
N = Block or sequence number.
G = Preparatory function.
M = Miscellaneous function.
X = X co-ordinate (absolute or incremental depending on programming mode).
Y = Y co-ordinate (absolute or incremental depending on programming mode).
Z = Y co-ordinate (absolute or incremental depending on programming mode).
I = Incremental move in X from start of arc to arc centre when circular interpolating.
J = Incremental move in Y from start of arc to arc centre when circular interpolating.
K = Incremental move in Z from start of arc to arc centre when circular interpolating.
F = feed rate in mm/min.
S = spindle Speed in RPM
P = Time dwell (in milli seconds) or a Canned cycle parameter.
Q = Canned cycle parameter.
R = Radius value when used with circular interpolation or a canned cycle parameter.
T = Tool Change.
The address letter G is followed by two digits, and the following codes can be used.
For further details, please see the Tutorials section.
Code Group Function Address Codes Used
G00 Rapid Traverse Movement XYZ
G01 Linear Interpolation XYZF
1
G02 Circular Interpolation (Clockwise) XYZIKFR
G03 Circular Interpolation (Counter Clockwise) XYZIKFR
G04 0 Time Dwell P
G17 Select X - Y Plane
G18 2 Select X - Z Plane
G19 Select Y - Z Plane
G20 Imperial Programming Units
6
G21 Metric Programming Units
G40 Cancel Tool Path Compensation
G41 7 Tool Path Compensation Left
G42 Tool Path Compensation Right
G50 Cancel Mirror Imaging
11
G51 Mirror Imaging XYIJ
G53 0 Cancel Datum Shift
G61 Exact Positioning Machine Feed Mode
15
G64 Cutting Machine Feed Mode (Exact Positioning Off)
G65 0 Macro Call P
G66 Macro Modal Call P
12
G67 Macro Modal Call Cancel
G80 Canned Cycle Cancel
G81 Drilling, Spot Drilling Cycle XYZKFR
G82 Drilling Cycle with Dwell, Counter Boring XYZ KFPR
G83 9 Drilling Cycle with Peck XYZKFQR
G85 Boring Cycle XYZKFR
G86 Boring Cycle with spindle stop XYZKFR
G89 Boring Cycle with Dwell XYZKFPR
G90 Absolute Co-ordinate Programming
3
G91 Incremental Co-ordinate Programming
G92 0 Datum Shift XY
M Code
The address letter M is followed by two digits, and the following codes can be used.
For further details, please see the Tutorials section.
Code Function Address Codes Used
M00 Programmed Intermediate Stop
M01 Programmed Optional Stop
M02 End of program (single quantity)
M03 Spindle Start Clockwise S
M04 Spindle Start Anticlockwise S
M05 Spindle Stop
M06 M06 Tool Change T
M08 Coolant On
M09 Coolant Off
M30 End of Program (Repeat)
M39 Close Automatic Chuck
M40 Open Automatic Chuck
M48 Open Automatic Guard
M49 Close Automatic Guard
M81 Turn output On/Off I (1 = on. 0 = off)
M97 Continuous Manufacture
M98 Subroutine Call P
M99 End of Subroutine
Absolute and Incremental Co-ordinates
Absolute Co-ordinates
Examples of these co-ordinates are shown in the table below.
Point Datum A B C D E F G H
X 0 5 10 -4 -9 -7 -4 7 5
Y 0 4 5 5 7 -3 -6 -5 -2
The Z axis is the vertical axis and the datum used is normally the surface of the work.
Z is positive when moving away from the surface and negative when moving towards or into the surface.
Incremental Co-ordinates
Point Datum A B C D E F G H
X 0 5 5 -14 -5 2 3 11 -2
Y 0 4 1 0 2 10 -3 1 3
Example:
• Tools used : 4mm Ø
Slot Drill
Absolute Co-ordinates
The absolute co-ordinates of the points on the profile are tabulated below.
Point A B C D E F T.C.
X 15 15 45 65 65 35 0
Y 15 35 35 35 15 15 0
Absolute coordinate mode
Point A B C D E F T.C.
X 15 15 45 65 65 35 0
Y 15 35 35 35 15 15 0
Incremental mode
Tool T.C.
Point A B C D E F
Change from F
X 0 35 0 30 20 0 -30 -35
Y 0 35 20 0 0 -20 0 -15
Exercise-2
Linear Interpolation - Absolute Co-
ordinates
• For the component shown in the figure,
use a programming sheet and write a
program for the cutter to cut a groove
along the path from A to H.
Absolute Co-ordinates
Absolute Co-ordinates:
Point Tool Change A B C D E F G H
X 0 20 60 20 20 60 20 60 60
Y 0 10 10 30 20 40 40 20 30
Spot and Peck Drill
Spot and Peck Drill
PROGRAMMING SHEET MATERIAL: PLASTIC
Drg No.
TITLE: TUT3-1 WRITTEN BY SHEET No. 1 OF 1
Prep Misc Axis Co- Feed Spindle Tool
Description Code Code ordinates Rate Speed No.
N G M X Y Z I J K F S P Q R T
Abs Cords 10 90
Metric Units 21
1st Tool 20 06 01
Park Position 30 00 0 0 25
Spindle on 40 03 2000
Start Position 50 20 -5 10
Inc Cords 60 91
20 -18 2 200 -8
Drill Hole A & B 81
Absolute coordinate system Cancel Cycle 70 80
Abs Cords 80 90
60 35 -8 200 5 2
Drill Hole C 83
Point A B C D Drill Hole D 90 15
X 20 20 60 60 Park Position 100 00 05 0 0 25
End of Program 110 30
Y 15 35 35 15
Exercise 3
• Canned Cycles - Macros - programming a Tool Change
Use of G81 & G83 Hole Drilling Canned Cycles and G65 P1088 Pocket Milling cycle
G65 - Macro Call
PROGRAMMING SHEET MATERIAL: PLASTIC
Drg No.
TITLE: TUT3-2 WRITTEN BY SHEET No. 1 OF 1
Prep Misc Axis Co- Feed Spindle Tool
Description Code Code ordinates Rate Speed No.
N G M X Y Z I J K F S P Q R T
Abs Cords 10 90
Metric Units 21
1st Tool 20 06 01
Park Position 30 00 0 0 25
Spindle on 40 03 2000
Macro call 50 65 40 25 -8 40 15 200 1088 4 2
Park Position 60 00 05 0 0 25
End of Program 70 30
Rectangular Pocket Macro
The P address for a rectangular pocket macro used in this tutorial is P1088.
X,Y = Centre of Pocket.
Z = Absolute depth
I = pocket X length
J = Pocket Y length
F = Feed rate
P = Macro address number.
Q = Number of equal passes to reach depth Z.
R = Retraction plane as used with drilling cycles described above.
The tool returns to its start point after the macro is complete
G66 -Model Micro call
PROGRAMMING SHEET MATERIAL: PLASTIC
Drg No.
TITLE: TUT3-3 WRITTEN BY SHEET No. 1 OF 1
Prep Misc Axis Co- Feed Spindle Tool
Description Code Code ordinates Rate Speed No.
N G M X Y Z I J K F S P Q R T
Abs Cords 10 90
Metric Units 21
1st Tool 20 06 01
Park Position 30 00 0 0 25
Spindle on 40 03 2000
Modal Macro call 50 66 -8 25 20 200 1088 4 2
Execute Macro 60 20 20
Execute Macro 70 60 30
Cancel Modal Macro 80 67
Park Position 90 00 05 0 0 25
End of Program 100 30
Exercise 3- Canned Cycles - Macros - programming a Tool
Change
Tutorial 4 - Circular Interpolation (G02 and G03)
• Circular Interpolation (G02 and G03) To program an arc from the current position, it is necessary to define a
FINISH point (See Fig. 23-2 and 23-3) and either;
a) the arc center point or
b) the arc radius. (See Fig. 23-4 and 23-5)
Interpolation Planes
• Circular interpolation can be used on any plane with plane X-Y selected by using the command
G17, plane X-Z using G18 and plane Y-Z with G19.
The information required to define the arc depends on the active plane. This is summarized as
follows
Example: G02 and G03
a) To define a 90 deg. Counterclockwise (G03) arc in the
XY plane from B to A around centre C as shown in the
diagram below requires the following data.
G X Y I J F
03 25 30 -10 0 200
Counterclockwise (G03)
b) To define a partial Counterclockwise (G03) arc in the XY
plane from B to A around Centre C as shown in the diagram
below requires the following data.
G X Y I J F
03 25 30 -5 -8.66 200
To calculate co-ordinates of B, construct triangle BCD
CD = 10 x cos60 = 10 x 0.5 = 5
BD = 10 x sin60 = 10 x 0.866 = 8.66
• Specifying an Arc Radius:- The arc center can be defined by specifying an arc radius using
the R address instead of I,K and K.
When defining an arc radius using R, 2 arcs around the center point are possible, one is less
than and one greater than 180 deg.
To define the arc less than 180 deg, a +ve R value is specified.
To define the arc greater than 180 deg, a -ve R value is specified.
Circular Interpolation
POINT A B C D E F G
X 10 20 30 40 50 60 70
Y 10 20 30 40 50 60 70
Circular Interpolation Examples
PROGRAMMING SHEET MATERIAL: PLASTIC
Drg No.
TITLE: TUT4 WRITTEN BY SHEET No. 1 OF 1
Prep Misc Axis Co- Feed Spindle Tool
Description Code Code ordinates Rate Speed No.
N G M X Y Z I J K F S P Q R T
Abs Cords 10 90
Metric Units 21
1st Tool 20 06 01
Park Position 30 00 0 0 25
Spindle on 40 03 2000
Above A 50 10 10 2
Feed to Depth 60 01 -2 200
A to B 70 02 20 20 10
B to C 80 03 30 30 10
C to D 90 02 40 40 10
POINT A B C D E F G D to E 100 50 30 10
X 10 20 30 40 50 60 70 E to F 110 03 60 20 10 0
Y 10 20 30 40 50 60 70 F to G 120 02 70 10 0 -10
Pull out 130 00 2
Park Position 140 05 0 0 25
End of Program 150 30
Exercise 4 - Circular Interpolation
Combining Operations and Tool Changing
Tutorial 5 - Combining Operations and Tool
Changing:
Material : Plastic • Sequence of Operations
Tool Change at :X0, Y0, Z25 • Mill the steps (8mm diameter slot drill)
• Drill the holes (4mm diameter slot drill)
• Mill the 30mm diameter pocket (8mm diameter slot drill)
• Circular Pocket Macro
The P address for a circular pocket macro used in this tutorial
is P1089.
X,Y = Centre of Pocket.
Z = Absolute depth
I = Pocket outside diameter
J = Pocket inside (island) diameter. Enter a value of 0.000 for
no island.
F = Feed rate
P = Macro address number.
Q = Number of equal passes to reach depth Z.
R = Retraction plane as used with drilling cycles described
above.
The tool returns to its start point after the macro is complete .
Material : Plastic
Tool Change at :X0, Y0, Z25
Exercise 5 - Combining Operations
Tutorial 6-1 - Subroutines
Tutorial 6-1 – Subroutines conti…
• A subroutine can be regarded as a
personalized canned cycle for use
in a program which has repetitive
shapes.
A subroutine is a program within a
program which can be called at
any time from the main program.
• Subroutines are generally
programmed in incremental co-
ordinates so they can be called at
any position.
• M98 = Subroutine Call
P = Subroutine Number = 0001
Subroutines
Exercise 6
Tabulate the co-ordinates required.
Use a programming sheet to write a
program;
the L shaped grooves can be
programmed using a subroutine.
Use a programming sheet to write a
program.