G & M Codes - PLTW
What are G & M Codes?
Operate CNC machines
Began
G & M Today
Translates human language to machine language
Typed into computer or generated by a program
Sample Program Block (line of code):
N01 M06 T1 ; Change to tool #1
“;” — semi colons are comments like “//” in C# or “- -” in Lua
G Codes
G90 | Absolute Coordinates | Exactly go to the coordinates relative to the origin; Go to (5,6) |
G91 | Relative Coordinates | Change you units by # from wherever you at; Move up 1 and move left 2 |
G00 | Rapid Traverse (non-cutting move) | |
G01 | Straight Line interpolation (cutting move) | Cutting a line: X1 Y1 Z2 R1.5 (radium) F20 (IPM) |
G02 | Circular interpolation (clockwise) | Cutting an arc: |
G03 | Circular Interpolation (counter-clockwise) | |
G04 | Dwell (wait) — Pause measured in seconds on all axes | |
G05 | Pause - Wait for user intervention | |
G20 | Inch Programming Units | (IPM) |
G21 | Millimeter Programming Units | (MPM) |
M Codes
M00 | Pause | |
M01 | Optional Stop | |
M02 | End of Program | |
M03 | Spindle On | |
M05 | Spindle Off | |
M06 | Tool Change | |
S - Spindle Speed
T - Tool Number