prusa3d / Prusa-Firmware-Buddy

Firmware for the Original Prusa MINI, Original Prusa MK4 and the Original Prusa XL 3D printers by Prusa Research.
Other
1.17k stars 229 forks source link

[ENHANCEMENT] MK4 and XL Power Panic Bypass (for use with UPS systems) #3255

Closed IBNobody closed 5 months ago

IBNobody commented 1 year ago

Enter what type of printer or upgrade the enhancement applies to. Printer type - MK4, XL Optional upgrades - None

Is your suggested improvement related to an existing problem? Please describe.

The current buddy firmware checks the state of the power panic line during initialization and throws error 13321/ ERR_ELECTRO_ACF_AT_INIT if the power panic line is disconnected. There is no way to bypass this in the firmware.

https://github.com/prusa3d/Prusa-Firmware-Buddy/blob/56a40a0f776bb096468b47f52eb158e0afc84e08/src/common/power_panic.cpp#L62C1-L62C1

In this code, the acFault line is polled and checked to see if it is LO. If it is LO, Error 13321 / ERR_ELECTRO_ACF_AT_INIT is thrown.

This is fine for normal users, but if you have a UPS battery backup, power panic falsely trips when the PSU is switched over to battery backup. On the MK3, the common solution would be to disconnect the power panic wire from the PSU to the Einsy. However, on the MK4, disconnecting the power panic wire causes the printer to throw error 13321 on boot.

(I theorize that the xbuddy PCB omitted a pull-up resistor that was present on the Einsy.)

Describe the expected functionality

Ideally, Error 13321 / ERR_ELECTRO_ACF_AT_INIT would not be thrown on boot. It should be thrown when attempting to print and should not gate adjusting any settings on the MK4.

The check for the acFault should also be bypassable via a firmware setting allowing us to disable power panic.