Smoothie is primarily a G-code interpreter.
Here is a list of the G-codes that are currently supported:
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 | ||
| V2 Only - Manual Homing based on actuator position. This allows you to set a home position manually based on actuator position (used for rotary delta) | ||
| Clears the homed flag for the specified axis, or all if not specifed | ||
| Shows the homing status of each axis | ||
| V2 Only - Home slaved axis. For dual-motor axes (e.g., dual Z motors), homes the secondary motor independently | ||
| Bed probe test - probes bed and reports heights. Behavior depends on levelling strategy (ThreePoint/DeltaGrid/CartGrid), see ZProbe | ||
| Simple Z probe at current XY, reports distance moved down until probe triggers. optional F parameter defines the speed of probing, zprobe.slow_feedrate is used when not supplied | ||
| 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 | ||
| V2 Only - Lathe threading with spindle synchronization. For CNC lathe operations, synchronizes tool feed with spindle rotation for cutting uniform threads | ||
| 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 |
|---|---|---|
| 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 | ||
| Turn off coolant/auxiliary output | ||
| Enable/power all stepper motors | ||
| Disable all stepper motors (same as M84) | ||
| List SD card contents. Optional S parameter for output style, P for directory path | ||
| Initialize/mount SD card | ||
| Select SD file for printing (must be followed by M24 to start) | ||
| Start or resume SD print | ||
| Pause SD print | ||
| Abort SD print. Optional S parameter for byte position in file | ||
| 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) | ||
| Emergency stop - instantly halts all operations, turns off heaters, loses position | ||
| 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 print - pauses execution, turns off heaters (configurable), allows jogging | ||
| Resume print after M600 suspension | ||
| 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) | ||
| V2 Only - Direct TMC stepper driver register access via SPI. Read all driver status with no parameters, write/read specific registers with S and V parameters | ||
| V2 Only - Write TMC register. S parameter specifies register, V parameter specifies value to write | ||
| Clear halt state after emergency stop (M112) or kill button. Position lost - must re-home | ||
| Generic command wrapper - send console commands from G-code | ||
| Undocumented M-code (purpose unknown) |
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 |
Tn will change the tool to n for all future commands, it may appear anywhere on the line or on a line by itself:
T1 M200
M200 T1
NOTE This is not compatible with the G-code spec, but unfortunately most slicers create incorrect Gcode for tool change.