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.


  • administrators

    @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 pumped 🙂

    I 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.


  • administrators

    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.


  • administrators

    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.


 

Looks like your connection to Duet3D was lost, please wait while we try to reconnect.