Voron Klipper Power Loss Recovery Guide — UPS, Resume, and Spaghetti Detection
Klipper Electronics Safety
A print that fails after 20 hours due to a power flicker is infuriating. Worse: a print that fails silently and continues extruding into a blob of plastic, destroying your hotend. This guide covers three layers of protection for your Voron: UPS hardware for ride-through backup, Klipper's power loss resume system for automatic recovery, and Obico spaghetti detection for catching failures before they become disasters. Last updated: May 2025.
Layer 1: UPS Power Backup
A UPS (Uninterruptible Power Supply) serves two functions on a Voron: it smooths out brownouts and voltage sags that can corrupt print data, and it gives you 2-5 minutes of runtime to either continue the print or execute a controlled shutdown.
UPS Sizing
A typical Voron V2.4 350mm draws 400-800W during printing (bed at 105C, hotend at 245C, motors running). Choose a UPS rated for at least 1000VA (800W). The CyberPower CP1000AVRLCD or APC Back-UPS Pro 1000 are popular choices. For a V0.2 (120W max), a 600VA UPS is sufficient.
Critical spec: pure sine wave output. Simulated sine wave UPS units can cause switching power supplies (like your Mean Well PSU) to buzz, run hot, or fail entirely. Pure sine wave is mandatory for 3D printer use.
Wiring the UPS
AC Wall -> UPS Input
UPS Output -> Mean Well PSU (AC input)
Mean Well PSU -> Raspberry Pi, SKR/Octopus board, heated bed, hotend
Some users wire only the control electronics (Pi + mainboard) to the UPS and leave the bed and hotend on direct AC — the idea being that the bed/hotend can cool down while the control board remains active to execute shutdown. This extends runtime to 10-15 minutes but means the print stops. For full resume capability, power everything through the UPS.
Monitoring UPS via NUT (Network UPS Tools)
To have Klipper react automatically to power loss, install NUT on your Raspberry Pi:
sudo apt install nut nut-client nut-server
sudo systemctl enable nut-monitor
sudo systemctl start nut-monitor
Configure /etc/nut/ups.conf with your UPS model (e.g., driver = usbhid-ups, port = auto). Then create a Klipper macro that checks UPS status and parks the toolhead if power is lost:
[gcode_macro POWER_LOSS_SAFE]
gcode:
SAVE_GCODE_STATE NAME=powerloss_state
PARK
M84 # Disable steppers
TURN_OFF_HEATERS
{% if printer.idle_timeout.state == "Printing" %}
SAVE_GCODE_STATE NAME=paused_state
PAUSE
{% endif %}
Layer 2: Klipper Power Loss Resume
Klipper's power loss resume system saves the print state at regular intervals so the printer can continue after an unexpected shutdown. This works even without a UPS — the resume data is written to the microSD card or the Pi's filesystem.
Configuration
[save_variables] filename: ~/klipper_config/variables.cfg [power_loss_recovery] # Optional: enable/disable power loss recovery # Default is enabled
The save_variables module is required for storing state between Klipper restarts. The variables.cfg file persists across reboots.
How the Resume Marker Works
Klipper embeds a resume marker in the G-code file at the end of each layer. If power is lost and restored, Klipper reads the marker to determine the last completed layer. You can then resume from that point.
The marker looks like this in the G-code file:
; POWER_LOSS_RECOVERY: 1274 # Last completed layer number
The resume command is:
SDCARD_RESUME_FILE=my_print.gcode
Or, if using Moonraker's virtual SD card:
VIRTUAL_SDCARD_RESUME_FILE="my_print.gcode"
Automatic Resume Macro
[gcode_macro RESUME_PRINT]
gcode:
{% if printer.save_variables.variables.get("power_loss_print_file") is defined and printer.save_variables.variables.power_loss_print_file != "" %}
RESPOND MSG="Resuming print: {printer.save_variables.variables.power_loss_print_file}"
SDCARD_PRINT_FILE FILENAME={printer.save_variables.variables.power_loss_print_file}
SAVE_VARIABLE VARIABLE=power_loss_print_file VALUE='""'
{% else %}
RESPOND MSG="No power loss print file found"
{% endif %}
Limitations
- Resume accuracy depends on how often the marker is written. Default is every layer. For very tall prints with thin layers, you might lose 10-20 minutes of work.
- If power loss corrupts the G-code file being written, the resume marker may be unreadable. This is rare with modern SDcards but possible.
- Resume does not re-run bed mesh, Z tilt, or other calibration steps. If the bed shifted during the power loss, the next layers may be misaligned.
Layer 3: Spaghetti Detection with Obico (The Spaghetti Detective)
Power loss isn't the only failure mode. Prints can detach from the bed, create spaghetti nests, or blob up on the hotend. Obico (formerly The Spaghetti Detective) uses AI-powered camera monitoring to detect these failures and pause or cancel the print automatically.
Installation
# Via KIAUH
cd ~/kiauh
./kiauh.sh
# Select "Advanced" -> "Install Obico"
# Or install manually:
pip install "obico-klipper[server]"
Obico requires a camera connected to your Raspberry Pi. A Raspberry Pi Camera Module 3 or any USB webcam works. The AI detection runs on Obico's cloud servers (free tier: 1 hour of detection per day, paid tier: unlimited).
Configuration
After installation, run the Obico setup wizard:
obico-configure
This prompts for your Obico account token, camera device, and detection sensitivity. Recommended settings for Voron:
- Detection sensitivity: Medium (default). High causes false positives from stringing. Low misses some failures.
- Pause on detection: Enabled. Better to waste a print than a hotend.
- Pre-print check: Enabled. Obico checks the bed surface and toolhead for debris before each print.
Obico Moonraker Integration
Obico hooks into Moonraker's notification system. When it detects a failure, it sends a pause command:
{"jsonrpc": "2.0", "method": "printer.gcode.script", "params": {"script": "PAUSE"}, "id": 1}
Make sure your PAUSE macro handles the pause cleanly — park the toolhead, retract filament, and turn off the extruder heater:
[gcode_macro PAUSE] gcode: SAVE_GCODE_STATE NAME=pause_state PARK M83 # Relative extrusion G1 E-2 F300 # Retract 2mm M104 S0 # Turn off hotend RESPOND MSG="Print paused — check camera"
Full Recovery Workflow
Here's how the three layers work together in a power loss scenario:
- Power flicker — UPS kicks in within 5ms. No interruption to the print.
- Extended outage (over UPS runtime) — NUT detects UPS battery low, triggers the POWER_LOSS_SAFE macro which saves the G-code state and parks the toolhead.
- Power returns — Klipper boots, reads the power loss resume marker from the G-code file.
- User intervention — You inspect the print via camera or in person. If everything looks good, run RESUME_PRINT.
- If the print detached or blobs — Obico would have already paused it before UPS kicked in, preventing a hotend-destroying blob.
Configuration Checklist
- ✓ UPS with pure sine wave output, rated for your Voron's max draw
- ✓ NUT installed and configured to trigger shutdown/park on low battery
- ✓ save_variables section in printer.cfg
- ✓ Power loss recovery enabled (default)
- ✓ Obico installed and configured with medium sensitivity
- ✓ PAUSE and RESUME macros handle toolhead park and filament retract
- ✓ Camera stream accessible via Mainsail/Fluidd for visual inspection
Troubleshooting
Resume File Not Found
The G-code file was stored on a RAM disk or tmpfs that didn't survive the power loss. Store your G-code files on the microSD card or a persistent filesystem (not /tmp).
UPS Beeps Constantly
Your Voron's PSU draws more power than the UPS can comfortably supply. Either reduce bed temperature or upgrade to a higher VA rating. Some UPS units interpret the inrush current of the heated bed as a fault — install a soft-start module on the bed SSR.
Obico False Positives
Too many false pause triggers. Increase detection sensitivity to "Low" or add a pre-print check that clears stringing artifacts. Also ensure your camera angle doesn't catch reflective bed surfaces that the AI misinterprets as defects.
Conclusion
Power loss and print failures are facts of life with large-format 3D printing. But with a three-layer approach — UPS hardware for ride-through, Klipper's resume system for automatic recovery, and Obico for failure detection — you can sleep through 48-hour prints with confidence. The upfront cost (about $150 for a UPS, free for basic Obico) pays for itself on the first saved print.