---
tag: m0207
title: Firmware Retraction Settings
brief: Set options for firmware-based retraction.
author: thinkyhead

group: motion
requires: FWRETRACT
eeprom: true

codes: [ M207 ]
related: [ G10, G11, M208, M209 ]

notes:
- Requires `FWRETRACT`.
- See related codes [`G10`](/docs/gcode/G010.html), [`G11`](/docs/gcode/G011.html), [`M208`](/docs/gcode/M208.html), and [`M209`](/docs/gcode/M209.html).

parameters:

- tag: S
  optional: true
  description: Retract length
  values:
  - tag: length
    type: float

- tag: W
  optional: true
  description: Retract swap length (multi-extruder)
  values:
  - tag: length
    type: float

- tag: F
  optional: true
  description: Retract feedrate (units/min)
  values:
  - tag: feedrate
    type: float

- tag: Z
  optional: true
  description: Z lift on retraction
  values:
  - tag: length
    type: float

---

Use this command to set various parameters for firmware-based retraction. Send `M207` with no parameters to get the current firmware-based retraction settings.

### Retract/Recover tuning

Calibrating retract/recover lengths and speeds can be challenging because it requires just the right balance of 4 parameters. Fortunately you can print this simple test pattern by JCZD with only a little bit of filament:

![retract-recover helper](//engrenage.ch/files/marlin_retract_recover_helper.png)

* [3x3x3x3 pattern](//engrenage.ch/files/retract_recover_3x3x3x3-jczd.gcode) - 81 individual samples, you probably want to start with this and it should give you a decent approximation
* [4x4x4x4 pattern](//engrenage.ch/files/retract_recover_3x3x3x3-jczd.gcode) - 256 individual samples, for fine-tuning

These G-codes should work for bed sizes 300x300mm and smaller. A customizer is under construction, but in the meantime you can use search-and-replace. These G-code files **must be modified** to work on your printer. Read the comments in the header and the first few lines and update the indicated values for your machine and material.
