Testing Power Failure Feature

  • I setup the power failure feature as described in the wiki. When I send M911 S25 my printer moves up, retracts, and saved the pause location. I then turn my printer off and on and send M916. The printer then rehomes X and Y and resumes printing as I want it to. However, when I unplug the printer this does not happen. It seems that the power runs out too fast for the printer to move or even save anything. When I turn the printer back on and send M916 nothing happens. Is there a better way to test power failure? I've tried unplugging the cord and flipping the power switch.

  • Running M916 seems to be working now. Strange since I didn't change anything. However, the printer is still not moving or retracting. It seems that it only has enough power left to save the restart data and can't do anything else. Is there anyway to fix this?

  • What kind of power failure detection circutry are you using?

  • Can or do you kill the heaters as soon as the warning is raised? May buy you a little time before the PSU drains to a voltage level that is too low to run the steppers.

  • @doctrucker Currently I run "M913 X0 Y0 G91 M83 G1 Z3 E-5 F1000" on detection of power failure.

  • That only reduces the motor currents. Are you perhaps supplying AC to the heaters, if not they need to be shut down to conserve whatever energy is left in the power supply output buffer. (Although not sure if 0% is the best target)

  • @bearer I added "M104 S0" to the M913 command in the config.g file and have not seen any changes

  • That brings me back to exactly what kind of hardware is doing the power loss detection, and what kind of power supply is in use? It may well be the supply just doesn't have enough power after the fact.

  • Moderator

    12v or 24v?

  • @Phaedrux 24v
    @bearer That is most likely the case. I have decided that since it saves the restart data and I am able to restart the print as long as the print head being close to the print does not ruin anything, I will leave this project until later. I think I should look into a different power supply but at this point I am fairly happy with how it works currently.

  • Adding capacitors to the existing supply could help, but how effective it wold be would entirely depend on how the power loss is detected in the first place.

  • administrators

    @bearer, the Duet detects power loss on-board. The power loss threshold voltage is set in the M911 command. using 24V power, you would typically set it to about 22V.

    The heaters are automatically turned off when the voltage dips below the threshold set in M911. Typically, the power fail script should use M913 to reduce power to motors other than Z and E, to help save enough power to raise Z and retract filament. See https://duet3d.dozuki.com/Wiki/Setting_up_to_resume_a_print_after_a_power_failure.

  • @dc42 Is there a way to configure another input? I normally use an opto coupler to detect mains zero crossings to get an early warning of mains failure.

  • administrators

    @nophead said in Testing Power Failure Feature:

    @dc42 Is there a way to configure another input? I normally use an opto coupler to detect mains zero crossings to get an early warning of mains failure.

    Not yet, although I plan to add one.

  • But an arbitrary input assigned to a trigger could get the job done surely, and detecting mains loss instead of voltage sag would make adding capacitance more effective, if needed at all.

  • administrators

    @bearer said in Testing Power Failure Feature:

    But an arbitrary input assigned to a trigger could get the job done surely...

    It wouldn't provide the same near-instant execution that the built-in power failure code does.

  • Interesting, hopefully configurable inputs will be good to go by the time i get around to adding power loss stuff. 👍

  • administrators

    If we assume that the power draw of the machine after the firmware turns off the heaters and XY motors is 10W (basically the power needed to drive the Z and extruder motors, plus a little for the Duet itself), then adding 10000uF capacitance on the 24V power rail should provide 190ms additional time. On a delta where you can't turn any motors off, it should still provide 100ms extra time; and on a delta the Z move will be fast anyway.

    How much extra time would be provided by an external power fail input will depend on the power supply and the nature of the power fail detection.

  • @dc42 It is far more effective to use the energy stored in the main reservoir capacitor in the PSU that is charged to 340-400V because E = CV^2, and it can usually drop a long way before the PSU output falls at all. That is why I like to look for two missing mains half cycles when doing power fail detection. On a decent PSU it can give you seconds. I haven't done it on a 3D printer yet though.

  • I was thinking the same ☝
    (but thinking usually never leads to anything good 😀 )

Log in to reply