Code to cool the head when I stop?
-
There are multiple reasons I might find my printer paused. The new filament sensor is one. Regardless of the cause, is there a way I can code a head cooldown (and then heat back up) for suspend/resume?
-
You need to look at M568
https://docs.duet3d.com/en/User_manual/Reference/Gcodes#m568-set-tool-settingsBefore you print use it to set the active and standby temps.
In pause.g use it to put the tool in standby mode
In resume.g use it again to put the tool heater in active mode
Make sure you use M116 after this last step so it waits for the tool to heat up before the print resumes. -
@zBeeble an alternative approach is to have your pause code (probably pause.g) write the temperature of the nozzle heater into a global variable, then switch it off. Your resume code can then read the temperature from the variable and switch it on and wait.
-
@achrn global variable? This is part of g-code I don't have in my repertoire ... can you paste up an example?
-
@zBeeble If you're needing to figure something out either way, and just wanting to handle printer pausing during print, probably best to use the active and standby approach suggested using M568, but if you were already using variables or have another use case this is an alternative.
See https://docs.duet3d.com/en/User_manual/Reference/Gcode_meta_commands#variables
RRF has variables you can write to and then refer to in gcode by putting the name inside {these}. It also has local variables that stay inside one gcode file, useful for loops and things.
You could have in config.g something to create an empty variable:
if !exists(global.nozt) global nozt = -1
Which creates a global if it doesn't already exist.
Then in your pause.g have something like
set global.nozt = heat.heaters[1].active
before you switch off the tool heater (or switch it to standby) (this assuming your nozzle in the tool is heater 1). Then any subsequent code can know what the temperature had been (by referring to global.nozt) e.g. with
G10 P0 S{global.nozt}
to switch back on with taht setpoint.The advantage this has is if you are doing other things with the temperature besides just standby and resume. I have some physical buttons on my printer which heat and feed filament (mainly when doing a manual colour change and flushing some through), so I want the printer to know the extrusion temperature of the filament currently loaded easily, so I write that into a global variable and use it both when resuming after pausing and when heating the tool (potentially from fully cold) to feed some filament.