Supported G-Codes

GCode Description Example                         
G0 Move to the given coordinates. To the contrary of G1, if there is a tool it will most of the time be off during this kind of move. This is a "go to" move rather than a "do while going to" move. The F parameter defines speed and is remembered by subsequent commands ( specified in millimetres/minute ) (command is modal) G0 X0 Y0 Z-400 F30000
G1 Move to the given coordinates, see above for difference with G0. Takes the same F parameter as G0. (command is modal) G1 X0 Y0 Z-400 F30000
G2 Clockwise circular motion : go to point with coordinates XYZ while rotating around point with relative coordinates IJ (command is not modal) G2 X10 J5
G3 Counter-clockwise motion : see above (command is not modal) G3 Y5 X10 I2
G4 Dwell S<seconds> or P<milliseconds> G4 P1000
G10 Do firmware extruder retract G10
G11 Do firmware extruder un-retract G11
G17 Select XYZ plane (command is modal) G17
G18 Select XZY plane (command is modal) G18
G19 Select YZX plane (command is modal) G19
G20 Inch mode : passed coordinates will be considered as Inches, so internally translated to millimeters (command is modal) G20
G21 Millimeter mode ( default ) : passed coordinates will be considered as millimeters (command is modal) G21
G30 Simple Z probe at current XY, reports distance moved down until probe triggers. optional F parameter defines the speed of probing, zprobe.slow_feedrate is used when not supplied G30 - G30 F100
G31 Report current Z probe status G31
G32 Uses Z probe to calibrate delta endstops and arm radius, use R parameter to select only arm radius calibration and E to select only endstop calibration. I to set target precision, J to set probe_radius, K to keep current endstop trim settings. In Zgrid module, it starts the grid probing G32 - G32 R - G32 E - G32 EK - G32 I0.02
G28 Home The given axis, or if no axis specified home all axis at the same time (edge) G28
G90 Absolute mode ( default ) : passed coordinates will be considered absolute ( relative to 0.0.0 ) (command is modal) G90
G91 Relative mode : passed coordinates will be considered relative to the current point (command is modal) G91
G92 Set current position to specified coordinates G92 X0 Y0 Z0
M3 Starts the spindle. Only if spindle module is enabled. The S parameter sets the speed in rotations per minute M3 S5000
M5 Stops the spindle Only if spindle module is enabled. M5
M17 Enable stepper motors M17
M18 Disable stepper motors M18
M20 List SD card files M20
M21 Initialize the SD card. This does nothing in Smoothie but is kept for compatibility M21
M23 Select a file M23 file.gcode
M24 Start or resume SD card print M24
M25 Pause SD card print M25
M26 Abort a SD card print M26
M27 Report print progress M27
M28 Begin write to SD card M28 file.gcode
M30 Delete a file on the SD card M30 file.gcode
M32 Select a file, and start playing it M32 file.gcode
M82 Set absolute mode for extruder only M82
M83 Set relative mode for extruder only M83
M84 Disable steppers M84
M92 Set axis steps per mm M92 E200
M104 Set Extruder Temperature - S<temperature> M104 S190
M105 Read current temp M105
M106 Turn fan ON M106
M107 Turn fan OFF M107
M109 Set Extruder Temperature and Wait - S<temperature> M109 S190
M110 Set current line number -N<line number> M110 N123
M112 Halt all operations, turn off heaters, go into Halt state M112
M114 Show current position of all axes, XYZ will be the last requested position, whereas ABC is actual current position of the actuators M114
M117 Display message on LCD, blank message will clear it M117 hello world or M117
M119 Show limit switch status M119
M120 "Push" the current feed-rate and seek-rate so that another one can be temporarily used, then the current one can be restored M120
M121 "Pop" the current feed-rate and seek-rate, see M120 M121
M140 Set Bed Temperature - S<temperature> M140 S55
M190 Set Bed Temperature and Wait - S<temperature> M190 S55
M200 Set E units for volumetric extrusion - D<filament diameter> set to 0 to disable volumetric extrusion M200 D3.0
M203 Set maximum feedrate your machine can sustain <mm/sec> M203 X100 Y100 Z100 E10
M204 S<acceleration> Set acceleration in mm/sec^2 Z<acceleration> NB Z only applies to Z only moves E<nnn> Set extruder only move acceleration M204 S1000 Z100 E500
M205 X<junction deviation> Z<z junction deviation> S<minimum planner speed>, Z junction deviation only applies to z only moves, 0 disables junction deviation for Z, -1 uses global junction deviation M205 X0.05 S30.0
M207 set retract length S[positive mm] F[feedrate mm/min] Z[additional zlift/hop] Q[zlift feedrate mm/min] M207 S4 F30 Z1
M208 set retract recover length S[positive mm surplus to the M207 S*] F[feedrate mm/min] M208 S0 F8
M220 S<factor in percent>- set speed factor override percentage M220 S50
M221 S<flow rate factor in percent>- set flow rate factor override percentage for current extruder M221 S50
M301 Edit temperature control PID parameters X<i_max> Y<max_pwm> M301 S0 P30 I10 D10 X255.0000 Y255
M303 Begin PID auto-tune cycle E<hotendid> S<temperature> M303 E0 S185 - Tune extruder - M303 E1 S100 - Tune printbed -
M304 Abort PID auto-tuning M304
M305 Set parameters for the thermistor, where B is beta, R is r0 and X is t0 M305 B4066
M360 Scara Morgan: Move to Theta 0 degree position. Adding P0 will save the current arm position as the Theta 0 degree position M360 or M360 P0
M361 Scara Morgan: Move to Theta 90 degree position. Adding P0 will save the current arm position as the Theta 90 degree position M361 or M360 P0
M364 Scara Morgan: M364: Move to Psi + Theta 90 degree position. Adding P0 will save the current arm position as the Psi + Theta 90 degree position M364 or M344 P0
M370 Z grid strategy: clears the ZGrid and the bed levelling is disabled until G32 is run again. Specify X and Y values to change grid size M370 X9 Y11
M371 Z grid strategy: moves the head to the next calibration position without saving for manual calibration M371
M372 Z grid strategy: move the head to the next calibration position after saving the current probe point to memory - manual calbration M372
M373 Z grid strategy: completes calibration and enables the Z compensation grid M373
M374 Z grid strategy: save calibration grid. optional S parameter saves a custom file with numerical extention M374 S123
M375 Z grid strategy: load calibration grid. optional S Parameter loads a pre saved custom grid M375 S123
M400 Wait for the queue to be empty before answering "OK" M400
M501 Load config-override file optionally specifying the extension M501 - loads config-override, M501 test1 - loads config-override.test1
M502 Delete the override file, reverting to config settings at next reset M502
M504 Save the settings to an override file with specified extension M504 test1 - saves to config-override.test1
M557 Defines probe points M557 P1 X30 Y40.5
M561 clears the plane and the bed leveling is disabled until G32 is run again M561
M565 defines the probe offsets from the nozzle or tool head M565 X3 Y4.5 Z-2.37
M600 Suspend print in progress (use console command resume to continue) M600
M700 On a Ragnar show encoder values S<number of samples> M700 or M700 S1000
M710 On a Ragnar calculate and set encoder zero points S<number of samples> M710 X0 Y0 Z-200 or M710 X0 Y0 Z-200 S1000
M720 On a Ragnar calculate current position from encoder values S<number of samples> M720 or M720 S1000
M740 Test encoder read operation, shows how many read operations it takes to get a valid value M740
M750 Test encoder diagnostics, shows AGC and magnetic field information for encoder chip, see AS5047 datasheet M750
M760 Set encoder monitor parameters S<enable> E<error_threshold> D<number_off_successive_errors> M760 S1 E2.5 D0
M790 Print belt encoders info; commands: E<encoder> select encoder S<state> enable/disable (1/0) encoder, T<encoder> activate trigger, J<encoder> print encoder values, F<filter value> set filter value M790 E1 S1, M790 J1
M907 Set Current control for each axis M907 X1.0 Y1.0 Z1.0 E1.5
M957 (with Spindle module enabled) Report the current spindle speed and PWM value M957
M958 (with Spindle module enabled) Report the current spindle PID parameters. M958 Px.xx Ix.xx Dx.xx will set them (to save the new values, you need to edit config file manually). M958 P0.1
M999 Reset from a halted state caused by limit switch, M112 or kill switch M999