3D printer G-code · Marlin

M413: Power-loss recovery (Marlin)

Power-loss recovery — Turns power-loss recovery on or off. With it on, Marlin writes the print state to the SD card so that a print can continue after a power cut. It causes extra writes to…

By cnccode · Updated
On this page
  1. What does M413 do?
  2. Parameters
  3. Example
  4. Tips from practice
  5. Related commands
  6. More print control commands
  7. Frequently asked questions
PropertyValue
CommandM413
FunctionPower-loss recovery
FirmwareMarlin
GroupPrint control
SyntaxM413 S<0|1>

What does M413 do?

Turns power-loss recovery on or off. With it on, Marlin writes the print state to the SD card so that a print can continue after a power cut. It causes extra writes to the card and short pauses on some printers.

Parameters

ParameterMeaning
S1 on, 0 off

Example

G-code
M413 S1

Tips from practice

  • Resume only if the part did not come off the bed and the nozzle can reheat without melting into it.

Marlin. Many Marlin commands only exist when the feature is enabled in the firmware build. If the printer answers "Unknown command", the feature is missing. Klipper does not understand most of these settings codes; it uses printer.cfg instead.

More print control commands

CommandFunctionFirmware
M220Speed factorMarlin and Klipper
M600Filament changeMarlin
M412Filament runout sensorMarlin
M84Disable motors (M84 / M18)Marlin and Klipper
M400Finish movesMarlin and Klipper
M112Emergency stopMarlin and Klipper
M25Pause SD print (M25 / M24)Marlin
EXCLUDE_OBJECTCancel one objectKlipper
PAUSEPause, resume, cancelKlipper

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

Frequently asked questions

What does M413 do on a 3D printer?
M413 is power-loss recovery. Turns power-loss recovery on or off. With it on, Marlin writes the print state to the SD card so that a print can continue after a power cut. It causes extra writes to the card and short pauses on some printers.
Does M413 work in Klipper and Marlin?
M413 is a Marlin command. Klipper uses its own commands and printer.cfg settings for this task.
Was this page helpful?