Power Loss Resume Function in Klipper
Overview
-
The Power Loss Resume function in Klipper refers to the ability to automatically restore the printing status of Klipper after it loses power and is re-powered.
-
This function can only be used with the FAST system.
-
Lite2.1 requires the KPPM power loss module to be used.
-
Not suitable for models where the Z-axis may shift after a power outage.
-
Introduction to KPPM
Configuration
Turn off power-off shutdown
Note- Power-off shutdown needs to be turned off, otherwise the power failure resume function cannot be used.
- The power failure resume has a function to automatically shut down after saving the progress.
- Please ensure that there is no other power connected to the host, otherwise it will not be able to 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, as shown on the left in the picture,
uncheck
->filter hidden files and folders
. - In mainsail, as shown on the right in the picture,
check
->show hidden files
.
- At this point, you can see the
.flyos-config
folder, entering this folder will have thesys-config.conf
file. - The
sys-config.conf
file is a soft link of the configuration fileconfig.txt
in the removable diskFlyOS-Conf
.
- Open the
sys-config.conf
file, find the configurationsshutdown_pin_state
andshutdown_pin=
- Add a
#
before these configurations - Then
save
->close
and restart
- Open the device ip address in the browser, for example:
plr.cfg configuration file
Note- Replace the following in the configuration file: (PINS)
- with
host:gpiochip1/gpio8
- In the printer configuration page, find the
plr.cfg
file. - Empty its content and paste the configuration below
- The configuration file content is as follows:
[mcu host]
serial: /tmp/klipper_host_mcu
[power_loss_resume]
power_pin: (PINS)
is_shutdown: True # Whether to perform shutdown operation, enabled by default
paused_recover_z: -2.0 # Z movement distance when resuming printing if paused at power loss, default is no movement
start_gcode:
# Gcode to execute before resuming printing
# 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 for 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 stopNote- The
start_gcode
macro in the above configuration file may need to be modified, 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 the power failure resume fails, we are not responsible. - Note that if
[gcode_macro _CLIENT_VARIABLE]
is used, findvariable_custom_park_dz
and set it to0
-
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 Klipper power failure resume function has been configured.
Test
- Print any file, click the
Emergency Stop
button during printing to simulate a power failure. - Click
Firmware Restart
again, wait for Klipper to connect normally. - If a pop-up appears on the web page or KlipperScreen, it means the power failure resume function is working properly.
- Subsequent tests can be done with real power outages.
Loading...