Smoothie is primarily a G-code interpreter.
Here is a list of the G-codes that are currently supported. Look up commands by number below. For named commands, see the console commands.
G1 X10 F100| G-Code | Description | Example |
|---|---|---|
| Move to the given coordinates. To the contrary of |
||
| Move to the given coordinates, see above for difference with |
||
| Clockwise circular motion: go to point with coordinates XYZ while rotating around point with relative coordinates IJ (command is not modal) | ||
| Counter-clockwise motion: see above (command is not modal) | ||
| Dwell S |
||
| Do firmware extruder retract | ||
| Do firmware extruder un-retract | ||
| Set extruder tool offset for specified extruder where Pn is the extruder number + 1 (T0 is P1, T1 is P2), This stays set until reset. Permanent change must be added to config, Only active when multiple extruders have been defined | ||
| Set workspace coordinates LinuxCNC |
||
| Select XY plane for arc commands (G2/G3) (command is modal) | ||
| Select XZ plane (command is modal) | ||
| Select YZ plane (command is modal) | ||
| Inch mode: passed coordinates will be considered as Inches, so internally translated to millimeters (command is modal) | ||
| Millimeter mode (default) : passed coordinates will be considered as millimeters (command is modal) | ||
Home The given axis, or if no axis specified home all axis at the same time (edge) NOTE in CNC/grbl mode this is move to park position, use $H to home |
||
| Set Predefined Position - This position will be returned to by |
||
| Move to Predefined Position - This perform a rapid move to the Predefined position set by |
||
| Manual Homing - This allows you to set a home position manually without moving to limit switches | ||
| Clears the homed flag for the specified axis, or all if not specifed | ||
| Shows the homing status of each axis | ||
| Bed probe test - probes bed and reports heights. Behavior depends on levelling strategy (ThreePoint/DeltaGrid/CartGrid), see ZProbe | ||
Simple Z probe by default. In V2 GRBL mode with nist_G30, move to the position stored by G30.1; adding P keeps probe behavior |
||
V2 GRBL mode with nist_G30: save the current homed machine position for G30 |
||
| Leveling strategy command - probes grid and activates compensation, or reports status (ThreePoint). Depends on levelling strategy, see ZProbe | ||
| Depends on levelling strategy selected, see ZProbe. For calibration on delta, uses Z probe to calibrate delta endstops and arm radius, use R parameter to select only arm radius calibration and E to select only endstop calibration. I to set target precision, J to set probe_radius, K to keep current endstop trim settings. In Zgrid module, it starts the grid probing | ||
| Standard probe commands implemented as documented here | ||
| Baby steps | ||
| Must be on a line by itself OR the first G code on a line, the directly following |
||
| Select work coordinate system 1 (default) | ||
| Select work coordinate system 2 | ||
| Select work coordinate system 3 | ||
| Select work coordinate system 4 | ||
| Select work coordinate system 5 | ||
| Select work coordinate system 6 | ||
| Select work coordinate system 7 | ||
| Select work coordinate system 8 | ||
| Select work coordinate system 9 | ||
| Absolute mode (default) (command is modal) | ||
| Relative mode (command is modal) | ||
| Set global workspace coordinate system to specified coordinates LinuxCNC |
||
| Clear the |
||
| manually set homing (MCS) for XYZ | ||
| Feedrate mode (motion per minute) - standard modal command for feedrate units (mm/min) |
G0 X7 Y8 ;this is the comment
| M-Code | Description | Example |
|---|---|---|
| Start the configured spindle output (S depends on the module) | ||
| Turn off the configured spindle output | ||
| Turn off coolant/auxiliary output | ||
| Enable/power all stepper motors | ||
| Disable all stepper motors (same as M84) | ||
| List the root of the SD card | ||
| Reply to an SD initialization request (also remounts on V1) | ||
| Select SD file for printing (must be followed by M24 to start) | ||
| Start or resume SD print | ||
| Pause SD print | ||
Reset the SD print to the beginning. May start it again on V2. Use abort to end the job. |
||
| Report SD print progress | ||
| Delete file from SD card | ||
| Select and immediately start SD file | ||
| Set extruder to absolute mode | ||
| Set extruder to relative mode | ||
| Stop idle hold - disable stepper motors (S parameter sets timeout in seconds) | ||
| Set axis steps per unit - calibrate steps/mm for X, Y, Z, E axes | ||
| Set extruder temperature without waiting (S parameter in °C) | ||
| Get temperature reading - reports current and target temps for all modules | ||
| Set extruder temperature and wait until reached (S parameter in °C) | ||
| Halt the firmware, turn off heaters and abort file playback. Home again after clearing the halt. | ||
| Report current position of all axes | ||
| Get endstop status - reports state of all endstop switches | ||
| Set bed temperature without waiting (S parameter in °C) | ||
| Set maximum allowable temperature (S parameter in °C) | ||
| Set bed temperature and wait until reached (S parameter in °C) | ||
| Set filament diameter for volumetric extrusion (D parameter in mm) | ||
| Set maximum feedrate for axes (X, Y, Z, E in mm/min) | ||
| Set acceleration - S for default, P for print, T for travel (in mm/s²) | ||
| Configure firmware retraction - S length, F feedrate, Z lift | ||
| Configure firmware unretraction - S recover length, F feedrate | ||
| Set speed factor override percentage (S100 = normal speed) | ||
| Set flow rate/extrusion percentage override (S100 = normal flow) | ||
| Set PID controller parameters - P (Kp), I (Ki), D (Kd) | ||
| PID autotune - automatically calibrate PID. E for extruder (-1=bed), S target temp, C cycles | ||
| Configure temperature sensor - P heater number, T thermistor resistance, B beta | ||
| Set homing offset using current position (Z parameter in mm). Must follow with M500 to save | ||
| Status query command - returns machine status for PanelDue (S parameter for response type) | ||
| Save configuration to SD card - persists calibration and config changes | ||
| Restore settings from SD card | ||
| Report current settings | ||
| Suspend the print after queued moves finish. Turns off heaters by default and lets you jog. | ||
| Resume the print after M600. | ||
| Config override (Delta) - set Z height, diagonal rod (L), delta radius (R). Use M500 to save | ||
| LED test - diagnostics command | ||
| Error dump - output error statistics | ||
| Report spindle status | ||
| Set spindle parameters (P for PWM percentage) | ||
| Clear halt state after emergency stop (M112) or kill button. Position lost - must re-home | ||
| Generic command wrapper - send console commands from G-code |
On V2, you can also group commands and call them by name with O-word subroutines.
The Smoothieware configuration file permits the association of additional codes with some tool functions. For example, for a Switch module, you can specify an arbitrary command in the ‘input_on_command’ and ‘input_off_command’. This means that some additional codes may be available, depending on your specific configuration file.
For example, if you are using servos, then you will likely have configured the following commands:
| G-Code | Description | Example | |
|---|---|---|---|
| M280 | Move servo to S |
M280 S20 ; move servo to position 20 = 20% duty cycle | |
| M281 | Turn off servo | M281 ; Same as M280 S0 0% duty cycle, effectively off |
Additionally, in your configuration, you can assign sub-commands to deal with multiple tools of the same type, for example:
| G-Code | Description | |
|---|---|---|
| M280.1 | Move your first servo | |
| M280.2 | Move your second servo |
Use Tn to select tool n for the commands that follow. See setting up multiple extruders if you are adding a tool. You can put the tool number on a line by itself or on the same line as the command:
T1 M200
M200 T1
NOTE This is not compatible with the G-code spec, but unfortunately most slicers create incorrect Gcode for tool change.
This comes from the older wiki and has not been checked against the current firmware. These rows were in the table above in earlier versions of this page. The V1 and V2 source do not appear to implement M0, M1 or M1234, and the descriptions of M3, M5, M20, M21, M26 and M112 in the table above were corrected from the source. They are kept here so that the earlier text is not lost.
| M-Code | Earlier description | Example |
|---|---|---|
| Program stop - pauses execution unconditionally until user intervention | ||
| Sleep or conditional stop - pauses execution (may be ignored if optional stop disabled) | ||
| Spindle on, clockwise - starts spindle or laser at specified speed (S parameter in RPM or %) | ||
| Spindle/laser/tool stop | ||
| List SD card contents. Optional S parameter for output style, P for directory path | ||
| Initialize/mount SD card | ||
| Abort SD print. Optional S parameter for byte position in file | ||
| Emergency stop - instantly halts all operations, turns off heaters, loses position | ||
| Undocumented M-code (purpose unknown) |