CNC Machine Codes Cheat Sheet

G00

Rapid Positioning: Moves machine axes at maximum speed to a specified coordinate.

G01

Linear Interpolation: Moves machine in a straight line at a controlled feed rate.

G02

Clockwise Circular Interpolation: Moves machine in a circular path clockwise.

G03

Counterclockwise Circular Interpolation: Moves machine in a circular path counterclockwise.

G20

Inch Units: Sets programming units to inches for subsequent commands.

G21

Metric Units: Sets programming units to millimeters for subsequent commands.

G28

Return to Home Position: Moves all axes to their predefined home or reference positions.

G90

Absolute Positioning: Coordinates are referenced from the machine's origin point.

G91

Incremental Positioning: Coordinates are referenced relative to the current position.

M02

Program End: Terminates the CNC program and resets modal settings.

M03

Spindle Clockwise: Starts spindle rotation in clockwise direction.

M04

Spindle Counterclockwise: Starts spindle rotation in counterclockwise direction.

M05

Spindle Stop: Halts spindle rotation immediately.

M30

Program End and Reset: Terminates program, resets, and returns to initial state.

G54

Work Coordinate System: Selects the first work coordinate system for part zero.

G92

Coordinate System Offset: Sets a temporary coordinate system without changing machine zero.

M06

Tool Change: Instructs machine to change the current cutting tool.