Thermistor Over-temp/Pause & Auto Resume Conditional g-Code



  • Can anyone help me figure out a way to automatically pause a print if one of the temperature chanels overshoots a preset threshold? Is there a way to set this up using conditional g-code?

    If so, can you also help me make a statement that will automatically resume the print once the temperature drops below a set threshold?



  • Presumably your usage case does not require a shutdown or other more definite action in the event of a heater fault or you will have set the firmware to take such action above a certain threshold.

    You could monitor a heater or sensor in daemon.g and use something like the following.
    You have to create the file and put it in /sys
    Note, this hasn't been checked for correct syntax etc.
    It's just a general guide.

    EDIT: Also you have to consider that this would resume any paused print if the temp was under the set value, regardless of why it was paused! You have to figure out how to differentiate the reason it was paused. Until we get variables that's a bit harder. You could maybe set a dummy fan value or something.

    if {(heat.heaters[nnnn].current > 150) && (state.status = "printing")}
    	M25 ; pause
    if {(heat.heaters[nnnn].current < 150) && (state.status = "paused")}
    	M24 ; resume
    G4 S10 ; wait 10 seconds before checking again.
    

Log in to reply