G-Code Reference

*Work-in-progress*

G Codes

G01 (X Y Z A B F) Linear move with specified feedrate (speed)
G92 reposition the origin

G20 imperial units (inches for positions and inches per min for feedrates)
G21 metric units (mm and mm per min)

G54 Fixture offsets. Allows to work in different coordinate systems.
G55

G90 Absolute positioning mode
G92 Position (X Y Z A B) set position register

G162 (X Y Z F) go to maximum position (hit the limit switch)
G161 (X Y Z F) go to minimum position (hit the limit switch)

M Codes

M00 stop codes (see handleStopes() for specific reference)
M01
M02

M03 spindle on, CW
M04 spindle on, CCW
M05 spindle off

M06 tool change - looks for a T code value to select new tool

M07 coolant A on (flood coolant)
M08 coolant B on (mist coolant)
M09 all coolants off

M10 close clamp (looks for Q parameter value)
M11 open clamp (looks fo rQ parameter value)

M13 spindle CW and coolant A on
M14 spindle CCW and coolant A on

M17 enable drives
M18 disable drives

M21 open collet
M22 close collet

M40 change gear ratio - 0
M41 change gear ratio - 1
M42 change gear ratio - 2
M43 change gear ratio - 3
M44 change gear ratio - 4
M45 change gear ratio - 5
M46 change gear ratio - 6

M50 read spindle speed
M101 turn extruder on, forward (CW)
M102 turn extruder on, reverse (CCW)
M103 turn extruder off

M104 extruder temperature (Snnn) for tool (Tn)
M106 cooling fan on
M107 cooling fan off
M108 extruder speed (Snnn)
M109 heated platform temperature (Snnn) (Tn)

M131 (X Y Z A B) records current coordinates to the motherboard
M132 (X Y Z A B) recall stored home offsets for XYZAB axis

Unless otherwise stated, the content of this page is licensed under GNU Free Documentation License.