end.g is possible?
-
Good day!
Tell me, is there a possibility to call a macro in RepRap firmware after printing is finished? Similar to start.g when starting?
Macro stop.g, as I understand it, is called only when you manually stop printing? -
Stop.g will also be called by M0 if it is present. So you can add M0 to your slicer end gcode, which will run stop.g.
https://duet3d.dozuki.com/Wiki/GCode#Section_M0_Stop_or_Unconditional_stop
-
It is inconvenient to set up g-code M0 (or any other completion commands), because sometimes you don’t know when to start printing the method of completion.
Example: I have removable glass, so after printing is completed, usually, you do not need to turn off the power part of the printer, just remove the glass with the printed model, insert a new one and continue printing.
However, sometimes you have to leave the printer to print alone.
In this case, it is logical for the printer to seal, cool, and turn off the power section.
If there was a call to the end.g macro, it would be possible to change it before leaving and the printer would change the behavior.
It is simply impossible to edit the model code at the time of printing.
Moreover, the ability to foresee I still have a little pumped -
You can call your own end.g macro at the end of the print by putting it in the relevant section of your slicer. That's what I do.
-
Thank you, this option seems to be the only one.
I was hoping that I didn’t read the documentation well and there are other options that are more automatic. -
@anidal said in end.g is possible?:
It is inconvenient to set up g-code M0 (or any other completion commands), because sometimes you don’t know when to start printing the method of completion.
Example: I have removable glass, so after printing is completed, usually, you do not need to turn off the power part of the printer, just remove the glass with the printed model, insert a new one and continue printing.
However, sometimes you have to leave the printer to print alone.
In this case, it is logical for the printer to seal, cool, and turn off the power section.
If there was a call to the end.g macro, it would be possible to change it before leaving and the printer would change the behavior.
It is simply impossible to edit the model code at the time of printing.
Moreover, the ability to foresee I still have a little pumpedI don't see why you can't put M0 at the end of your print. If stop.g isn't present, M0 will take default actions, such as turning all the heaters off. But if stop.g is present then it runs that file instead.
-
Only runs the file and does not do any other action?
Based on the description of the command M0, the printer still starts cancel.g, turns off stepper motors, heaters and only then starts stop.g.
Somewhat not the behavior that would be desirable. -
Yes, if stop.g is present then M0 just waits for all moves to complete, sets the printer state to "idle", and runs the file. Even if stop.g isn't present, M0 doesn't turn the motors off.
-
I have to admit that the use of M0, M1 is confusing, and does not allow enough freedom.
Why not only execute the corresponding macro, and provide a default one with what is described in the documentation? This way, we could tune it to match our exact needs...
-
Fine! Probably, it is necessary to update the documentation so that there are no discrepancies.
-
I'll review the M0/M1 code before the next beta and update the documentation. The intended behaviour is:
- Wait for all moves to complete.
- Close the SD print file and change the printer status to Idle.
- If M0 was received while the printer was paused, execute cancel.g if it exists, else stop.g.
- If M0 was received while the printer was not paused, execute stop.g.
- If M1 was received, execute sleep.g.
- If the appropriate macro file is not found, take default action, which is to turn all heaters off. Motors are left on (but as always, if they are all idle for the idle timeout period then the motor currents will be reduced to the idle percentage).
-
@dc42 said in end.g is possible?:
I'll review the M0/M1 code before the next beta and update the documentation. The intended behaviour is:
- Wait for all moves to complete.
- Close the SD print file and change the printer status to Idle.
- If M0 was received while the printer was paused, execute cancel.g if it exists, else stop.g.
- If M0 was received while the printer was not paused, execute stop.g.
- If M1 was received, execute sleep.g.
- If the appropriate macro file is not found, take default action, which is to turn all heaters off. Motors are left on (but as always, if they are all idle for the idle timeout period then the motor currents will be reduced to the idle percentage).
I would say this seems to be the case. I use M0 to call stop.g. I haven't tested the other behaviours in quite some time though.
-
I know this is probably a nitpicky issue, but it would be nice to have an automatic trigger so you don't have to call M0 in the slicer end code. I try to decouple as much from the slicer as possible, so there are a couple use cases where this could be polished. start.g and stop.g is one of them.
-
@ctilley79 said in end.g is possible?:
I know this is probably a nitpicky issue, but it would be nice to have an automatic trigger so you don't have to call M0 in the slicer end code. I try to decouple as much from the slicer as possible, so there are a couple use cases where this could be polished. start.g and stop.g is one of them.
You waited two years to respond?
You must have really given it a lot of thought first.
Frederick
-
This post is deleted! -
@fcwilt said in end.g is possible?:
@ctilley79 said in end.g is possible?:
I know this is probably a nitpicky issue, but it would be nice to have an automatic trigger so you don't have to call M0 in the slicer end code. I try to decouple as much from the slicer as possible, so there are a couple use cases where this could be polished. start.g and stop.g is one of them.
You waited two years to respond?
You must have really given it a lot of thought first.
Frederick
I figured two years was enough time to let the thought simmer in DC42's mind lol
-
Whoever reads this, you might vote this one up: https://forum.duet3d.com/topic/20708/start-g-end-g
Sorry have not seen this post when I put my request in the wishlist so I opened another post! Since my usecase is more detailed then here, I recommend to swap over to my request? -
@dc42 If I execute stop.g via M0 at the end of my gcode-file, is it ok to have M0 inside of stop.g again to shut off the heaters?
-
@skimmy said in end.g is possible?:
@dc42 If I execute stop.g via M0 at the end of my gcode-file, is it ok to have M0 inside of stop.g again to shut off the heaters?
That's a good question! I haven't tested it.
-
Hi @dc42 ,
I thought maybe, given how old this thread is, this had already been implemented, so I updated firmware. But alas no. I just tested and it does not. Hence my print ends with the hot end sitting against my print, still hot for 2 hours until I wake up.
Adding M0 manually to the end of the gcode via the slicer is a poor implementation.
M0 is a STOP or Unconditional STOP. Which that's exactly what it should do. STOP. Not, oh run this other gcode now.
In addition, I print from multiple printers and often use different slicers. Not only do I not want to apply this change to every slicer, I have different requirements for the end of a print for each machine. Therefore, it makes vastly more sense for the firmware to have a machine specific end.g to be appended to the end of each job. This way, I can customise the end print for each machine and don't have to have multiple machine profiles (so much) for each slicer.I vote this UP. Please provide the facility to append the content of an end.g file to the end of every job.
Thanks
Adrian