G-code Index

1.0.0-beta planner

G0, G1 - Linear Move

Add a straight line movement to the planner

1.0.0-beta planner

G2, G3 - Controlled Arc Move

Add an arc movement to the planner

1.0.0-beta planner

G4 - Dwell

Pause the planner

1.1.0 planner

G5 - Bézier cubic spline

Cubic B-spline with XYZE destination and IJPQ offsets

1.0.0-beta planner FWRETRACT

G10 - Retract

Retract the filament

1.0.0-beta planner FWRETRACT

G11 - Recover

Recover the filament with firmware-based retract.

1.1.0 nozzle NOZZLE_CLEAN_FEATURE

G12 - Clean the Nozzle

Perform the nozzle cleaning procedure.

geometry CNC_WORKSPACE_PLANES

G17, G18, G19 - CNC Workspace Planes

Select CNC workspace plane

1.1.0 units INCH_MODE_SUPPORT

G20 - Inch Units

Set Units to Inches.

1.1.0 units INCH_MODE_SUPPORT

G21 - Millimeter Units

Set Units to Millimeters.

1.1.0 calibration HAS_MESH G26_MESH_VALIDATION

G26 - Mesh Validation Pattern

Test the mesh and adjust.

1.1.0 nozzle NOZZLE_PARK_FEATURE

G27 - Park toolhead

Park the toolhead

calibration

G28 - Auto Home

Auto home one or more axes.

calibration AUTO_BED_LEVELING_(3POINT|LINEAR|BILINEAR)

G29 - Bed Leveling (Automatic)

Probe the bed and enable leveling compensation.

calibration MESH_BED_LEVELING

G29 - Bed Leveling (Manual)

Measure Z heights in a grid, enable leveling compensation

calibration AUTO_BED_LEVELING_UBL

G29 - Bed Leveling (Unified)

Probe the bed and enable leveling compensation.

1.0.0-beta calibration HAS_BED_PROBE

G30 - Single Z-Probe

Probe bed at current XY location

1.0.0-beta planner Z_PROBE_SLED

G31 - Dock Sled

Dock the Z probe sled.

1.0.0-beta planner Z_PROBE_SLED

G32 - Undock Sled

Undock the Z probe sled.

1.1.0 calibration DELTA_AUTO_CALIBRATION

G33 - Delta Auto Calibration

Calibrate various Delta parameters

calibration Z_STEPPER_AUTO_ALIGN

G34 - Z Steppers Auto-Alignment

Align multiple Z steppers using a bed probe

1.1.0 calibration G38_PROBE_TARGET

G38.2, G38.3 - Probe target

Probe towards a workpiece and stop on contact.

1.1.2 calibration HAS_MESH

G42 - Move to mesh coordinate

Move to a specific point in the leveling mesh

geometry CNC_COORDINATE_SYSTEMS

G53 - Move in Machine Coordinates

Apply native workspace to the current move.

geometry CNC_COORDINATE_SYSTEMS

G54, G55, G56, G57, G58, G59, G59.1, G59.2, G59.3 - Workspace Coordinate System

Select a workspace coordinate system

planner GCODE_MOTION_MODES

G80 - Cancel Current Motion Mode

Cancel the current motion mode

1.0.0-beta units

G90 - Absolute Positioning

Set the interpreter to absolute positions

1.0.0-beta units

G91 - Relative Positioning

Set the interpreter to relative positions

1.0.0-beta planner

G92 - Set Position

Set the current position of one or more axes.

calibration CALIBRATION_GCODE

G425 - Perform auto-calibration

Uses a calibration cube, washer or bolt for automatic calibration

1.0.0-beta planner

M0, M1 - Unconditional stop

Stop and wait for user.

1.1.2 control SPINDLE_LASER_ENABLE

M3 - Spindle CW / Laser On

Set the spindle CW speed or laser power

1.1.2 control SPINDLE_LASER_ENABLE

M4 - Spindle CCW / Laser On

Set the spindle CCW speed or laser power

1.1.2 control SPINDLE_LASER_ENABLE

M5 - Spindle / Laser Off

Turn off spindle or laser

2.0.0 safety EXPECTED_PRINTER_CHECK

M16 - Expected Printer Check

Prevent G-code usage on the wrong machine

control

M17 - Enable Steppers

Enable steppers

control

M18, M84 - Disable steppers

Disable steppers (same as M84).

sdcard SDSUPPORT

M20 - List SD Card

List the contents of the SD Card.

sdcard SDSUPPORT

M21 - Init SD card

Attempt to detect an SD card in the slot.

sdcard SDSUPPORT

M22 - Release SD card

Simulate ejection of the SD card

sdcard SDSUPPORT

M23 - Select SD file

Select an SD file to be executed

sdcard SDSUPPORT

M24 - Start or Resume SD print

Start or resume a file selected with `M23`

sdcard SDSUPPORT

M25 - Pause SD print

Pause printing from the SD card

sdcard SDSUPPORT

M26 - Set SD position

Set the SD read position

sdcard SDSUPPORT

M27 - Report SD print status

Print SD progress to serial

sdcard SDSUPPORT

M28 - Start SD write

Start writing to a file on the SD card

sdcard SDSUPPORT

M29 - Stop SD write

Stop writing the file, end logging.

sdcard

M30 - Delete SD file

Delete a specified file from SD.

printjob

M31 - Print time

Report the current print time.

sdcard SDSUPPORT

M32 - Select and Start

Begin an SD print from a file.

1.0.2 sdcard SDSUPPORT LONG_FILENAME_HOST_SUPPORT

M33 - Get Long Path

Convert a short pathname to a long pathname.

1.1.0 sdcard SDSUPPORT SDCARD_SORT_ALPHA

M34 - SDCard Sorting

Set SDCard file sorting options.

control

M42 - Set Pin State

Set an analog or digital pin to a specified state.

debug PINS_DEBUGGING

M43 T - Toggle Pins

Get information about pins.

debug PINS_DEBUGGING

M43 - Debug Pins

Get information about pins.

calibration Z_MIN_PROBE_REPEATABILITY_TEST

M48 - Probe Accuracy Test

Measure Z Probe repeatability.

1.1.7 lcd LCD_SET_PROGRESS_MANUALLY

M73 - Set Print Progress

Set current print progress percentage for LCD.

printjob

M75 - Start Print Job Timer

Start the print job timer.

printjob

M76 - Pause Print Job

Pause the print job timer.

printjob

M77 - Stop Print Job Timer

Stop the print job timer.

printjob PRINTCOUNTER

M78 - Print Job Stats

Print statistics about print jobs.

control PSU_CONTROL

M80 - Power On

Turn on the power supply.

control PSU_CONTROL

M81 - Power Off

Turn off the power supply.

units

M82 - E Absolute

Set E to absolute positioning.

units

M83 - E Relative

Set E to relative positioning.

control

M85 - Inactivity Shutdown

Set the inactivity timeout.

planner

M92 - Set Axis Steps-per-unit

Set the number of steps-per-mm or steps-per-inch.

debug M100_FREE_MEMORY_WATCHER

M100 - Free Memory

Description Here

thermal

M104 - Set Hotend Temperature

Set a new target hot end temperature.

thermal

M105 - Report Temperatures

Send a temperature report to the host.

thermal EXTRA_FAN_SPEED

M106 - Set Fan Speed

Turn on the fan and set its speed

thermal

M107 - Fan Off

Turn off a fan

control

M108 - Break and Continue

Break out of the current waiting loop

thermal

M109 - Wait for Hotend Temperature

Wait for the hot end to reach its target.

hosts

M110 - Set Line Number

Set the current line number.

hosts

M111 - Debug Level

Report and optionally set the debug flags.

safety

M112 - Emergency Stop

Shut everything down and halt the machine.

hosts HOST_KEEPALIVE_FEATURE

M113 - Host Keepalive

Get or set the host keepalive interval.

hosts

M114 - Get Current Position

Report the current tool position to the host.

hosts

M115 - Firmware Info

Print the firmware info and capabilities.

lcd ULTRA_LCD

M117 - Set LCD Message

Set the message line on the LCD.

hosts

M118 - Serial print

Send text to serial

debug

M119 - Endstop States

Report endstop and probe states to the host.

control

M120 - Enable Endstops

Enable endstops and keep them enabled when not homing.

control

M121 - Disable Endstops

Disable endstops and keep them enabled when not homing.

1.1.7 debug TMC2130|TMC2208|TMC2209

M122 - TMC Debugging

Get TMC Debug Info

nozzle PARK_HEAD_ON_PAUSE

M125 - Park Head

Save current position and move to filament change position.

baricuda BARICUDA

M126 - Baricuda 1 Open

Open the valve for Baricuda 1.

baricuda BARICUDA

M127 - Baricuda 1 Close

Close the valve for Baricuda 1.

baricuda BARICUDA

M128 - Baricuda 2 Open

Open the valve for Baricuda 2.

baricuda BARICUDA

M129 - Baricuda 2 Close

Close the valve for Baricuda 2.

thermal

M140 - Set Bed Temperature

Set a new target bed temperature.

thermal

M141 - Set Chamber Temperature

Set a new target chamber temperature.

lcd NEWPANEL

M145 - Set Material Preset

Set material presets in the LCD menu.

units

M149 - Set Temperature Units

Set temperature units to Celsius, Fahrenheit, or Kelvin.

lcd BLINKM|RGB_LED|RGBW_LED|NEOPIXEL_LED|PCA9632

M150 - Set RGB(W) Color

Set the color of the RGB(W) LED, backlight, or LED strip.

hosts AUTO_REPORT_TEMPERATURES EXTENDED_CAPABILITIES_REPORT

M155 - Temperature Auto-Report

Auto-report temperatures to host periodically.

mixing MIXING_EXTRUDER

M163 - Set Mix Factor

Set a single mix factor for a mixing extruder.

mixing MIXING_EXTRUDER MIXING_VIRTUAL_TOOLS

M164 - Save Mix

Save the current mix as a virtual tool.

mixing MIXING_EXTRUDER DIRECT_MIXING_IN_G1

M165 - Set Mix

Set all mix factors for the mixing extruder.

2.0.0 mixing MIXING_EXTRUDER GRADIENT_MIX

M166 - Gradient Mix

Set a Gradient Mix

thermal

M190 - Wait for Bed Temperature

Wait for the bed to reach target temperature.

thermal

M191 - Wait for Chamber Temperature

Wait for the chamber to reach target temperature.

planner

M200 - Set Filament Diameter

Set the diameter for volumetric extrusion.

planner

M201 - Set Print Max Acceleration

Set maximum acceleration for print moves one or more axes.

planner

M203 - Set Max Feedrate

Set maximum feedrate for one or more axes.

planner

M204 - Set Starting Acceleration

Set the starting acceleration for moves by type.

planner

M205 - Set Advanced Settings

Set some advanced settings related to movement.

planner HAS_HOME_OFFSET

M206 - Set Home Offsets

Description Here

planner FWRETRACT

M207 - Set Firmware Retraction

Set options for firmware-based retraction.

planner FWRETRACT

M208 - Firmware Recover

Firmware-retraction recover settings.

planner FWRETRACT

M209 - Set Auto Retract

Enable / disable auto-retraction.

planner (MIN|MAX)_SOFTWARE_ENDSTOPS

M211 - Software Endstops

Set and/or get the software endstops state

2.0.0 calibration EXTRUDERS > 1

M217 - Filament swap parameters

Set length and speed for filament swapping

calibration EXTRUDERS>1

M218 - Set Hotend Offset

Set the offset of a hotend (from hotend 0).

planner

M220 - Set Feedrate Percentage

Set the global feedrate percentage.

planner

M221 - Set Flow Percentage

Set the flow percentage, which applies to all E moves.

control

M226 - Wait for Pin State

Wait for a pin to have a given state.

extras PHOTO_GCODE

M240 - Trigger Camera

Trigger a camera shutter

lcd HAS_LCD_CONTRAST

M250 - LCD Contrast

Set and/or get the LCD contrast.

i2c EXPERIMENTAL_I2CBUS

M260 - I2C Send

Send data to the I2C bus.

i2c EXPERIMENTAL_I2CBUS

M261 - I2C Request

Request and echo bytes from the I2C bus.

servos NUM_SERVOS>0

M280 - Servo Position

Set or get a servo position.

1.1.7 calibration BABYSTEPPING

M290 - Babystep

Babystep one or more axes

lcd SPEAKER

M300 - Play Tone

Play a single tone, buzz, or beep.

thermal PIDTEMP

M301 - Set Hotend PID

Set PID values for a hotend.

thermal PREVENT_COLD_EXTRUSION

M302 - Cold Extrude

Set minimum extrusion temperature, allow cold extrusion.

thermal PIDTEMP|PIDTEMPBED

M303 - PID autotune

Auto-tune the PID system to find stable values.

thermal PIDTEMPBED

M304 - Set Bed PID

Set PID values for the heated bed.

control HAS_MICROSTEPS

M350 - Set micro-stepping

Set micro-stepping for drivers that support it

control HAS_MICROSTEPS

M351 - Set Microstep Pins

Directly set the micro-stepping pins

control CASE_LIGHT_PIN

M355 - Case Light Control

Turn the case light on or off, set brightness

control MORGAN_SCARA

M360 - SCARA Theta A

Move to Theta A

control MORGAN_SCARA

M361 - SCARA Theta-B

Move to Theta-B

control MORGAN_SCARA

M362 - SCARA Psi-A

Move to Psi-A

control MORGAN_SCARA

M363 - SCARA Psi-B

Move to Psi-B

control MORGAN_SCARA

M364 - SCARA Psi-C

Move to Psi-C

none EXT_SOLENOID

M380 - Activate Solenoid

Activate

none EXT_SOLENOID

M381 - Deactivate Solenoids

Deactivate all extruder solenoids

planner

M400 - Finish Moves

Wait for all moves to finish

calibration HAS_BED_PROBE

M401 - Deploy Probe

Deploy the bed probe

calibration HAS_BED_PROBE

M402 - Stow Probe

Stow the bed probe

control PRUSA_MMU2

M403 - MMU2 Filament Type

Set filament type for Multi-Material Unit 2.0

control FILAMENT_WIDTH_SENSOR

M404 - Set Filament Diameter

Set the nominal diameter for filament width sensor auto-flow

control FILAMENT_WIDTH_SENSOR

M405 - Filament Width Sensor On

Enable filament width sensor flow control

control FILAMENT_WIDTH_SENSOR

M406 - Filament Width Sensor Off

Disable filament width sensor flow control

control FILAMENT_WIDTH_SENSOR

M407 - Filament Width

Report the measured filament width

planner

M410 - Quickstop

Stop all steppers instantly

2.0.0 control FILAMENT_RUNOUT_SENSOR

M412 - Filament Runout

Enable / disable filament runout detection

2.0.0 control POWER_LOSS_RECOVERY

M413 - Power-loss Recovery

Enable / disable power-loss recovery

planner AUTO_BED_LEVELING_(3POINT|LINEAR|BILINEAR|UBL)|MESH_BED_LEVELING

M420 - Bed Leveling State

Get and/or set bed leveling state and fade height

planner AUTO_BED_LEVELING_(BILINEAR|UBL)|MESH_BED_LEVELING

M421 - Set Mesh Value

Set a single mesh Z height

calibration Z_STEPPER_AUTO_ALIGN

G34 - Z Steppers Auto-Alignment Parameter Selection

Set parameters for G34 Z Steppers Auto-Alignment

calibration BACKLASH_COMPENSATION BACKLASH_GCODE

M425 - Backlash compensation

Enable and tune backlash compensation

planner HAS_HOME_OFFSET

M428 - Home Offsets Here

Set home offsets based on current position

eeprom EEPROM_SETTINGS

M500 - Save Settings

Save settings to EEPROM.

eeprom EEPROM_SETTINGS

M501 - Restore Settings

Restore settings from EEPROM.

eeprom

M502 - Factory Reset

Restore all settings to factory defaults.

eeprom

M503 - Report Settings

Report all settings that may be saved to EEPROM.

eeprom EEPROM_SETTINGS

M504 - Validate EEPROM contents

Validate the contents of the EEPROM.

2.0.0 sdcard SDSUPPORT

M524 - Abort SD print

Abort an SD print started with `M24`

sdcard SDSUPPORT SD_ABORT_ON_ENDSTOP_HIT

M540 - Endstops Abort SD

Abort SD printing when an endstop is triggered.

2.0.0 none TMC2130|TMC2208|TMC2209

M569 - Set TMC stepping mode

Toggle stealthChop

2.0.0 hosts BAUD_RATE_GCODE

M575 - Serial baud rate

Change the serial baud rate

1.1.0 filament ADVANCED_PAUSE_FEATURE

M600 - Filament Change

Automatically change filament

1.1.0 filament ADVANCED_PAUSE_FEATURE

M603 - Configure Filament Change

Configure automatic filament change parameters

control DUAL_NOZZLE_DUPLICATION_MODE|DUAL_X_CARRIAGE

M605 - Dual Nozzle Mode

Set the behavior mode for dual nozzles

none MORGAN_SCARA|MAKERARM_SCARA

M665 - SCARA Configuration

Set SCARA geometry values

none DELTA

M665 - Delta Configuration

Set delta geometry values

calibration (X|Y|Z)_DUAL_ENDSTOPS

M666 - Set dual endstop offsets

Set dual endstop offsets

calibration DELTA

M666 - Set Delta endstop adjustments

Set Delta endstop adjustments

control NOZZLE_PARK_FEATURE ADVANCED_PAUSE_FEATURE FILAMENT_LOAD_UNLOAD_GCODES

M701 - Load filament

Load filament

control NOZZLE_PARK_FEATURE ADVANCED_PAUSE_FEATURE FILAMENT_LOAD_UNLOAD_GCODES

M702 - Unload filament

Unload filament

debug MAX7219_DEBUG

M7219 - MAX7219 Control

Control Max7219 Segmented LEDs

none HAS_BED_PROBE

M851 - XYZ Probe Offset

Set the Z probe XYZ offset from nozzle

calibration

M852 - Bed Skew Compensation

Misalignment in the XYZ axes.

control LIN_ADVANCE

M900 - Linear Advance Factor

Get and set Linear Advance K value

none TMC2130 TMC2208 TMC2660

M906 - TMC Motor Current

Set the motor current (in milliamps)

control DIGIPOTSS_PIN|HAS_MOTOR_CURRENT_PWM|DIGIPOT_I2C|DAC_STEPPER_CURRENT

M907 - Set Motor Current

Set motor current via digital trimpot

control DAC_STEPPER_CURRENT|DIGIPOTSS_PIN

M908 - Set Trimpot Pins

Set a digital trimpot directly

control DAC_STEPPER_CURRENT

M909 - DAC Print Values

Report DAC current values to host

control DAC_STEPPER_CURRENT

M910 - Commit DAC to EEPROM

Commit digipot/DAC value to external EEPROM

control TMC2130|TMC2208|TMC2209|TMC2660 MONITOR_DRIVER_STATUS

M911 - TMC OT Pre-Warn Condition

Driver overtemperature pre-warn condition

control TMC2130|TMC2208|TMC2209|TMC2660 MONITOR_DRIVER_STATUS

M912 - Clear TMC OT Pre-Warn

Clear overtemperature pre-warn condition flag

control TMC2130|TMC2208|TMC2209 HYBRID_THRESHOLD

M913 - Set Hybrid Threshold Speed

TMC driver switching to spreadCycle

control SENSORLESS_HOMING

M914 - TMC Bump Sensitivity

Set sensorless homing sensitivity

control TMC2130 TMC_Z_CALIBRATION

M915 - TMC Z axis calibration

Align ends of the Z axis and test torque

sdcard

M928 - Start SD Logging

Log serial input to an SD file

control

M999 - STOP Restart

Return the machine to Running state