Pause/Stop AND Resume

Is there a way ti implement a pause and restart even after power down or loss? I don't like to leave my printer running while I am sleeping for fear of waking up in a fire! It seems like it should not be that hard to do. That would be at the top of my wishlist!

It's been on the firmware wish list for a while. There are some practical issues.

Either you must be able to home your printer when there is a print on the bed, or you must know that the head won't move when you power it down and up again;

The print must not detach from the bed when the bed heater is turned off and the bed cools down;

You need some mechanism to allow you to heat up the nozzle again and re-prime it before you resume the print, because typically re-heating the nozzle causes ooze followed by under extrusion, unless your hot end tolerates a large amount of retraction.

Also it is possible to do this currently by pausing the print, recording the z-height, powering down, editing out everything prior to the aforementioned z-height, and then printing the edited gcode file.

DC42 my prints stick almost too good at times and retract is not an issue, Print head will not move and as for priming maybe just move to extreme xyz cooridinates of choice after power up and reheat, starting with last known position, would solve that issue. As for doing it now you would have to know last x y and z position and that is a huge PITA to do on a regular basis.

If that's the case then you can get part way there through providing an alternative source of 5V for the Duet that you don't mind leaving on (like a usb wall plug).

You can then press pause (with the appropriate pause.g this can park the head at extreme of XYZ)

Then turn off the main power, leaving the board powered by the 5V usb or 5V external power.

Assuming you home to XYZ max, on main power on you have a macro that homes XYZ, heats nozzle, primes the nozzle (maybe add a prime bucket and brush at XYZ max?) Then resumes the print. This works as long as the 5V supply to the Duet is uninterrupted.

In the longer term the ability to save the current file, position etc is on the wishlist. Being able to do this gracefully and move the head away from the print so it does not melt in as it cools would slow for power failure to be handled.

Power failure is for me not an issue as I have a UPS. I would imagine to have a power failure option the print would have to run directly off the micro sd card and have some type of placeholder monitor each step of the print, unless there is some type of non volatile memory on board. Some printers can do it but not sure how they implement it. Would it really require re homing if the board remained powered, providing nothing moved? The long term "pause" would be, for me, a great option. I don't think any part of these printers are safe enough to leave unattended. Mosfet, relays, and SSR's can all fail to the closed position and overheat hotends and heat beds. I use 2 on each circuit now 1 on the hot and 1 on the neutral or ground so if one fails the other will still turn it off. But it also means that you have to check them regularly. I think that, but I could be wrong, the Duet Wifi can turn off the power supply in a thermal runaway situation provided that the power supply has remote turn on feature and you don't get a faulty temp sensor reading. Sure people do it, but really most of this stuff is cheap Made in China crap (Duet not included in that list) with no real regard for human safety. I guess I could build a steel box lined with fire brick and have an automatic sprinkler system installed…...

Well if you have a UPS then you can achieve this with a separate 5V supply as I describe assuming you are happy with a low power 5V supply left unattended. You don't have to have a remote controlled power supply as you are doing this intentionally so you can switch your main supply to VIN on and off manually.

You may not need to rehome, if you are certain that nothing would move. Assuming your homing is accurate then it does not hurt.

One thing to be aware of is ground loops when you have both the VIN power and the 5V power plugged in, they should be plugged into the same ground.

Its hard not to conclude that David's points cover a large number of potential use cases where it would not be practical:
-ABS prints
-Machines where homing with a print on the bed is difficult, most/all can do it in x and Y but potentially only deltas can do it for Z also, and even then most use a probe which needs to contact the bed to fine tune z, which could be obstructed.
-Having the head move to the edge of the bed and extrude 20mm, then retract and resume isn't that much trouble compared to scrapping the print and beginning again.

I suspect that a UPS might be a much more reliable solution but for a large printer, running a long print it might only solve it sometimes.

On the other hand, tracking print state goes a long way towards supporting my request for better/expanded M581 support. Specifically, by having a location where last (or current) print step (head position, temperatures, file position, ?) is stored as the print or macro is processed, the system can know that it has just restarted from an interrupt event. Then the user could configure or the system could offer re-start steps (with the optional assumption that the hardware has not moved since the interrupt event) - e.g. heat up, home safely, extrude 10mm, wipe, resume from last position. Don't mind if there is a requirement to maintain 5V power to hold this, especially given the finite limit and speed of SD card writes.
The point about M581 here is that the recovery steps could be 'restore state and pause' - which likely still gets the burning hotend off the printbed faster than me running to the printer and twisting the lead screws by hand. Even more options if the stored information knows which endstop was triggered.
I think I will go and change my cartesian printer 'home Z' code to use Y max instead of Y min now.

Maybe a solitary 18650 cell configured as a backup power source would be enough to move the z axis down a few mm on power loss and maintain the duet's power/ram? I imagine a fully charged cell would have enough capacity to move a motor a small distance and keep the board running for quite a while. Issues there sure but imagine a truly fault tolerant setup. The duet-printsaver add on.

Tried to pause a print as suggested and it does not work. 5v does keep the Duet powered but not the display properly (7"), but the heater goes into fault and print ends. I guess I should have tried it before needing it. 14+ hours of printing….............down the drain DON'T TRY THIS AT HOME IT DOES NOT WORK.

If you are using a 7 inch PanelDue you need to supply enough 5V run that (650mA just for the screen so at least 800mA in total).

The heater protection will kick in when it notices that the heater temperature is falling, but the firmware is trying to keep it at temperature. You can reset the temp fault using
M562 https://duet3d.com/wiki/G-code#M562:_Reset_temperature_fault
then return the heater to the correct temperature, prime, wipe, home etc, then resume.

This definitely requires testing before trying on a live print, I am sorry you lost 14h of printing! When I get a chance i will try it on on a printer here that I can add an external 5V supply to.

So I need to supply 5V to the panel and the Duet independently? I had a 1.8A wall wart plugged into the Duet and the Panel was flickering. Should it run from a single USB connection? The print went to 100% as soon as the main power was removed.

I have found recently though some chargers will only provide full current when they receive data from the device they are connected to, i.e. they aren't dumb power supplies. I have a Yotaphone 2, which will only draw 900mAh from a generic charger but can go to 2000 mAh from its supplied charger (which fails if you connect it with a cable where the two data lines are not connected or if the cable is too long).

@t3p3tony ,It would seem then if one just pauses and uses an external heater control you could simply shut the heater pod controls down for nozzle and bed and than resume later on. That way no dependency upon control board for bed and nozzle. Many already do something similar for the bed when using ssr’s and mains heaters. Other than needing to have a placement for a couple of paid controllers somewhere on the machine it eases the process and you can simply turn the heater back on, wait until temp desired achieved and hit resume. This is a nice feature and being able to pause and have the print head move to the side at a designated x/y/z would also allow for unique prints where you may want to embed an item or structural brace of another material like metal for customized applications. Just don’t knock the print out of place while adding foreign material.

Obsessed with knowledge and growth. Learning never stops and everyday equates to another day learned. Being polite isn’t always easy. The fundamental essentials in learning require patience and kindness towards others. Knowitalls knowitless.

@t3p3tony ,It would seem then if one just pauses and uses an external heater control you could simply shut the heater pod controls down for nozzle and bed and than resume later on. That way no dependency upon control board for bed and nozzle. Many already do something similar for the bed when using ssr’s and mains heaters. Other than needing to have a placement for a couple of paid controllers somewhere on the machine it eases the process and you can simply turn the heater back on, wait until temp desired achieved and hit resume. This is a nice feature and being able to pause and have the print head move to the side at a designated x/y/z would also allow for unique prints where you may want to embed an item or structural brace of another material like metal for customized applications. Just don’t knock the print out of place while adding foreign material.

Not sure that I understand this. You can already use pause and resume to do all of what you suggest. Look up M25 , M24 and M226. However, this thread is all about what happens in the event of a power failure. In that case you lose power to the Duet and so it loses all the positional information so you need a mechanism to keep sufficient power to be able write the positional information to a file for later retrieval.