New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Power-off Recovery Implementation #1645
Comments
I think that some sort of UPS is necessary for the RPi at least. |
well I suppose we could lift the Z-axis by a little bit. That would be a good idea to prevent it melting in to the part. I need to look more in to the pause/resume function to determine that. I want to avoid constantly writing what is happening to a file like other solutions (Marlin). |
I like the idea very much, since I already had to deal with manual recovery - but not due to an power out. At least here in Germany power out is very rare and usually you don't need an UPS. Therefore I see two disadvantages:
|
Thanks. At a high-level my feedback is that this is useful, but will be difficult to accomplish. The main issue I foresee is that g-code is not designed to be interrupted. (One may be able to get some basic test cases working, but g-code has so many bizarre corner cases that I fear making it work in the general case will become overwhelming.) Cheers, |
We intend on using Klipper in a commercial printer launching later this year so power-off recovery is definitely a big deal and hopefully worth the hardships. I am gonna start working on this and then once I've got a version that works hopefully I can merge it back in assuming not too much has changed. |
Interesting; thanks. I look forward to seeing your results. Some thoughts:
Cheers, |
Very good points and I really appreciate the knowledge. I do agree that modifying microcontroller code should be avoided. I will need to dig through octoprint to see if there is some way that Klipper can find the print and give the user an option to resume on boot. Ideally, I'd like octoprint to take care of it but it seems having Klipper handle this may be needed. Maybe I can find a way to trigger octoprint to "resume" a print from a smaller gcode file that contains the rest of the print (as long as I can set the z axis in klipper). I suspect most Z steppers don't move without power, at least not the ones on any of my boards. My boards shorts the steppers to create resistance when there is no power and also the lead screw prevents much movement regardless. X and Y wouldn't be a problem because the printer could easily rehome. With the short buffer we could theoretically just skip unexecuted moves. It would probably result in maybe some tiny errors in the print but would be drastically better than having the print fail altogether (and easier to implement than keeping track of what moves have actually happened). |
this power-off recovery would be an advanced config option obviously so I can state the caveats clearly when adding a template so users know not to expect too much. Once I have this implemented that is |
What about the other way around.
Based on actuall recovered position you may know not only how much X/Y moved, but also wether the printer went to the next Z layer, because if it is already on X/Y location, which according to the planner, should be on the next Z layer, then you know the printer moved one layer up too. For very small perimeter prints the nozzle might have done more than one full perimeter, so that is also possible! Prints with heated bed, can release the print when got cold. |
Advanced option (can be implemented later, depending on real-life expereince): you could even allow X/Y/Z tweaking by the interface. So, if the printer thinks that it has to continue from x1, y1, z1 position - the user could say z1-1 layer, so the planner goes back one layer down on the same x1, y1 position in order to compensate for the mistake. I.e. user has to be able to move the X/Y/Z (after X/Y homing). It should be possible to move X/Y too, again to compensate. So, how you recover Z? Based on current knowledge where the X,Y left and the last save on the RPi (last second), plus possible compensation by user (+/- number of layers). Is it possible? |
Advanced option 2 (implementation could be done even further in time): RPi, potentially could detect upon reboot that the print was interrupted due to power loss and if the total power outage (including reboot) was less than N seconds to continue automatically the print (i.e. bed is still warm, nozzle is cold, but probably could be recovered in a minute or two). This could be useful option in case you had short outage like, couple of seconds and not recovering the print might be dangerous due to object self-release on cold heatbed. |
@KevinOConnor looking for some advice. I've got a working implementation of power-off recovery. After a failure the printer will put in the Octoprint terminal upon reconnection something along the lines of "In-progress print saved, type RESUME_PRINT" to continue. Then it heats up and does the thing. I was wondering if you had any experience working with Octoprint as I'd like to make it give a nice pop-up when a print resume is available. Is this something you've any experience in or should I go delve in to the Octoprint codebase? Thanks |
@CorvetteCole - I do not have any experience with OctoPrint development. It is possible that @mmone may be able to help. -Kevin |
@mmone I would appreciate any tips! Thanks |
Any further updates on this issue? -Kevin |
@KevinOConnor thanks for the reminder. I've been working on trying to integrate it with Octoprint and not just in the Klipper terminal. I'm not sure when that will happen, so I think I will clean up what I have now and submit a pull request for that. It is useful as-is just not user friendly. Perhaps a plugin for Octoprint similar to OctoKlipper would allow me to create a user interface based on the terminal command. Please keep this open for a little longer, I'm quite busy with starting a 3D printing company and I need it open to remind me! |
Any further updates on this? I don't think we need to leave this open on the Klipper issue tracker. -Kevin |
I agree. I will continue working on this and merge it when I am happy with
it.
…On Sat, Oct 19, 2019, 6:10 PM KevinOConnor ***@***.***> wrote:
Any further updates on this? I don't think we need to leave this open on
the Klipper issue tracker.
-Kevin
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1645>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AESS5DJDRQQ4Q7QKYKUG2H3QPOAW5ANCNFSM4HNRWFVQ>
.
|
Okay, let us know when you are ready. -Kevin |
Hey, any updates on this? |
@CorvetteCole do you have a repository you can share where you are working on this? I would also like this feature and I can do development as well. |
I was developing it privately @bjones14 but I can find and release the code in a repo as-is if you give me a little bit |
Hi @CorvetteCole. Have you had a change to release the code into a repo yet by any chance? We have power cuts twice a day in South Africa, so I really need to get this working, or revert to Marlin firmware which has this functionality already. Thanks. #MustBeNiceLivingInFirstWorldCountry |
@CorvetteCole did this become a thing? :) |
@Bob90 wow, this is a trip. So sorry everybody for completely forgetting this. I've gotta find the old repo, I've been wanting to redo this code though |
@corvettecope no problems. So many great ideas, but I appreciate that implementation takes time. Was reading this and just wondered. Doesn't hurt to ask either :) |
Hello @CorvetteCole any update please? :) |
Unfortunately @ice2009 I went to test the old code and I couldn't get it working properly. I think it might be worth rewriting an implementation of this |
@CorvetteCole: Could I take a look at your code? I can not find it at your github page. |
Hello, Can we use this mini UPS module with klipper to make print recovery possible? Using one of Rpi's GPIO pin to detect the power outage status(HIGH if power outage detected) from UPS Module to pause and store the info....It does provide enough power to raise the Z axis and store the data. |
Hi, I am working on an implementation of power-off recovery and wanted to everyone to be aware of it/review my implementation design.
This implementation would depend on a power panic board, much like the Original Prusa i3 Mk3. It would add a new config option for specifying the power panic pin.
Additionally, this assumes the power supply would provide around a second of operation after wall power is lost. Alternatively, the Raspberry Pi and MCU could be powered off of a 5v battery or some form of capacitor setup to substitute.
Here is how it would work:
If you have any concerns or advice regarding this implementation please let me know. I have looked through the code a lot and read the documentation and will be fully implementing this and sending a pull request soon.
Thanks!
Cole
klippy.log
The text was updated successfully, but these errors were encountered: