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

CNC Programming Examples Suggested by MRZ

The document provides an overview of various G, M, S, and T codes used in CNC programming, detailing their functions. It includes examples of CNC programs for corner rounding, chamfering, pocket milling, and converting between absolute and incremental programming modes. Additionally, it features subprograms and explanations for specific machining operations.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

CNC Programming Examples Suggested by MRZ

The document provides an overview of various G, M, S, and T codes used in CNC programming, detailing their functions. It includes examples of CNC programs for corner rounding, chamfering, pocket milling, and converting between absolute and incremental programming modes. Additionally, it features subprograms and explanations for specific machining operations.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

G M S T Codes Explanation

Code Description
G0 Rapid traverse
G1 Linear interpolation
G2 Circular interpolation CW
G3 Circular interpolation CCW
G43 Tool length compensation + direction
M3 Spindle start forward CW
M6 Tool change
M30 End of program (Reset)
T Tool
S Speed
F Feed

*************

Haas Corner Rounding and


Chamfering Example G01 C R
Haas Corner Rounding and Chamfering
Haas CNC program example to show how Chamfer and Corner Radius can be
programmed.

Haas Chamfering
To program Chamfer
N10 G01 X20 Y30 ,C3

Haas Corner Rounding


To program Radius
N10 G01 X20 Y30 ,R3

Haas Corner Rounding and Chamfering Example


Haas CNC Program
O1234 (Corner Rounding and Chamfering Example);
T1 M6;
G00 G90 G54 X0. Y0. S3000 M3; (P1)
G43 H01 Z0.1 M08;
G01 Z-0.5 F20.;
Y40. ,R10.;(P2)
X50. ,C5.; (P3)
Y0.; (P4)
G00 Z0.1 M09;
G53 G49 Z0.;
G53 Y0.;
M30;

Haas G M S T Codes
Code Description
G00 Rapid Motion
G01 Linear Interpolation Motion
G43 Tool Length Compensation +
G49 G43/G44 Cancel
G53 Non-Modal Machine Coordinate Selection
G54 Select Work Coordinate System l
G90 Incremental Programming
M3 Spindle On, Clockwise (S)
M6 Tool Change (T)
M08 Coolant On
M09 Coolant Off
M30 Program End and Reset
S Spindle speed
T Tool

*************

CNC Mill Subprogram Example


Joining Multiple Arcs G02 G03 G41
CNC milling program to describe how two or more radii can be joint together in
a cnc mill program.

CNC Mill Subprogram Example


CNC Part Program
N10 T1 H1 M6 G43 M3
N20 F150 S250
N30 G0 X-21 Y50 Z0.5
N40 G0 Z0
N50 M98 P040050
N60 G49
N70 G0 Z50
N80 M30

Subprogram
O0050
N10 F160 S400
N20 G0 Z-2.5 G91
N30 G1 G90 X5 Y50 G41 (P1)
N40 G2 X22 Y85.23 I45 J0 (P2)
N50 G3 X78 Y85.23 R45 (P3)
N60 G2 X78 Y14.77 R45 (P4)
N70 G3 X22 Y14.77 R45 (P5)
N80 G2 X5 Y50 R45 (P1)
N90 G0 G40 X-21
N100 M99

G M S T Codes Explanation
Code Description
G00 Rapid traverse
G01 Linear interpolation
G02 Circular interpolation CW
G03 Circular interpolation CCW
G40 Cutter compensation cancel
G41 Tool nose radius compensation left
G43 Tool length compensation + direction
G49 Tool length compensation cancel
G90 Absolute command
G91 Increment command
M03 Spindle start forward CW
M06 Tool change
M30 End of program (Reset)
M98 Subprogram call
M99 End of subprogram
T Tool
S Speed
F Feed

*************

CNC Mill Program G91 G41 G43

CNC Mill Program G91 G41 G43


CNC Part Program
N05 G54
N10 M6 T1 G43 H1 M3
N15 S500 F120
N20 G0 X-22 Y-22
N25 Z-3
N30 G1 X3 Y6 G41 H2 (P1)
N35 G91 X0 Y24(P2)
N40 X12 Y9(P3)
N45 X36 (P4)
N50 Y-24 (P5)
N55 X-21 (P6)
N60 G90 X3 Y6 (P1)
N65 G0 X-21 G40

G M S T Codes Explanation
Code Description
G00 Rapid traverse
G01 Linear interpolation
G40 Cutter compensation cancel
G41 Tool nose radius compensation left
G43 Tool length compensation + direction
G54 Workpiece coordinate system 1 selection
G90 Absolute command
G91 Incremental command
M06 Tool change
T Tool
S Speed
F Feed

*************

CNC Pocket Milling Program


Example – Peck Milling
CNC milling program example which shows how a cnc program can be made to
machine Pockets on a cnc mill.
This program example uses Peck milling to cut material to machine a rectangular
and one round pocket.

CNC Pocket Milling Program Example


Main Program
Milling cutter diameter: 10mm
N05 G55
N10 M6 T2 H3 G43 M3
N15 S1000 F60
N20 G0 X9 Y9 Z1
N25 G1 Z0
N30 M98 P030035
N35 G0 Z1 G90
N40 X42 Y38
N45 G1 Z-2 F30
N50 X47 F300
N55 G3 X47 Y38 I-5 J0
N60 G0 Z100
N65 G49
N70 M30

Subprogram
O0035
N05 G1 Z-2 G91 F30
N10 X10 F100
N15 Y36
N20 X-10
N25 Y-36
N30 M99

Explanation
Although this cnc mill program is self explanatory
M98 P030035

*************

CNC Milling Program Example G03


G90 G91
CNC milling program example, which illustrates how a cnc program can be
easily converted from G90 Absolute program mode to G91 Incremental program
mode.

CNC Milling Program Example


G90 Absolute Program G91 Incremental Program
N10 T1 M6 M3 G43
N15 S2000 F80
N10 T1 M6 M3 G43 N15 S2000 F80 N20 G0
N20 G0 X10 Y10 Z1 (P1)
X10 Y10 Z1N25 F30 N30 G1 Z-2
N25 F30
N35 G91 X15 F80
N30 G1 Z-2
N40 G3 X0 Y10 I0 J5
N35 X25 F80 (P2)
N45 G1 X-15
N40 G3 X25 Y20 I0 J5 (P3)
N50 Y10
N45 G1 X10 (P4)
N55 G90 G0 Z100 G49
N50 Y30 (P5)
N60 M30
N55 G0 Z100 G49
N60 M30

*************

CNC Turning Center Programming


Example
Easy to understand CNC turning center/cnc lathe programming example for cnc

You might also like