cnc part programming m and g code toutorial



direct link for download simulation software is given in download page.
---------------------------------------------------------------------------------
code for milling
-------------------------------------------------------------------------------------------------------------
G0 or G00
Rapid movement

G1 or G01 or L
Linear interpolation

G2 or G02 or DR-
Clockwise interpolation

G3 or G03 or DR+
Anti-clockwise interpolation

G40
Turns off cutter compensation

G41
Cutter compensation to the left

G42
Cutter compensation to the right

G92
Zero point displacement

Rectangular pocket milling

Drill cycle

G90
Absolute programming

G91
Incremental programming

G94
Feed rate in mm/min

G95
Feed rate in mm/revolution

G54
Zero point 1

G55
Zero point 2

G56
Zero point 3

G57
Zero point 4

G58
Zero point 5

G59
Zero point 6

G53
No zero point displacement
-----------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
M0 or M00
Program stop

M3 or M03
Spindle start clockwise

M4 or M04
Spindle start anti-clockwise

M5 or M05
Spindle stop

M8 or M08
Coolant on

M9 or M09
Coolant off

M17
Return from subprogram

M30 or M02 or M2
Program end
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
F
Feed rate

S
Spindle speed

N
Block number

T or TOOL CALL
Tool

X
Code for the X-axis

Y
Code for the Y-axis

Z
Code for the Z-axis
I
Incremental distance to the center in the X-axis

J
Incremental distance to the center in the Y-axis

K
Incremental distance to the center in the Z-axis

R or Z
Arc <180 degrees

R- or Z-
Arc >180 degrees

P
Overlapping in pocket milling

L
Subprogram block number

U
Subprogram repetitions
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------