|
@@ -8,10 +8,10 @@ G1 - Coordinated Movement X Y Z E
|
8
|
8
|
G2 - CW ARC
|
9
|
9
|
G3 - CCW ARC
|
10
|
10
|
G4 - Dwell S[seconds] or P[milliseconds]
|
11
|
|
-G10 - retract filament according to settings of M207
|
12
|
|
-G11 - retract recover filament according to settings of M208
|
|
11
|
+G10 - Retract filament according to settings of M207
|
|
12
|
+G11 - Retract recover filament according to settings of M208
|
13
|
13
|
G28 - Home all Axis
|
14
|
|
-G29 - Detailed Z-Probe, probes the bed at 3 points. You must be at the home position for this to work correctly.
|
|
14
|
+G29 - Detailed Z-Probe, probes the bed at 3 or more points. The printer must be homed with G28 before G29.
|
15
|
15
|
G30 - Single Z Probe, probes bed at current XY location.
|
16
|
16
|
G31 - Dock Z Probe sled (if enabled)
|
17
|
17
|
G32 - Undock Z Probe sled (if enabled)
|
|
@@ -19,12 +19,16 @@ G90 - Use Absolute Coordinates
|
19
|
19
|
G91 - Use Relative Coordinates
|
20
|
20
|
G92 - Set current position to cordinates given
|
21
|
21
|
```
|
22
|
|
-## M Codes
|
|
22
|
+## Movement M Codes
|
23
|
23
|
```
|
24
|
|
-M0 - Unconditional stop - Wait for user to press a button on the LCD (Only if ULTRA_LCD is enabled)
|
|
24
|
+M0 - Wait for user, with optional prompt message (to press the LCD button, requires ULTRA_LCD)
|
|
25
|
+ M0 Click When Ready ; show "Click When Ready" until the button is pressed.
|
25
|
26
|
M1 - Same as M0
|
26
|
|
-M17 - Enable/Power all stepper motors
|
27
|
|
-M18 - Disable all stepper motors; same as M84
|
|
27
|
+M400 - Finish all moves
|
|
28
|
+M999 - Restart after being stopped by error
|
|
29
|
+```
|
|
30
|
+### SD Card M Codes
|
|
31
|
+```
|
28
|
32
|
M20 - List SD card
|
29
|
33
|
M21 - Init SD card
|
30
|
34
|
M22 - Release SD card
|
|
@@ -41,16 +45,24 @@ M32 - Select file and start SD print (Can be used _while_ printing from SD card
|
41
|
45
|
syntax "M32 /path/filename#", or "M32 S<startpos bytes> !filename#"
|
42
|
46
|
Call gcode file : "M32 P !filename#" and return to caller file after finishing (similar to #include).
|
43
|
47
|
The '#' is necessary when calling from within sd files, as it stops buffer prereading
|
44
|
|
-M42 - Change pin status via gcode Use M42 Px Sy to set pin x to value y, when omitting Px the onboard led will be used.
|
45
|
|
-M48 - Measure Z_Probe repeatability. M48 [n # of points] [X position] [Y position] [V_erboseness #] [E_ngage Probe] [L # of legs of travel]
|
|
48
|
+M540 - Enable/Disable "Stop SD Print on Endstop Hit" (req. ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
|
|
49
|
+ M540 S<0|1>
|
|
50
|
+M928 - Start SD logging (M928 filename.g) - ended by M29
|
|
51
|
+```
|
|
52
|
+### Hardware Control
|
|
53
|
+```
|
|
54
|
+M42 - Change pin status via gcode: P<pin> S<value>. If P is omitted the onboard LED pin will be used.
|
|
55
|
+ M42 P9 S1 ; set PIN 9 to 1.
|
46
|
56
|
M80 - Turn on Power Supply
|
47
|
57
|
M81 - Turn off Power Supply
|
48
|
|
-M82 - Set E codes absolute (default)
|
49
|
|
-M83 - Set E codes relative while in Absolute Coordinates (G90) mode
|
50
|
58
|
M84 - Disable steppers until next move,
|
51
|
59
|
or use S<seconds> to specify an inactivity timeout, after which the steppers will be disabled. S0 to disable the timeout.
|
52
|
60
|
M85 - Set inactivity shutdown timer with parameter S<seconds>. To disable set zero (default)
|
53
|
|
-M92 - Set axis_steps_per_unit - same syntax as G92
|
|
61
|
+M112 - Emergency stop. Requires hardware reset!!
|
|
62
|
+M226 - Wait for a pin to be in some state: P<pin number> S<pin state>
|
|
63
|
+```
|
|
64
|
+### Temperature M Codes
|
|
65
|
+```
|
54
|
66
|
M104 - Set extruder target temp
|
55
|
67
|
M105 - Read current temp
|
56
|
68
|
M106 - Fan on
|
|
@@ -58,67 +70,101 @@ M107 - Fan off
|
58
|
70
|
M109 - Sxxx Wait for extruder current temp to reach target temp. Waits only when heating
|
59
|
71
|
Rxxx Wait for extruder current temp to reach target temp. Waits when heating and cooling
|
60
|
72
|
IF AUTOTEMP is enabled, S<mintemp> B<maxtemp> F<factor>. Exit autotemp by any M109 without F
|
61
|
|
-M112 - Emergency stop
|
|
73
|
+M140 - Set bed target temp
|
|
74
|
+M190 - Sxxx Wait for bed current temp to reach target temp. Waits only when heating
|
|
75
|
+ Rxxx Wait for bed current temp to reach target temp. Waits when heating and cooling
|
|
76
|
+M301 - Set PID parameters P I and D
|
|
77
|
+M302 - Allow cold extrudes, or set the minimum extrude S<temperature>.
|
|
78
|
+M303 - PID relay autotune S<temperature> sets the target temperature. (default target temperature = 150C)
|
|
79
|
+M304 - Set bed PID parameters P I and D
|
|
80
|
+```
|
|
81
|
+### Message M Codes
|
|
82
|
+```
|
62
|
83
|
M114 - Output current position to serial port
|
63
|
84
|
M115 - Capabilities string
|
64
|
|
-M117 - display message
|
|
85
|
+M117 - Display message text on the LCD
|
65
|
86
|
M119 - Output Endstop status to serial port
|
|
87
|
+```
|
|
88
|
+### Endstops M Codes
|
|
89
|
+```
|
66
|
90
|
M120 - Enable endstop detection
|
67
|
91
|
M121 - Disable endstop detection
|
|
92
|
+```
|
|
93
|
+### Special Features M Codes
|
|
94
|
+```
|
68
|
95
|
M126 - Solenoid Air Valve Open (BariCUDA support by jmil)
|
69
|
96
|
M127 - Solenoid Air Valve Closed (BariCUDA vent to atmospheric pressure by jmil)
|
70
|
97
|
M128 - EtoP Open (BariCUDA EtoP = electricity to air pressure transducer by jmil)
|
71
|
98
|
M129 - EtoP Closed (BariCUDA EtoP = electricity to air pressure transducer by jmil)
|
72
|
|
-M140 - Set bed target temp
|
73
|
|
-M150 - Set BlinkM Color Output R: Red<0-255> U(!): Green<0-255> B: Blue<0-255> over i2c, G for green does not work.
|
74
|
|
-M190 - Sxxx Wait for bed current temp to reach target temp. Waits only when heating
|
75
|
|
- Rxxx Wait for bed current temp to reach target temp. Waits when heating and cooling
|
76
|
|
-M200 - set filament diameter and set E axis units to cubic millimeters (use S0 to set back to millimeters).: D<millimeters>-
|
|
99
|
+M150 - Set BlinkM Color: R<red> U<green> B<blue> via I2C. Range: 0-255
|
|
100
|
+M240 - Trigger a camera to take a photograph. (Add to your per-layer GCode.)
|
|
101
|
+M250 - Set LCD contrast: C<0-63>
|
|
102
|
+M280 - Set servo position absolute. P<servo index> S<angle or microseconds>
|
|
103
|
+M300 - Play beep sound S<frequency Hz> P<duration ms>
|
|
104
|
+M380 - Activate solenoid on active extruder
|
|
105
|
+M381 - Disable all solenoids
|
|
106
|
+M600 - Pause for filament change X<xpos> Y<ypos> Z<lift> E<initial retract> L<later retract for removal>
|
|
107
|
+```
|
|
108
|
+### Units and Measures M Codes
|
|
109
|
+```
|
|
110
|
+M82 - Set E codes absolute (default)
|
|
111
|
+M83 - Set E codes relative while in Absolute Coordinates (G90) mode
|
|
112
|
+M92 - Set axis_steps_per_unit - same syntax as G92
|
|
113
|
+M200 - Set filament diameter and set E axis units to mm^3 (use S0 to set back to mm).: D<mm>
|
77
|
114
|
M201 - Set max acceleration in units/s^2 for print moves (M201 X1000 Y1000)
|
78
|
115
|
M202 - Set max acceleration in units/s^2 for travel moves (M202 X1000 Y1000) Unused in Marlin!!
|
79
|
116
|
M203 - Set maximum feedrate that your machine can sustain (M203 X200 Y200 Z300 E10000) in mm/sec
|
80
|
117
|
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
|
81
|
|
-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
|
|
118
|
+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
|
82
|
119
|
M206 - Set additional homing offset
|
83
|
|
-M207 - Set retract length S[positive mm] F[feedrate mm/min] Z[additional zlift/hop], stays in mm regardless of M200 setting
|
84
|
|
-M208 - Set recover=unretract length S[positive mm surplus to the M207 S*] F[feedrate mm/sec]
|
85
|
|
-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.
|
86
|
120
|
M218 - Set hotend offset (in mm): T<extruder_number> X<offset_on_X> Y<offset_on_Y>
|
87
|
121
|
M220 - Set speed factor override percentage: S<factor in percent>
|
88
|
122
|
M221 - Set extrude factor override percentage: S<factor in percent>
|
89
|
|
-M226 - Wait until the specified pin reaches the state required: P<pin number> S<pin state>
|
90
|
|
-M240 - Trigger a camera to take a photograph
|
91
|
|
-M250 - Set LCD contrast C<contrast value> (value 0..63)
|
92
|
|
-M280 - Set servo position absolute. P: servo index, S: angle or microseconds
|
93
|
|
-M300 - Play beep sound S<frequency Hz> P<duration ms>
|
94
|
|
-M301 - Set PID parameters P I and D
|
95
|
|
-M302 - Allow cold extrudes, or set the minimum extrude S<temperature>.
|
96
|
|
-M303 - PID relay autotune S<temperature> sets the target temperature. (default target temperature = 150C)
|
97
|
|
-M304 - Set bed PID parameters P I and D
|
98
|
|
-M380 - Activate solenoid on active extruder
|
99
|
|
-M381 - Disable all solenoids
|
100
|
|
-M400 - Finish all moves
|
101
|
|
-M401 - Lower z-probe if present
|
102
|
|
-M402 - Raise z-probe if present
|
103
|
|
-M404 - N<dia in mm> Enter the nominal filament width (3mm, 1.75mm ) or will display nominal filament width without parameters
|
104
|
|
-M405 - Turn on Filament Sensor extrusion control. Optional D<delay in cm> to set delay in centimeters between sensor and extruder
|
|
123
|
+```
|
|
124
|
+### Firmware Retraction M Codes
|
|
125
|
+```
|
|
126
|
+M207 - Set retract length S[positive mm] F[feedrate mm/min] Z[additional zlift/hop], stays in mm regardless of M200 setting
|
|
127
|
+M208 - Set recover=unretract length S[positive mm surplus to the M207 S*] F[feedrate mm/s]
|
|
128
|
+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
|
|
129
|
+```
|
|
130
|
+### Z Probe M Codes
|
|
131
|
+```
|
|
132
|
+M48 - Measure Z_Probe repeatability: P<points> X<xpos> Y<ypos> V<verbosity> E=engage L<legs of travel>
|
|
133
|
+ As with G29, the E flag causes the probe to stow after each probe.
|
|
134
|
+M401 - Lower Z-probe (if present)
|
|
135
|
+M402 - Raise Z-probe (if present)
|
|
136
|
+```
|
|
137
|
+### Filament Diameter M Codes
|
|
138
|
+```
|
|
139
|
+M404 - Set (or display) Nominal Filament Diameter in mm: [N<diameter>] (e.g., 3mm or 1.75mm)
|
|
140
|
+M405 - Turn on Filament Sensor extrusion control: [D<distance>] to set distance (in cm) from sensor to extruder
|
105
|
141
|
M406 - Turn off Filament Sensor extrusion control
|
106
|
|
-M407 - Display measured filament diameter
|
|
142
|
+M407 - Display measured Filament Diameter
|
|
143
|
+```
|
|
144
|
+### EEPROM Settings M Codes
|
|
145
|
+```
|
107
|
146
|
M500 - Store parameters in EEPROM
|
108
|
147
|
M501 - Read parameters from EEPROM (if you need reset them after you changed them temporarily).
|
109
|
148
|
M502 - Revert to the default "factory settings". You still need to store them in EEPROM afterwards if you want to.
|
110
|
149
|
M503 - Print the current settings (from memory not from EEPROM). Use S0 to leave off headings.
|
111
|
|
-M540 - Use S[0|1] to enable or disable the stop SD card print on endstop hit (requires ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
|
112
|
|
-M600 - Pause for filament change X[pos] Y[pos] Z[relative lift] E[initial retract] L[later retract distance for removal]
|
113
|
|
-M665 - Set delta configurations
|
114
|
|
-M666 - Set delta endstop adjustment
|
|
150
|
+```
|
|
151
|
+### Delta M Codes
|
|
152
|
+```
|
|
153
|
+M665 - Set Delta configurations: L<diagonal rod> R<delta radius> S<segments/s>
|
|
154
|
+M666 - Set Delta endstop adjustment: X<x-adjustment> Y<y-adjustment> Z<z-adjustment>
|
115
|
155
|
M605 - Set dual x-carriage movement mode: S<mode> [ X<duplication x-offset> R<duplication temp offset> ]
|
|
156
|
+```
|
|
157
|
+### Stepper Driver M Codes
|
|
158
|
+```
|
|
159
|
+M17 - Enable/Power all stepper motors
|
|
160
|
+M18 - Disable all stepper motors. (same as M84)
|
116
|
161
|
M907 - Set digital trimpot motor current using axis codes.
|
117
|
162
|
M908 - Control digital trimpot directly.
|
118
|
163
|
M350 - Set microstepping mode.
|
119
|
164
|
M351 - Toggle MS1 MS2 pins directly.
|
120
|
165
|
```
|
121
|
|
-## SCARA-specific M-Codes - May change to suit future G-code standards
|
|
166
|
+### SCARA M-Codes
|
|
167
|
+__May change to suit future G-code standards__
|
122
|
168
|
```
|
123
|
169
|
M360 - SCARA calibration: Move to cal-position ThetaA (0 deg calibration)
|
124
|
170
|
M361 - SCARA calibration: Move to cal-position ThetaB (90 deg calibration - steps per degree)
|
|
@@ -126,11 +172,9 @@ M362 - SCARA calibration: Move to cal-position PsiA (0 deg calibration)
|
126
|
172
|
M363 - SCARA calibration: Move to cal-position PsiB (90 deg calibration - steps per degree)
|
127
|
173
|
M364 - SCARA calibration: Move to cal-position PSIC (90 deg to Theta calibration position)
|
128
|
174
|
M365 - SCARA calibration: Scaling factor, X, Y, Z axis
|
129
|
|
-M928 - Start SD logging (M928 filename.g) - ended by M29
|
130
|
|
-M999 - Restart after being stopped by error
|
131
|
175
|
```
|
132
|
176
|
|
133
|
|
-# Comments
|
|
177
|
+## Comments
|
134
|
178
|
|
135
|
179
|
Comments start at a `;` (semicolon) and end with the end of the line:
|
136
|
180
|
|