Professional Documents
Culture Documents
NC PART PROGRAMMING
•Introduction
• Coordinate Systems
• NC Words
Coordinate System
Z
Z
Coordinate System
X AXIS X // table
workpiece-rotating machine:
X
X is the direction of tool movement Z
• N, G, X, Y Z, A, B, C, I, J, K, F, S, T, R, M
Individual Words
N – Sequence or line number
A tag that identifies the beginning of a block of code. It is used by
operators to locate specific lines of a program when entering data or
verifying the program operation.
G – Preparatory function
G words specify the mode in which the milling machine is to move along
its programmed axes.
Dimension Words
X – Distance or position in X direction
Y – Distance or position in Y direction
Z – Distance or position in Z direction
M – Miscellaneous functions
M words specify CNC machine functions not related to dimensions or
axial movements.
F – Feed rate (inches per minute or millimeters per minute)
Rate at which cutting tool moves along an axis.
T – Tool number
Specifies tool to be selected.
I – Circular cutting reference for x axis
• modal functions
Modal functions stay active until some other command changes it.
Modal commands are arranged in sets called “modal groups”, and
only one member of a modal group may be in forces at any given
time.
• non-modal functions
Non-modal functions have effect only on the lines on which they
occur.
NC Words
modal groups
NC Words
N, G, X, Y , Z, A, B, C, I, J, K, F, S, T, R, M
T: tool number
NC Words
N, G, X, Y , Z, A, B, C, I, J, K, F, S, T, R, M
• Unit selection:
• G70 (inch), G71(metric)
• Coordinates selection:
• G90(absolute), G91(incremental)
• Working plane selection:
• G17(X-Y), G18(Z-X), G19(Y-Z)
Set up working coordinate
Z
• Machine zero
• is unchangeable and usually is set up with the machine 23
• Working coordinate
(is decided by the offset from the machine zero) X
• G92 25.2
• Be defined in program G92 X25.2 Z23.0
G54 G59
Machine zero
Rapid traverse: G00
• G00:
• to make the machine move at maximum speed.
• It is used for positioning motion.
G90 G00 X20.0 Y10.0
End
G90:
(20,10)
absolute
coordinate (10,10)
s
Start (0,0)
Linear interpolation: G01
• G01:
• linear interpolation at feed speed.
G91 G0l X200.0 Y100.0 F200.0
Y
G91: End
incremental 100.0
coordinates
Start 200.0 X
Circular interpolation: G02, G03
• G02, G03:
• For circular interpolation, the tool destination and the circle center
are programmed in one block
• G02 is clockwise interpolation, G03 is counterclockwise
interpolation
X
O 90 120 140 200
Circular interpolation: G02, G03
X
O 90 120 140 200
M code
• miscellaneous word
• miscellaneous functions:
• turn the spindle on/off
• start/stop the machine
• turn on/off the coolant
• change the tool
• rewind the program (tape)
M code
modal groups
M code: M00, M01
N1 G90 G00 X0 Y0
N2 G01 X30
N3 G03 X54 R12
N4 G01 X82
N5 G02 X108 R13
N6 G01 X123
N7 X80 Y45
N8 X40
N9 Y75
N10 G03 X35 Y80 R5
N11 G01 X20
N12 G03 X0 Y80 R10
N13 G01 Y0
N14 M30
CNC Mill Programming Exercise
Explanation of CNC G-Code
7 6 G00 : Rapid traverse.
G54 : Zero Offset no. 1.
G64 : Continuous-path mode.
G90 : Absolute dimensioning system.
8 G91 : Incremental dimensioning
system.
G17 : X-Y plan selection.
9 G42 : Cutter radius compensation
activation (right hand side movement)
G40 : Cutter radius compensation de-
5 active
3 S : Spindle speed
F : Axis motion feed
10 4 M : Cutter motion (3=clockwise,
2 4=anti-clockwise)
D : Tool no
1
2004 51
DNC
2004 53
Distributed Numerical Control (DNC):
2004 54
Distributed Numerical Control (DNC):
2004 55