CNC Codes
From Zen_Toolworks_Wiki
Here is a quick reference chart of available machine codes. Listed below are "G" "M" and "N" codes used in Milling and Lathing applications and projects. There are great references on the Internet that explain these codes. We were going to replicate them here, but we like to honor those who have worked so hard to provide this education for free to the Internet. Refer to the External links at the bottom for detailed explanations of these codes.
Commonly Used "G" Codes - CNC Mill
|
G00 - Rapid Positioning |
G52 - Local Coordinate Setting |
|
G01 - Feedrate Positioning |
G53 - Machine Coordinate Setting |
|
G02 - Arc Clockwise |
G54 - Workpiece Coordinate Setting #1 |
|
G03 - Arc Counterclockwise |
G55 - Workpiece Coordinate Setting #2 |
|
G04 - Dwell |
G56 - Workpiece Coordinate Setting #3 |
|
G05 - High Speed Machining |
G57 - Workpiece Coordinate Setting #4 |
|
G07 - Imanaginary Axis Designation |
G58 - Workpiece Coordinate Setting #5 |
|
G09 - Exact Stop Check |
G59 - Workpiece Coordinate Setting #6 |
|
G10 - Program Parameter Input |
G60 - Single Direction Positioning |
|
G11 - Program Parameter Input Cancel |
G62 - Automatic Corner Override |
|
G12 - Circle Cutting CW |
G63 - Tapping Mode |
|
G13 - Circle Cutting CCW |
G64 - Cutting Mode |
|
G17 - X - Y Plane |
G65 - Custom Macro Call (Simple) |
|
G18 - X - Z Plane |
G66 - Custom Macro Call (Modal) |
|
G19 - Y - Z Plane |
G67 - Custom Macro Call Cancel (Modal) |
|
G20 - Input in Inch Units |
G68 - Coordinate System Rotation ON |
|
G21 - Input in Metric |
G69 - Coordinate System Rotation OFF |
|
G22 - Stored Stroke Limit ON |
G70 - Input in Inch Units |
|
G23 - stored Stroke Limit OFF |
G71 - Input in Metric Units |
|
G27 - Reference Point Return Check |
G73 - High Speed Peck Drilling Cycle |
|
G28 - Automatic Return to Reference Point |
G74 - Left Hand Tapping Cycle |
|
G29 - Automatic Return from Reference Point |
G76 - Fine Boring Cycle |
|
G30 - Return to 2nd, 3rd or 4th Reference Point |
G80 - Canned Cycle Cancel |
|
G31 - Skip Function |
G81 - Drilling Cycle (Canned) |
|
G33 - Thread Cutting |
G82 - Counter Boring Cycle (Canned) |
|
G34 - Bolt Hole Circle (Canned Cycle) |
G83 - Peck Drilling Cycle (Canned) |
|
G35 - Line at Angle (Canned Cycle) |
G84 - Right Hand Tapping Cycle (Canned) |
|
G36 - Arc (Canned Cycle) |
G85 - Boring Cycle (Canned) |
|
G40 - Cutter Compensation Cancel |
G87 - Back Boring Cycle (Canned) |
|
G41 - Cutter Compensation Left |
G90 - Absolute Positioning |
|
G42 - Cutter Compensation Right |
G91 - Incremental Positioning |
|
G43 - Tool Length Compensation (Plus) |
G92 - Reposition Origin Point |
|
G44 - Tool Length Compensation (Minus) |
G94 - Feed Per Minute |
|
G45 - Tool Offset Increase |
G95 - Feed Per Revolution |
|
G46 - Tool Offset Decrease |
G96 - Constant Surface Speed Control |
|
G49 - Tool Length Compensation Cancel |
G97 - Constant Surface Speed Control Cancel |
|
G50 - Scaling OFF |
G98 - Set Initial Plane (Default) |
|
G51 - Scaling ON |
G99 - Return to Rapid Plane |
Commonly Used "G" Codes - CNC Lathe
|
G00 - Rapid Positioning |
G57 - Workpiece Coordinate Setting #4 |
|
G01 - Feedrate Positioning |
G58 - Workpiece Coordinate Setting #5 |
|
G02 - Arc Clockwise |
G59 - Workpiece Coordinate Setting #6 |
|
G03 - Arc Counterclockwise |
G61 - Exact Stop Check Mode |
|
G04 - Dwell |
G62 - Automatic Corner Override |
|
G07 - Feedrate Sine Curve Control |
G63 - Tapping Mode |
|
G10 - Data Setting |
G64 - Cutting Mode |
|
G11 - Data Setting Cancel |
G65 - User Macro Call |
|
G17 - X - Y Plane |
G66 - User Macro Call (Modal) |
|
G18 - X - Z Plane |
G67 - User Macro Call Cancel (Modal) |
|
G19 - Y - Z Plane |
G70 - Finishing Cycle |
|
G20 - Inch Units |
G71 - Turning Cycle |
|
G21 - Metric Units |
G72 - Facing Cycle |
|
G22 - Stored Stroke Check ON |
G73 - Pattern Repeat |
|
G23 - Stored Stroke Check OFF |
G74 - Drilling Cycle |
|
G27 - Reference Point Return Check |
G75 - Grooving Cycle |
|
G28 - Automatic Zero Return |
G76 - Threading Cycle |
|
G29 - Return from Zero Position |
G80 - Canned Cycle Cancel |
|
G30 - 2nd Reference Point Return |
G83 - Face Drilling Cycle |
|
G31 - Skip Function |
G84 - Face Tapping Cycle |
|
G32 - Thread Cutting |
G86 - Face Boring Cycle |
|
G36 - Automatic Tool Compensation |
G90 - Absolute Positioning |
|
G40 - Tool Compensation Cancel |
G91 - Incremental Positioning |
|
G41 - Tool Compensation Left |
G92 - OD Thread Cutting Cycle |
|
G42 - Tool Compensation Right |
G94 - Face Turning Cycle |
|
G46 - Automatic Tool Compensation |
G96 - Constant Speed Control |
|
G50 - Coordinate System Setting |
G97 - Constant Speed Control Cancel |
|
G52 - Local Coordinate System Setting |
G98 - Feedrate Per Time |
|
G53 - Machine Coordinate System Setting |
G99 - Feedrate Per Revolution |
|
G54 - Workpiece Coordinate Setting #1 |
G107 - Cylindrical Interpolation |
|
G55 - Workpiece Coordinate Setting #2 |
G112 - Polar Coordinate Interpolation |
|
G56 - Workpiece Coordinate Setting #3 |
G113 - Polar Coordinate Interpolation Cancel
|
Commonly Used "M" Codes - Mill & Lathe
|
Mill |
Lathe |
|
M00 - Program Stop |
M00 - Program Stop |
|
M01 - Optional Stop |
M01 - Optional Program Stop |
|
M02 - Program End |
M02 - Program End |
|
M03 - Spindle Clockwise |
M03 - Spindle Clockwise |
|
M04 - Spindle Counter Clockwise |
M04 - Spindle Counter Clockwise |
|
M05 - Spindle Stop |
M05 - Spindle Stop |
|
M06 - Tool Change |
|
|
M07 - Thru Spindle Coolant ON |
M07 - Flood Coolant #1 On |
|
M08 - Flood Coolant ON |
M08 - Flood Coolant #2 On |
|
M09 - Coolant Off (all coolant) |
M09 - Coolant Off |
|
M10 - Table Pallet Clamp |
|
|
M11 - Table Pallet Unclamp |
|
|
M12 - Shower Coolant On |
|
|
M14 - Spindle Air Blow On |
|
|
M15 - Spindle Air Blow Off |
|
|
M16 - Air Blast / Tool Changer |
|
|
M18 - Air Blast Off |
|
|
M19 - Spindle Orientation |
|
|
M29 - Rigid Tapping |
|
|
M30 - End Program |
M30 - End Progarm |
|
M60 - Pallet Change |
|
|
M61 - Load Pallet #1 |
|
|
M62 - Load Pallet #2 |
|
|
M98 - Sub Program Call |
M98 - Sub Program Call |
|
M99 - Sub Program Cancel |
M99 - Sub Program Cancel
|
External links
Machine Codes - Tormach provides a fantastic layout helping to explain machine codes in detail. They also provide some good books on the subject and while they also provide CNC machines, they are higher priced and purposed for non-hobbyists. But a good team of folks never the less!