mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2024-12-01 23:58:33 +00:00
Updated G Code in Marlin (mediawiki => markdown)
parent
592ec7f019
commit
f33814fafe
@ -7,156 +7,298 @@ G-Code (or GCode) is the instruction code that tells a RepRap 3D printer what to
|
|||||||
=== Movement ===
|
=== Movement ===
|
||||||
|
|
||||||
[[G0]] -> G1
|
[[G0]] -> G1
|
||||||
|
|
||||||
[[G1]] - Coordinated Movement X Y Z E
|
[[G1]] - Coordinated Movement X Y Z E
|
||||||
|
|
||||||
[[G2]] - Clockwise Arc
|
[[G2]] - Clockwise Arc
|
||||||
|
|
||||||
[[G3]] - Counter-clockwise Arc
|
[[G3]] - Counter-clockwise Arc
|
||||||
|
|
||||||
[[G4]] - Dwell S<seconds> or P<ms>
|
[[G4]] - Dwell S<seconds> or P<ms>
|
||||||
|
|
||||||
[[G92]] - Set the "current position" for X Y Z E
|
[[G92]] - Set the "current position" for X Y Z E
|
||||||
|
|
||||||
[[M0]] - Wait for user, with optional prompt message (requires LCD controller)
|
[[M0]] - Wait for user, with optional prompt message (requires LCD controller)
|
||||||
|
|
||||||
[[M1]] -> M0
|
[[M1]] -> M0
|
||||||
|
|
||||||
[[M400]] - Finish all moves
|
[[M400]] - Finish all moves
|
||||||
|
|
||||||
[[M999]] - Restart after an Emergency Stop
|
[[M999]] - Restart after an Emergency Stop
|
||||||
|
|
||||||
|
|
||||||
=== SD Card ===
|
=== SD Card ===
|
||||||
|
|
||||||
[[M20]] - List SD card
|
[[M20]] - List SD card
|
||||||
|
|
||||||
[[M21]] - Init SD card
|
[[M21]] - Init SD card
|
||||||
|
|
||||||
[[M22]] - Release SD card
|
[[M22]] - Release SD card
|
||||||
|
|
||||||
[[M23]] - Select an SD file by DOS path (M23 path/to/filename.g)
|
[[M23]] - Select an SD file by DOS path (M23 path/to/filename.g)
|
||||||
|
|
||||||
[[M24]] - Start/resume SD print
|
[[M24]] - Start/resume SD print
|
||||||
|
|
||||||
[[M25]] - Pause SD print
|
[[M25]] - Pause SD print
|
||||||
|
|
||||||
[[M26]] - Set SD position in bytes
|
[[M26]] - Set SD position in bytes
|
||||||
|
|
||||||
[[M27]] - Report SD print status
|
[[M27]] - Report SD print status
|
||||||
|
|
||||||
[[M28]] - Start SD write
|
[[M28]] - Start SD write
|
||||||
|
|
||||||
[[M29]] - Stop SD write
|
[[M29]] - Stop SD write
|
||||||
|
|
||||||
[[M30]] - Delete file from SD
|
[[M30]] - Delete file from SD
|
||||||
|
|
||||||
[[M31]] - Print the time since SD print started, or since the most recent [[M109]] command
|
[[M31]] - Print the time since SD print started, or since the most recent [[M109]] command
|
||||||
|
|
||||||
[[M32]] - Select file and start SD print. Can be used within G-Code files to include other files.
|
[[M32]] - Select file and start SD print. Can be used within G-Code files to include other files.
|
||||||
|
|
||||||
[[M540]] - Set the state of the [[Abort on Endstop Hit|ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED]] flag.
|
[[M540]] - Set the state of the [[Abort on Endstop Hit|ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED]] flag.
|
||||||
|
|
||||||
[[M928]] - Start SD logging. Stop logging with [[M29]].
|
[[M928]] - Start SD logging. Stop logging with [[M29]].
|
||||||
|
|
||||||
|
|
||||||
=== Hardware Control ===
|
=== Hardware Control ===
|
||||||
|
|
||||||
[[M42]] - Change pin status via gcode: P<pin> S<value>. If P is omitted the onboard LED pin will be used.
|
[[M42]] - Change pin status via gcode: P<pin> S<value>. If P is omitted the onboard LED pin will be used.
|
||||||
M42 P9 S1 ; set PIN 9 to 1.
|
M42 P9 S1 ; set PIN 9 to 1.
|
||||||
|
|
||||||
[[M80]] - Turn on Power Supply
|
[[M80]] - Turn on Power Supply
|
||||||
|
|
||||||
[[M81]] - Turn off Power Supply
|
[[M81]] - Turn off Power Supply
|
||||||
|
|
||||||
[[M85]] - Set inactivity shutdown timer with parameter S<seconds>. Disable with "M85" or "M85 S0".
|
[[M85]] - Set inactivity shutdown timer with parameter S<seconds>. Disable with "M85" or "M85 S0".
|
||||||
|
|
||||||
[[M112]] - Emergency stop. Requires hardware reset!!
|
[[M112]] - Emergency stop. Requires hardware reset!!
|
||||||
|
|
||||||
[[M226]] - Wait for a pin to be in some state: P<pin number> S<pin state>
|
[[M226]] - Wait for a pin to be in some state: P<pin number> S<pin state>
|
||||||
|
|
||||||
[[M410]] - Quickstop. Abort all planned moves, stopping the printer.
|
[[M410]] - Quickstop. Abort all planned moves, stopping the printer.
|
||||||
|
|
||||||
|
|
||||||
=== Temperature ===
|
=== Temperature ===
|
||||||
|
|
||||||
[[M104]] - Set extruder target temperature
|
[[M104]] - Set extruder target temperature
|
||||||
|
|
||||||
[[M105]] - Request the current temperature of all heaters
|
[[M105]] - Request the current temperature of all heaters
|
||||||
|
|
||||||
[[M106]] - Set the fan speed
|
[[M106]] - Set the fan speed
|
||||||
|
|
||||||
[[M107]] - Set the fan speed to 0 (thus turning it off)
|
[[M107]] - Set the fan speed to 0 (thus turning it off)
|
||||||
|
|
||||||
[[M109]] - Wait for an extruder to reach its target temperature. Optionally set the target temperature. Optionally enable [[AUTOTEMP]].
|
[[M109]] - Wait for an extruder to reach its target temperature. Optionally set the target temperature. Optionally enable [[AUTOTEMP]].
|
||||||
|
|
||||||
[[M140]] - Set heated bed target temperature
|
[[M140]] - Set heated bed target temperature
|
||||||
|
|
||||||
[[M145]] - Set "heatup state" values for the LCD Menu
|
[[M145]] - Set "heatup state" values for the LCD Menu
|
||||||
|
|
||||||
[[M190]] - Wait for the heated bed to reach its target temperature. Optionally set the target temperature.
|
[[M190]] - Wait for the heated bed to reach its target temperature. Optionally set the target temperature.
|
||||||
|
|
||||||
[[M301]] - Set PID parameters P I and D
|
[[M301]] - Set PID parameters P I and D
|
||||||
|
|
||||||
[[M302]] - Allow cold extrudes, or set the minimum extrusion temperature
|
[[M302]] - Allow cold extrudes, or set the minimum extrusion temperature
|
||||||
|
|
||||||
[[M303]] - PID relay autotune S<temperature> sets the target temperature. (default target temperature = 150C)
|
[[M303]] - PID relay autotune S<temperature> sets the target temperature. (default target temperature = 150C)
|
||||||
|
|
||||||
[[M304]] - Set bed PID parameters P I and D
|
[[M304]] - Set bed PID parameters P I and D
|
||||||
|
|
||||||
|
|
||||||
=== Messages ===
|
=== Messages ===
|
||||||
|
|
||||||
[[M111]] - Set debug flags
|
[[M111]] - Set debug flags
|
||||||
|
|
||||||
[[M114]] - Output current position to serial port
|
[[M114]] - Output current position to serial port
|
||||||
|
|
||||||
[[M115]] - Capabilities string
|
[[M115]] - Capabilities string
|
||||||
|
|
||||||
[[M117]] - Display message text on the LCD
|
[[M117]] - Display message text on the LCD
|
||||||
|
|
||||||
[[M119]] - Output Endstop status to serial port
|
[[M119]] - Output Endstop status to serial port
|
||||||
|
|
||||||
|
|
||||||
=== Endstops ===
|
=== Endstops ===
|
||||||
|
|
||||||
[[M120]] - Enable endstop detection
|
[[M120]] - Enable endstop detection
|
||||||
|
|
||||||
[[M121]] - Disable endstop detection
|
[[M121]] - Disable endstop detection
|
||||||
|
|
||||||
|
|
||||||
=== Special Features ===
|
=== Special Features ===
|
||||||
|
|
||||||
[[M126]] - Solenoid Air Valve Open. (Requires [[BARICUDA]])
|
[[M126]] - Solenoid Air Valve Open. (Requires [[BARICUDA]])
|
||||||
|
|
||||||
[[M127]] - Solenoid Air Valve Closed. (Requires [[BARICUDA]])
|
[[M127]] - Solenoid Air Valve Closed. (Requires [[BARICUDA]])
|
||||||
|
|
||||||
[[M128]] - EtoP Open. (Requires [[BARICUDA]])
|
[[M128]] - EtoP Open. (Requires [[BARICUDA]])
|
||||||
|
|
||||||
[[M129]] - EtoP Closed. (Requires [[BARICUDA]])
|
[[M129]] - EtoP Closed. (Requires [[BARICUDA]])
|
||||||
|
|
||||||
[[M150]] - Set BlinkM RGB Color via I2C. (Requires [[BLINKM]])
|
[[M150]] - Set BlinkM RGB Color via I2C. (Requires [[BLINKM]])
|
||||||
|
|
||||||
[[M240]] - Trigger a camera to take a photograph. (Requires [[CHDK]] or [[PHOTOGRAPH_PIN]])
|
[[M240]] - Trigger a camera to take a photograph. (Requires [[CHDK]] or [[PHOTOGRAPH_PIN]])
|
||||||
|
|
||||||
[[M250]] - Set LCD contrast
|
[[M250]] - Set LCD contrast
|
||||||
|
|
||||||
[[M280]] - Set servo position (absolute)
|
[[M280]] - Set servo position (absolute)
|
||||||
|
|
||||||
[[M300]] - Play a beep sound. (Requires [[BEEPER_PIN]] or [[LCD_USE_I2C_BUZZER]])
|
[[M300]] - Play a beep sound. (Requires [[BEEPER_PIN]] or [[LCD_USE_I2C_BUZZER]])
|
||||||
|
|
||||||
[[M380]] - Activate solenoid on active extruder. (Requires [[EXT_SOLENOID]])
|
[[M380]] - Activate solenoid on active extruder. (Requires [[EXT_SOLENOID]])
|
||||||
|
|
||||||
[[M381]] - Disable all solenoids. (Requires [[EXT_SOLENOID]])
|
[[M381]] - Disable all solenoids. (Requires [[EXT_SOLENOID]])
|
||||||
|
|
||||||
[[M600]] - Pause for filament change. (Requires [[FILAMENTCHANGEENABLE]])
|
[[M600]] - Pause for filament change. (Requires [[FILAMENTCHANGEENABLE]])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
=== Units and Measures ===
|
=== Units and Measures ===
|
||||||
|
|
||||||
[[G90]] - Use Absolute Coordinates
|
[[G90]] - Use Absolute Coordinates
|
||||||
|
|
||||||
[[G91]] - Use Relative Coordinates
|
[[G91]] - Use Relative Coordinates
|
||||||
|
|
||||||
[[M82]] - Set E codes absolute (default)
|
[[M82]] - Set E codes absolute (default)
|
||||||
|
|
||||||
[[M83]] - Set E codes relative while in Absolute Coordinates (G90) mode
|
[[M83]] - Set E codes relative while in Absolute Coordinates (G90) mode
|
||||||
|
|
||||||
[[M92]] - Set axis_steps_per_unit - same syntax as G92
|
[[M92]] - Set axis_steps_per_unit - same syntax as G92
|
||||||
|
|
||||||
[[M200]] - Set filament diameter and E axis units to mm^3
|
[[M200]] - Set filament diameter and E axis units to mm^3
|
||||||
|
|
||||||
[[M201]] - Set max acceleration in units/s^2 for print moves (M201 X1000 Y1000)
|
[[M201]] - Set max acceleration in units/s^2 for print moves (M201 X1000 Y1000)
|
||||||
|
|
||||||
[[M202]] - Set max acceleration in units/s^2 for travel moves (M202 X1000 Y1000) Unused in Marlin!!
|
[[M202]] - Set max acceleration in units/s^2 for travel moves (M202 X1000 Y1000) Unused in Marlin!!
|
||||||
|
|
||||||
[[M203]] - Set maximum feedrate that your machine can sustain (M203 X200 Y200 Z300 E10000) in mm/sec
|
[[M203]] - Set maximum feedrate that your machine can sustain (M203 X200 Y200 Z300 E10000) in mm/sec
|
||||||
[[M204]] - Set default acceleration: P for Printing moves, R for Retract only (no X, Y, Z) moves and T for Travel (non printing) moves (ex. M204 P800 T3000 R9000) in mm/sec^2
|
|
||||||
|
[[M204]] - Set default acceleration: P for Printing moves, R for Retract only (no X, Y, Z) moves and T for Travel
|
||||||
|
(non printing) moves (ex. M204 P800 T3000 R9000) in mm/sec^2
|
||||||
|
|
||||||
[[M205]] - Advanced settings: minimum travel speed S=while printing T=travel only, B=minimum segment time X=maximum xy jerk, Z=maximum Z jerk, E=maximum E jerk
|
[[M205]] - Advanced settings: minimum travel speed S=while printing T=travel only, B=minimum segment time X=maximum xy jerk, Z=maximum Z jerk, E=maximum E jerk
|
||||||
|
|
||||||
[[M206]] - Set additional homing offset
|
[[M206]] - Set additional homing offset
|
||||||
|
|
||||||
[[M218]] - Set hotend offset (in mm): T<extruder_number> X<offset_on_X> Y<offset_on_Y>
|
[[M218]] - Set hotend offset (in mm): T<extruder_number> X<offset_on_X> Y<offset_on_Y>
|
||||||
|
|
||||||
[[M220]] - Set speed factor override percentage: S<factor in percent>
|
[[M220]] - Set speed factor override percentage: S<factor in percent>
|
||||||
|
|
||||||
[[M221]] - Set extrude factor override percentage: S<factor in percent>
|
[[M221]] - Set extrude factor override percentage: S<factor in percent>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
=== Firmware Retraction ===
|
=== Firmware Retraction ===
|
||||||
|
|
||||||
[[G10]] - Retract filament according to settings of M207
|
[[G10]] - Retract filament according to settings of M207
|
||||||
|
|
||||||
[[G11]] - Retract recover filament according to settings of M208
|
[[G11]] - Retract recover filament according to settings of M208
|
||||||
[[M207]] - Set retract length S[positive mm] F[feedrate mm/min] Z[additional zlift/hop], stays in mm regardless of M200 setting
|
|
||||||
|
[[M207]] - Set retract length S[positive mm] F[feedrate mm/min] Z[additional zlift/hop], stays in mm regardless
|
||||||
|
of M200 setting
|
||||||
|
|
||||||
[[M208]] - Set recover=unretract length S[positive mm surplus to the M207 S*] F[feedrate mm/s]
|
[[M208]] - Set recover=unretract length S[positive mm surplus to the M207 S*] F[feedrate mm/s]
|
||||||
[[M209]] - S<1=true/0=false> enable automatic retract detect if the slicer did not support G10/11: every normal extrude-only move will be classified as retract depending on the direction
|
|
||||||
|
[[M209]] - S<1=true/0=false> enable automatic retract detect if the slicer did not support G10/11: every normal
|
||||||
|
extrude-only move will be classified as retract depending on the direction
|
||||||
|
|
||||||
|
|
||||||
=== Z Probe ===
|
=== Z Probe ===
|
||||||
|
|
||||||
[[G28]] - Home one or more axes.
|
[[G28]] - Home one or more axes.
|
||||||
|
|
||||||
[[G29]] - Probe the bed Z height at multiple points and enable bed leveling compensation.
|
[[G29]] - Probe the bed Z height at multiple points and enable bed leveling compensation.
|
||||||
|
|
||||||
[[G30]] - Probe the bed Z height at the current XY position.
|
[[G30]] - Probe the bed Z height at the current XY position.
|
||||||
|
|
||||||
[[G31]] - Dock Z Probe sled.
|
[[G31]] - Dock Z Probe sled.
|
||||||
|
|
||||||
[[G32]] - Undock Z Probe sled.
|
[[G32]] - Undock Z Probe sled.
|
||||||
|
|
||||||
[[M48]] - Measure Z Probe repeatability.
|
[[M48]] - Measure Z Probe repeatability.
|
||||||
|
|
||||||
[[M401]] - Lower Z-probe.
|
[[M401]] - Lower Z-probe.
|
||||||
|
|
||||||
[[M402]] - Raise Z-probe.
|
[[M402]] - Raise Z-probe.
|
||||||
|
|
||||||
[[M420]] - Enable or disable Mesh Bed Leveling.
|
[[M420]] - Enable or disable Mesh Bed Leveling.
|
||||||
|
|
||||||
[[M421]] - Set a single Mesh Bed Leveling Z coordinate: X<pos> Y<pos> Z<pos>
|
[[M421]] - Set a single Mesh Bed Leveling Z coordinate: X<pos> Y<pos> Z<pos>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
=== Filament Diameter ===
|
=== Filament Diameter ===
|
||||||
|
|
||||||
[[M404]] - Set (or display) Nominal Filament Diameter in mm: [N<diameter>] (e.g., 3mm or 1.75mm)
|
[[M404]] - Set (or display) Nominal Filament Diameter in mm: [N<diameter>] (e.g., 3mm or 1.75mm)
|
||||||
|
|
||||||
[[M405]] - Turn on Filament Sensor extrusion control: [D<distance>] to set distance (in cm) from sensor to extruder
|
[[M405]] - Turn on Filament Sensor extrusion control: [D<distance>] to set distance (in cm) from sensor to extruder
|
||||||
|
|
||||||
[[M406]] - Turn off Filament Sensor extrusion control
|
[[M406]] - Turn off Filament Sensor extrusion control
|
||||||
|
|
||||||
[[M407]] - Display measured Filament Diameter
|
[[M407]] - Display measured Filament Diameter
|
||||||
|
|
||||||
|
|
||||||
=== EEPROM Settings ===
|
=== EEPROM Settings ===
|
||||||
|
|
||||||
[[M500]] - Save current settings to EEPROM.
|
[[M500]] - Save current settings to EEPROM.
|
||||||
|
|
||||||
[[M501]] - Load stored settings from EEPROM.
|
[[M501]] - Load stored settings from EEPROM.
|
||||||
|
|
||||||
[[M502]] - Revert to the default "factory settings." '''''Does not store them in EEPROM!'''''
|
[[M502]] - Revert to the default "factory settings." '''''Does not store them in EEPROM!'''''
|
||||||
|
|
||||||
[[M503]] - Print current settings (from memory, not EEPROM).
|
[[M503]] - Print current settings (from memory, not EEPROM).
|
||||||
|
|
||||||
|
|
||||||
=== Delta ===
|
=== Delta ===
|
||||||
|
|
||||||
[[M665]] - Set Delta configurations: L<diagonal rod> R<delta radius> S<segments/s>
|
[[M665]] - Set Delta configurations: L<diagonal rod> R<delta radius> S<segments/s>
|
||||||
|
|
||||||
[[M666]] - Set Delta endstop adjustment: X<x-adjustment> Y<y-adjustment> Z<z-adjustment>
|
[[M666]] - Set Delta endstop adjustment: X<x-adjustment> Y<y-adjustment> Z<z-adjustment>
|
||||||
|
|
||||||
[[M605]] - Set dual x-carriage movement mode: S<mode> [ X<duplication x-offset> R<duplication temp offset> ]
|
[[M605]] - Set dual x-carriage movement mode: S<mode> [ X<duplication x-offset> R<duplication temp offset> ]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
=== Stepper Drivers ===
|
=== Stepper Drivers ===
|
||||||
|
|
||||||
[[M17]] - Enable/Power all stepper motors
|
[[M17]] - Enable/Power all stepper motors
|
||||||
|
|
||||||
[[M18]] -> [[M84]]
|
[[M18]] -> [[M84]]
|
||||||
|
|
||||||
[[M84]] - Disable steppers until the next move, or set the inactivity timeout after which steppers should be disabled.
|
[[M84]] - Disable steppers until the next move, or set the inactivity timeout after which steppers should be disabled.
|
||||||
|
|
||||||
[[M907]] - Set digital trimpot motor current using axis codes.
|
[[M907]] - Set digital trimpot motor current using axis codes.
|
||||||
|
|
||||||
[[M908]] - Control digital trimpot directly.
|
[[M908]] - Control digital trimpot directly.
|
||||||
|
|
||||||
[[M350]] - Set microstepping mode.
|
[[M350]] - Set microstepping mode.
|
||||||
|
|
||||||
[[M351]] - Toggle MS1 MS2 pins directly to set microstepping.
|
[[M351]] - Toggle MS1 MS2 pins directly to set microstepping.
|
||||||
|
|
||||||
|
|
||||||
=== SCARA ===
|
=== SCARA ===
|
||||||
|
|
||||||
''May change to suit future G-code standards''
|
''May change to suit future G-code standards''
|
||||||
|
|
||||||
[[M360]] - SCARA calibration: Move to cal-position ThetaA (0 deg calibration)
|
[[M360]] - SCARA calibration: Move to cal-position ThetaA (0 deg calibration)
|
||||||
|
|
||||||
[[M361]] - SCARA calibration: Move to cal-position ThetaB (90 deg calibration - steps per degree)
|
[[M361]] - SCARA calibration: Move to cal-position ThetaB (90 deg calibration - steps per degree)
|
||||||
|
|
||||||
[[M362]] - SCARA calibration: Move to cal-position PsiA (0 deg calibration)
|
[[M362]] - SCARA calibration: Move to cal-position PsiA (0 deg calibration)
|
||||||
|
|
||||||
[[M363]] - SCARA calibration: Move to cal-position PsiB (90 deg calibration - steps per degree)
|
[[M363]] - SCARA calibration: Move to cal-position PsiB (90 deg calibration - steps per degree)
|
||||||
|
|
||||||
[[M364]] - SCARA calibration: Move to cal-position PSIC (90 deg to Theta calibration position)
|
[[M364]] - SCARA calibration: Move to cal-position PSIC (90 deg to Theta calibration position)
|
||||||
|
|
||||||
[[M365]] - SCARA calibration: Scaling factor, X, Y, Z axis
|
[[M365]] - SCARA calibration: Scaling factor, X, Y, Z axis
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
=== Host Printing ===
|
=== Host Printing ===
|
||||||
|
|
||||||
[[M110]] - Set the current Line Number
|
[[M110]] - Set the current Line Number
|
||||||
|
|
||||||
|
|
||||||
== G-Code Comments ==
|
== G-Code Comments ==
|
||||||
|
|
||||||
Comments start at a <code>;</code> (semicolon) and end with the end of the line:
|
Comments start at a <code>;</code> (semicolon) and end with the end of the line:
|
Loading…
Reference in New Issue
Block a user