auto save on loss of power from a different pin (endstop?)
-
Yep should run pause.g... need to check if M226 save the position (I think it does but I have not tested that). Pause is not permanently blocking though, once the macro has finished running you can then carry out other commands.
I would not have an automatic resume unless you are 100% sure that it wont cause issues. What about different bed temps in different prints, or if the power is down for long enough that the UPS runs out of power, the HB cools down and the print detaches?
-
Hmmm not sure, I think when I configure the resume trigger to rising edge it should not trigger when the UPS loss it power - since the input will be already high before Duet even boots up.
Only problem will be when a next power cycles goes, this could trigger it.
But yeah - I wont automatic resume only when the power doesn't go down.Different bed temps should be a problem since I will keep the bed on to it's set temperature when running from UPS.
-
fair enough. you can test all of this using a switch plugged into the chosen pin before using the UPS so you can see if the ressuract file is being saved.
-
Trigger is already working. Some questions more:
as far I know it is not possible to have different macros for rising and falling edge? It would be nice to put in on the firmware wish list.
But I have a different idea - can I use in trigger2.g M583 to wait for E1 endstop to go back to high? When M583 stops executing the macro I could put the restore commands after it.And one question more. How can I suspend the hotend so I can restore it temp after power goes back? I see they is a M144 but it only works with beds.
-
Yes you can have different macros for rising and falling edge.
If you have only one hot end then you can do T-1 when pausing to put the hot end in standby. To reselect it, send T0 (assuming it is tool 0) followed by M116 to wait for it to reach temperature.
-
@dc42 Wait.. just use next trigger so it runs trigger3.g. Didn't think about that.
Yes I have one hotend for now so it will work.But thinking further it would be better to use M583 then a second trigger. This would prevent any triggering when the UPS batteries run out of power and the power goes back. Other option would be to enable the restore trigger in the power save trigger. And with S-1 I can disable a trigger I am right?
-
@dragonn, yes you can disable a trigger with S-1 in the M581 command.
-
It works! Only problem with I had was M226 didn't work, seems like it doesn't stop executing the macro until pause.g is finished. But M25 works perfectly fine, posting this because maybe it will be useful for someone else.
-
M226 is intended for use in the GCode file being printed, for example to pause after a particular layer has completed. So it waits until all the moves in the queue have been completed. M25 is intended for use from a different source of GCodes.
-
@dc42 said in auto save on loss of power from a different pin (endstop?):
M226 is intended for use in the GCode file being printed, for example to pause after a particular layer has completed. So it waits until all the moves in the queue have been completed. M25 is intended for use from a different source of GCodes.
I have updated the gcode documentation to reflect this.