WirelessPrinting
WirelessPrinting copied to clipboard
Implement "Abort Print" function
Implement "Abort Print" function (there is a button for it in the Cura GUI on the "Printer Monitor" tab).
How would this actually have to work? Skip all commands until the ;End GCode
?
My printer likes something like this to end a print:
;End GCode
M104 S0 ;extruder heater off
M140 S0 ;heated bed heater off (if you have it)
G91 ;relative positioning
G1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure
G1 Z+0.5 E-5 X-20 Y-20 F50.0 ;move Z up a bit and retract filament even more
G28 X0 Y0 ;move X/Y to min endstops, so the head is out of the way
M84 ;steppers off
G90 ;absolute positioning
M104 S0
Is there a generic way to do this, or can I query the (Marlin) printer for the correct end sequence?
Check M108, M112, M410
M112 - Emergency Stop Used for emergency stopping, M112 shuts down the machine, turns off all the steppers and heaters, and if possible, turns off the power supply. A reset is required to return to operational mode.
M112 is the fastest way to shut down the machine using a host, but it may need to wait for a space to open up in the command queue. Enable EMERGENCY_PARSER for an instantaneous M112 command.
http://marlinfw.org/docs/gcode/M112.html
and
M410 - Quickstop Stop all steppers instantly
Stop all steppers instantly. Since there will be no deceleration, steppers are expected to be out of position after this command.
http://marlinfw.org/docs/gcode/M410.html
Actually this seems to be working, at least from Cura:
https://github.com/probonopd/WirelessPrinting/blob/427d8d4d9411a73ebf3416fc4d4ece6d374b3820/ESP8266WirelessPrintAsync/ESP8266WirelessPrintAsync.ino#L743-L744
It would be nicer, though, if we could somehow extract the end gcode and send that, or at the very least move the nozzle up a few centimeters before the M112.
The real problem is...every slicer write the same info to let us be able to do that? Otherwise we have to write a per slicer handling (and also scan and interpreter gcode to find these info)
I'm not familiar but You could check into OctoPrint what actually happens there. It would be shame to restart printer after aborting?
What about an user configurable endgcode?
configurable
Let's try to avoid configurability where we can. Whatever can be configured can be configured wrong.
I think that current abort print is a bit too excessive. Can we just stop sending GCODE commands to printer? Power cycling whole printer seems a bit excessive.
Imagine you are not at home and you see via the camera that something terribly bad is going on. I guess you want to reset the printer in those cases. Also, we are now sending more than one line of GCODE, so that simply sending no more might still result in activity for a while which may be undesirable.
I'm never leaving printer alone because I don't trust it 🤷♂️ Well, could we have at least both? Graceful stop, and nuke from the orbit stop?
We could make it a "defined" variable and I could use M410 instead of M112
What advantage does M410 give you over M112?
I assume that I don't have to power cycle my printer after M410?
I don't know but what is the problem with power cycling? If it increases safety...
Because it takes so much longer. When You abort a print on OctoPrint it doesn't do this. If I'm aborting print, it's because I changed my mind, or I can see that it will fail, or I chose wrong gcode (and noticed during heating that I want another one), or I noticed that I want different color filament. I'm not having emergency 5 times a day, I'm just aborting a print. Especially that printer is 30 cm next to me, on my desk.
If it would be emergency, I don't need to send M112, I just cut off power to printer.
Emergency Stop != Abort Print
Emergency Stop != Abort Print
Agree, let's have 2 buttons. Pull request welcome.
What about abort print from Cura?
Isn't Cura sending C-code? I have not checked how it works.
https://github.com/probonopd/WirelessPrinting/blob/master/ESP8266WirelessPrintAsync/ESP8266WirelessPrintAsync.ino#L307
Any news on this? Every time I abort a print, I get very upset about having to power cycle printer - ESP gets power cycled as well, Cura looses connection, a somewhat frustrating experience. Or is this project abandoned?
Pull requests welcome.
AFAIK M112/M410 may not be executed immediately. It depends on how firmware is compiled (EMERGENCY_PARSER). In worst case printer will need to purge all queue commands before they can do their job. With EMERGENCY_PARSER best will be M410 (abort all commands) and a custom gcode (on SD or hardcoded)
These are Marlin gcodes, don't know if worldwide supported
For me, every other option would be better than current situation since it moves the printer into inoperable state until power cycled. Actually just stopping sending further codes and letting the printer finish its queue seems acceptable. Above @probonopd described a use-case with monitoring the print via webcam remotely and needing to shut the machine immediately. I would argue that if printer has been failing for some time (you don't watch every second of printing via webcam, do you?), a couple of extra seconds of printing would not matter much.
What does matter though is that the print will be stopped with certainty, and the hotend and heatbeds will be switched off with certainty.
Both M112 and M410 turn off heaters and steppers (Position is not valid after M410 since it abruptly stop moving motors, not sure about m112)