3D printer G-code · Marlin and Klipper
G10: Firmware retract (G10 / G11) (Marlin & Klipper)
Firmware retract (G10 / G11) — G10 retracts and G11 unretracts with lengths and speeds stored in the firmware instead of the slicer. The advantage: you can change the retraction while printing…
On this page
| Property | Value |
|---|---|
| Command | G10 |
| Function | Firmware retract (G10 / G11) |
| Firmware | Marlin and Klipper |
| Group | Extrusion |
| Syntax | G10 then G11 |
What does G10 do?
G10 retracts and G11 unretracts with lengths and speeds stored in the firmware instead of the slicer. The advantage: you can change the retraction while printing (M207/M208 in Marlin, SET_RETRACTION in Klipper) without slicing again. Marlin needs FWRETRACT, Klipper a [firmware_retraction] section. The slicer must have firmware retraction turned on.
Example
G10 ; retract (length from M207 / SET_RETRACTION)
G0 X120 Y80 F9000
G11 ; unretractTips from practice
- Useful for tuning retraction on a test print in real time.
- In Marlin set the values with M207 S<length> F<speed> and save with M500.
The command works in Marlin and Klipper. Options can differ: Klipper accepts fewer parameters for some M-codes and ignores codes it does not know with an "Unknown command" error.
Related commands
More extrusion commands
| Command | Function | Firmware |
|---|---|---|
G92 | Set position (G92 E0) | Marlin and Klipper |
M82 | Absolute extrusion (M82 / M83) | Marlin and Klipper |
M221 | Flow percentage | Marlin and Klipper |
M900 | Linear advance factor | Marlin |
SET_PRESSURE_ADVANCE | Pressure advance (Klipper) | Klipper |
SET_RETRACTION | Change firmware retraction | Klipper |
Test it before you print
Paste your start code or a whole file into the 3D printer simulator. It plans every move, shows the time and finds missing waits, cold extrusion and moves outside the bed.
Open the simulator