machines/systems/flexibot/docs/marlin/_gcode/M413.md
2025-03-11 23:32:39 +01:00

1.6 KiB

tag title brief author requires since group codes notes parameters examples
m0413 Power-loss Recovery Enable / disable power-loss recovery thinkyhead POWER_LOSS_RECOVERY 2.0.0 control
M413
Requires `POWER_LOSS_RECOVERY` and an LCD controller.
Requires printing from the SD Card or Flash Drive.
A future implementation may use the EEPROM instead of the attached media.
tag optional description values
S true Flag to enable or disable Power-loss Recovery. If omitted, the current enabled state will be reported.
type
bool
pre code
Enable power-loss recovery M413 S1
pre code
Disable power-loss recovery M413 S0
pre code
Report power-loss recovery state M413 Power-loss recovery ON

M413 is used to turn the Power-loss Recovery feature on and off. When Power-loss Recovery is enabled and Marlin is running a print job from the SD Card or Flash Drive, it periodically saves the print job state to the SD Card / Flash Drive. If the machine crashes or a power outage occurs, Marlin presents the option to resume the interrupted print job.

This feature is able to operate without a power-loss detection circuit by writing the recovery file periodically (e.g., once per layer). However, with a POWER_LOSS_PIN Marlin only writes the recovery info when a power-loss is actually detected. This method is preferred because the print will be resumed exactly where it was interrupted (rather than repeating the last layer), and the SD card or Flash Drive will incur much less wear.