Skip to main content

Power Loss Resume Function in Klipper

  • The Power Loss Resume function in Klipper refers to the ability of Klipper to automatically restore the print status after power is restored following a power outage.
  • C5 can be used without KPPM
  • Not suitable for models where the Z-axis may shift after a power outage.

Configuration

Disable Power Off Shutdown

Notes
  • Power Off Shutdown must be disabled, otherwise Power Loss Resume cannot be used.
  • There is an automatic shutdown feature after saving progress in Power Loss Resume.
  • Ensure that no other power supply is connected to the host, otherwise it will not start up
  • Enter the device's IP address in the browser's address bar, for example: http://192.168.6.179

  • Enter the configuration page

    • Open the device IP address in the browser, for example: http://192.168.1.2/
    • In fluidd, uncheck as shown on the left in the picture Filter hidden files and folders.
    • In mainsail, check as shown on the right in the picture Show hidden files.
    • At this point, you can see the .flyos-config folder, entering this folder will have the sys-config.conf file.
    • The sys-config.conf file is a symbolic link to the configuration file config.txt in the removable disk FlyOS-Conf.
    • Open the sys-config.conf file, find the configurations shutdown_pin_state and shutdown_pin=
    • Add # before these configurations
    • Then Save -> Close and restart

plr.cfg Configuration File

Notes
  • In the printer configuration page, find the plr.cfg file.
  • Clear the content inside, then paste the configuration below
  • The configuration file content is as follows:
[mcu host]   
serial: /tmp/klipper_host_mcu

[power_loss_resume]
power_pin: !host:gpiochip0/gpio260
is_shutdown: True # Whether to perform shutdown operation, default is enabled
paused_recover_z: -2.0 # Z movement distance when resuming print if paused, default is no movement
start_gcode:
# Gcode to execute before resuming print
# All parameters saved before power loss can be obtained through {PLR}
# Use M118 {PLR} to output all available parameters
M118 Resuming print: {PLR.print_stats.filename}
M118 Interruption position: X:[{PLR.POS_X}] Y:[{PLR.POS_Y}] Z:[{PLR.POS_Z}] E:[{PLR.POS_E}]
M140 S{PLR.bed.target} ; Set bed temperature
M104 S{PLR.extruder.target-10} ; Set extruder temperature
M109 S{PLR.extruder.target-10} ; Wait for extruder to heat to set temperature
G91 ; Relative coordinates
G1 Z2 F100 ; Lift Z, prepare to home X,Y
G90 ; Absolute coordinates
G28 X Y ; Home X Y
M140 S{PLR.bed.target} ; Set bed temperature
M104 S{PLR.extruder.target} ; Set extruder temperature
M190 S{PLR.bed.target} ; Wait for bed to heat to set temperature
M109 S{PLR.extruder.target} ; Wait for extruder to heat to set temperature
M83 ; Relative extrusion
# G1 E0.5 F400 ; Extrude a little
layer_count: 2 # Execute layer_change_gcode after resuming specified layers
layer_change_gcode:
# Gcode to execute after resuming {layer_count} layers
M118 Resume print speed
M106 S{PLR.fan_speed} ; Turn on cooling fan
M220 S{PLR.move_speed_percent} ; Set requested speed percentage
M221 S{PLR.extrude_speed_percent} ; Set requested extrusion speed percentage
shutdown_gcode:
# Gcode to execute before shutdown
M118 Low power voltage, shutting down
# M112 ; Emergency stop

Note
  • The start_gcode macro in the above configuration file may need modification, specific modifications should be based on the actual machine.
  • Note that if [homing_override] is used, do not随意 set the homing position in [homing_override]. If power loss resume fails due to this, no responsibility will be assumed
  • Note that if [gcode_macro _CLIENT_VARIABLE] is used, find variable_custom_park_dz and set it to 0
  • After saving the configuration file above

  • Open the printer.cfg file, and add the following content at the beginning of the file:


    [include plr.cfg]

  • Click Save and restart in the top right corner.

  • At this point, the Power Loss Resume function in Klipper has been configured.

Test

  • Print any file, click the Emergency Stop button during printing to simulate a power outage.
  • Click Firmware Restart again, wait for Klipper to connect normally.
  • If a pop-up appears on the web page or KlipperScreen, it indicates that the Power Loss Resume function is working properly.
  • Subsequent tests can be performed with real power outages.
Loading...
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -