Simple Haas G-Code Facing Program
Facing is the process of making the top surface of a workpiece perfectly smooth, straight and level. It is widely used in CNC machines. In this process, the cutting tool usually moves in the X and Y axes and cuts the material in a small depth (Z axis) to eliminate the uneven surface.
Facing is done before starting machining, so that a clean and accurate reference surface of the workpiece is obtained.
This program is used especially on CNC mill machines and is considered the best starting point for beginners because it provides a basic understanding of tool movement, feed rate and spindle control.
Basic Facing Program Haas Mill
You are writing this program in a Haas CNC mill and the machine must be set to the reference position (Home). Set the workpiece to the zero point using G54 and T1 refers to a face mill that is properly seated in the tool changer and has its tool length offset pre-measured.
G21 indicates that the program is written in millimeter units, so the machine must also be in millimeter mode. Before cutting, the spindle speed, feed rate, and safe Z height are set appropriately so that no damage is done to the tool or workpiece.
%
O1001
G21 G17 G40 G49 G80 G90
T1 M06
G54
S2000 M03
G00 X-5 Y-5
G00 Z5.0
G01 Z-1.0 F200
G01 X105.0 F500
G01 Y105.0
G01 X-5.0
G01 Y-5.0
G00 Z5.0
M05
G28 G91 Z0
G28 G91 X0 Y0
M30
%
| % | Program start |
| O1001 | Program number |
| G21 | Metric units (mm) |
| G17 | XY plane selection |
| G40 | Cancel cutter compensation |
| G49 | Cancel tool length offset |
| G80 | Cancel canned cycles |
| G90 | Absolute positioning |
| T1 M06 | Tool 1 change (Face mill) |
| G54 | Work offset selection |
| S2000 M03 | Spindle ON clockwise at 2000 RPM |
| G00 X-5 Y-5 | Rapid move outside workpiece |
| G00 Z5.0 | Safe height above part |
| G01 Z-1.0 F200 | Feed down to cutting depth |
| G01 X105.0 F500 | Face cut in X direction |
| G01 Y105.0 | Move up in Y |
| G01 X-5.0 | Cut back in X |
| G01 Y-5.0 | Return to start corner |
| G00 Z5.0 | Rapid retract |
| M05 | Spindle stop |
| G28 G91 Z0 | Send Z axis home |
| G28 G91 X0 Y0 | Send X & Y home |
| M30 | End program & reset |
| % | Program end |
