This page gives what the RepRap community wiki says about the codes and parameters of printer and machine firmware that has no page of its own here. It is a secondary source: none of it was checked against the source code of these firmwares, versions are mostly not stated, and several of the projects are old. Which firmware accepts which code is listed in the command register; a code that behaves as it does elsewhere is not repeated here. Times marked P or S are the parameter letters of the command.
Teacup
Teacup buffers G20, G21, G90 and
G91 as well as the movement codes, and switches the power
supply by itself, so M80 and M81 are not
needed.
| Command | Meaning and parameters |
|---|---|
G4 P0 | Waits until all previous moves have finished. |
G161, G162 | Home to the minimum or the maximum: flags X, Y, Z; F feed rate. |
M2 | Does the same as M84. The wiki says Teacup uses M2 where others use M18. |
M3, M5, M7 | Extruder on (as M101), extruder off (as M103), fan on with a speed (as M106). |
M23 | Takes a file name in upper or lower case. |
M42 | General-purpose devices are handled like heaters, through M104. |
M101 | With a DC extruder, turns it on; otherwise undoes the retraction. |
M103 | With a DC extruder, turns it off; otherwise retracts. |
M104 | P is a zero-based index of a sensor in config.h, so any device with a sensor can be set: M104 P1 S100. |
M106 | P is a zero-based device index: M106 P2 S255. PID control of a device that has a sensor overrides the value. |
M107 | Deprecated. |
M109, M110 | Not needed; use M104 followed by M116 in place of M109. |
M130 | Proportional gain: P heater, S value, in output counts (of 255) per quarter degree Celsius. Multiply by 4 for counts per degree. |
M131 | Integral gain: P, S, in counts per quarter degree times quarter second. Multiply by 16 for counts per degree second. |
M132 | Derivative gain: P, S, in counts per quarter degree per 2 seconds. The wiki’s conversion figures disagree with each other (4 in one direction, 8 in the other). |
M133 | Integral limit: P, S, in quarter degree quarter seconds; S264 is 16.5 degree seconds. |
M134 | Writes the PID values to EEPROM. |
M136 | P heater: prints its PID values (experimental, for debugging). |
M240, M241 | Experimental debugging: echo off and echo on. |
In the default configuration heater 0 is the extruder and heater 1 the bed.
MakerBot
| Command | Meaning and parameters |
|---|---|
G130 | Sets the digital potentiometers that control motor current: X, Y, Z, A, B, each 0 to 127. The relation to current depends on the machine. |
G161, G162 | Home to the minimum or the maximum: flags X, Y, Z; F feed rate. |
M70 | Shows the message that follows; P is how long. |
M72 | Plays a preset song: P is the song number, which depends on the machine. |
M73 | P is the percentage done. Exactly 0 sends a build-start notification and 100 a build-end notification. |
M109 | Sets the build platform temperature: S temperature, T platform. |
M126, M127 | With T0, switch the extra output of a tool head on and off. |
M132 | With axis letters X Y Z A B, loads the offsets of those axes’ home positions from EEPROM and waits for the buffer to empty. |
M133 | Waits for a tool head: T extruder, P timeout in seconds. |
M134 | Waits for a platform: T platform, P timeout. |
M135 | Changes tool head: T. |
BFB (Bits from Bytes, RapMan)
Files for these machines use the extension .bfb.
| Command | Meaning and parameters |
|---|---|
M101, M102, M103 | Extruder on forward, on in reverse, off. |
M108 | Sets the speed of the extruder motor. |
M220, M221 | Turns the output “AUX V1.0.5” off, on. |
M222, M223 | Sets the speed of fast moves in XY, in Z. |
M224, M225 | Enables, disables the extruder during fast moves. |
M226 | Pauses after the previous commands and waits for the user. |
Sprinter and FiveD
| Command | Firmware | Meaning and parameters |
|---|---|---|
M105 | FiveD | Requests the temperatures. |
M109 | Sprinter | S is a target waited for while heating; R a target waited for while cooling. |
M109 | Sprinter for the 4pi board | S is optional (without it, the value set by M104 is waited for); R is the upper bound of the accepted range, as in M109 S185 R240; T or P picks the extruder. |
M113 | FiveD | Extruder motor drive: S is a fraction such as 0.7, S0 turns it off, and without S the potentiometer on the board is used. It replaces M108. |
M115 | FiveD | Answers in the form ok PROTOCOL_VERSION:0.1 FIRMWARE_NAME:FiveD FIRMWARE_URL:http%3A//reprap.org MACHINE_TYPE:Mendel EXTRUDER_COUNT:1. |
M117 | FiveD | Reports the X, Y, Z and E positions, in motor steps, found the last time the axes reached their zero switches. Other firmware uses this number to show a message. |
M126, M127 | FiveD | Opens, closes a valve; P is a wait in milliseconds. Marlin and MK4duo take the same. |
MK4duo
| Command | Meaning and parameters |
|---|---|
G28 | B returns to the position held before homing. |
G30 | For delta machines: X, Y position; S stows the probe if 1 (the default); a non-zero Z applies the result to the delta height; a non-zero P applies it to the probe’s Z offset. |
M33 | Stops the print from the card and saves the position in restart.gcode so that it can be resumed. |
M35 | Uploads Nextion display firmware from the card. |
M44 | Reports the available codes: I G-codes, J M-codes. Needs the FASTER_GCODE_EXECUTE build option. |
M73 | P percentage done, with 0 and 100 marking the start and end of the build. |
M104, M140 | R is the idle (standby) temperature; M140 also takes T, as in M140 S60 R30. M141 accepts R in the same way. |
M105 | X1 adds the raw sensor readings. |
M106 | Also I (invert or disable), F PWM frequency in hertz, L minimum, X maximum, H the heaters that the fan monitors. |
M109 | R is a target waited for both while heating and while cooling. |
M122 | S0 or S1 disables or enables the software end stops. |
M123 | End-stop logic: X, Y, Z, I (X2), J (Y2), K (Z2), P (probe), D (door), each 0 or 1. Without parameters it reports. |
M124 | End-stop pull-ups on or off, with the same letters. |
M142 | Cooler temperature: T tool, S target, R standby. |
M204 | Accelerations for tool T: P printing, V travel, R retraction. |
M301 | H selects the heater: 0 to 5 hot ends, -1 bed, -2 chamber, -3 cooler. |
M305 | C is the third Steinhart–Hart coefficient. |
M530 | S1 starts and S0 ends a print; L is the number of layers, 0 if unknown. Starting also starts the print counters and turns off a 30-minute heater timer. M115 reports Cap:PROGRESS:1. |
M531, M532 | Name of the print; X percentage done and L current layer. |
M540 | S1 or S0: stop a print from the card when an end stop is hit, or not. |
M851 | Probe offset in X, Y and Z: M851 X2 Y-5 Z-4 (version 4.3.25). |
M890 | S1 to S5 runs one of the user G-code sequences defined in the configuration. |
M908 | P pin, S current for a digital potentiometer. |
The wiki also marks MK4duo as supporting several codes whose parameter
text there describes RepRapFirmware, such as M557,
M558 and M572 to M574; whether
MK4duo takes the same parameters is not stated.
Redeem
| Command | Meaning and parameters |
|---|---|
G, M | Without a number, list the implemented G or M codes with their descriptions. |
G31, G32 | Dock and undock the probe sled. |
G33 | Distortion matrix. Without parameters, measures the grid, stores it and turns correction on (home first); L0 lists it; R0 resets it; X, Y, Z set the correction at the nearest point. M323 turns correction on and off. |
M81 | P quits the Redeem service; R restarts it. |
M119 | Can also invert an end stop: M119 X1 1 marks switch X1 as normally open. |
M301 | E selects the heater: -1 bed, 0 E, 1 H, 2 A, 3 B, 4 C; default 0. |
M500 | Settings changed by G or M codes that differ from the configuration files are written back to the local configuration. |
M906, M907 | Motor current, in milliamps for M906 and in amps for M907. |
M909 | Microstepping per motor as a power of two: M909 X2 gives 4 microsteps, Y3 8. |
Machinekit
The wiki discourages line numbers (N) in Machinekit, where
they serve no purpose.
| Command | Meaning and parameters |
|---|---|
G10 | Sets tool offsets or work coordinates with L, P and axis letters; it is not a retraction here. L1 sets the offsets of tool P, L2 the offsets of workplace system P, L20 adjusts those so that the present position gets the given coordinates. |
G22, G23 | Retraction and recovery with the length and speed set in the firmware. |
G29.1 | Sets the probe head offset, subtracted from all probing moves: X, Y, Z. |
G29.2 | The same offset, calculated from the distance of the tool head to the present axis zero. |
M207 | P retraction length in millimetres, Q retraction speed in millimetres per second. |
M226 | Pauses after the previous commands and waits for the user. |
M420 | Colour of an RGB light: R red, E green, B blue, each 0 to 255. |
M600 P | Cross-section of the extruded line for velocity extrusion mode: M600 P0.061. |
Druid
Version 1.00 ignores case by default. M544 S1 makes it
ignore case and S0 respect it; M544 S reports
the setting, L lists the supported G-codes and
K the commands for its media and memory.
| Command | Meaning and parameters |
|---|---|
G6 | Moves motors directly, synchronised but without interpolation or kinematics: A, B, C give the position or angle of each motor, R makes it relative. |
G60 | 64 stored positions, 0 to 63. S saves; Q recalls a slot, with F feed rate and flags X, Y, Z, E (all axes if none); D with a slot deletes it, D alone deletes all; G60 alone lists them. A line with more than one of S, Q and D is ignored. |
M21 | Mounts a medium: P0 or S the external SD card, P1 or M the on-board microSD, P2 or U USB; without these, the current volume. |
M105 | Reports every heater, as in T0:27.8/0 T1:27.8/210 B:21.6/0 C:85.0/0 @0:0 @1:255 B@:0 C@:0: temperature to one decimal over a whole-number target, then output power 0 to 255. |
M500 | Settings (512 bytes) are kept in a 128 KB flash sector. Changes go first to a temporary file, both are read at start, and M500 forces them to be merged. |
M510 | Locks the machine. |
M511 | Unlocks with a passcode in double quotes: 8 letters and digits, case-sensitive. |
M512 | Sets a passcode ("new") or changes it (current and new, separated by a slash or a space). Only a hash is stored in the microcontroller. |
M513 | Removes the passcode, given the current one or a 24-character removal code from the maker. |
M524 | Aborts the print from the card. |
M540 | S1 or S0: stop a print from the card when an end stop is hit, or not. |
M905 | Clock: S followed by HH:MM:SS or HH:MM sets it; R resets it to the running time on 1 January 2000. |
M907 | Motor current for X, Y, Z, A (first extruder) and B (second): 0.10 to 2.50 is amps, 20 to 200 a percentage of the default, 250 to 2500 milliamps, and other values are ignored. I idle percentage (default 50, 10 to 90); S restores the defaults; alone it reports. |
Grbl and Yaskawa
Both are motion controllers rather than printer firmware. Only the points below are taken from the wiki; for the general machine-tool dialect see RS274/NGC codes.
- In Grbl the P of
G4is in seconds, soG4 P0.2waits 200 milliseconds. M30stops the program in Grbl and Yaskawa controllers; in Yaskawa it is the same asM2.G40turns cutter compensation off. If it was on, the next move must be a straight one longer than the tool diameter.- Yaskawa controllers use absolute extrusion (
M82) by default.M84,M92andM93do not apply to their servo motors.
Not covered
The source code of these firmwares was not read, so nothing here is
confirmed against it: parameter defaults, ranges, reply texts and the
options that enable each command are missing wherever the wiki does not
give them. For Grbl and Yaskawa their own manuals were not read. Codes
that the wiki gives as proposals without a firmware, among them
M227 to M230, are not described.
Sources
- G-code – RepRap wiki, community-written; the facts used here are restated in our own words