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