# Standby hotend and bed heating with inactivity timer after print?

Is there any G-code command to turn off hotend/bed heating after a specified timeout? I'd like to edit my end G-code to leave them heated to a standby temperature, rather than immediately letting them cool down, to eliminate the delay of re-heating between prints, but obviously it's not a good thing to leave them heated indefinitely.

• Note: if you leave the hot end at extrusion temperature too long without extruding filament, the filament material will carbonize and stop up your hot end. Jul 6 '19 at 14:26
• @PerryWebb: Is that an issue at something like 170°¢, just below extrusion temp? I was under the impression even the "preheat PLA" temp of 185°C was deemed ok to dwell at for a while without issues. But this is another good reason for having a timeout, aside from safety & energy use. Jul 6 '19 at 20:51
• Eventually, but that should give you a lot more time. Getting the hot end to temperature usually doesn't take long. It's getting the bed to temperature that is slow. The only issue with keeping the bed heated is it makes getting the print off the bed hard. The thermal coefficient of expansion causes the print to release from the bed when it cools. You can pry PLA off a bed heated to 70C or below. However, ABS on a bed at 110C will warp if you pry it off without cooling. Jul 6 '19 at 21:04
• I'm actually leaning towards switching away from heated bed entirely for PLA anyway, but normally I remove prints at 60°C with no problem. Been a while since I used PETG but I don't recall having trouble removing them hot either. I find getting nozzle from 20 to 215 and bed from 20 to 60 take almost exactly the same time, though. Jul 6 '19 at 21:14
• For ABS with the bed at 110C, I wait until 65C. By that time the print is completely loose. I've removed PLA at 60C, but it is much easier below 40C, when it starts to release. Jul 6 '19 at 22:49

## 1 Answer

### Pausing

You could set temperatures for hotend and bed (respectively M104 and M140 and after that introduce a pause/dwell time with G4. After the pause, you could lower temperatures and proceed the shutdown of the printer, as such the setting of the idle temperatures and dwell time need to be done in the beginning of your end G-code in your slicer.

### Not powering down

Alternatively, you could just not power down the hotend and bed. A typical end G-code consists of de-powering the fans, steppers, temperatures and positioning the head in a parking position, e.g.:

 M106 S0              ; Turn fan off
M104 S0              ; Turn extruder off
M140 S0              ; Turn off bed
// G91                  ; Change to relative positioning
// G1 Z30 E-2 F3000     ; Raise Z 30mm (lowers the bed) NEVER DO THIS, IT WILL DESTROY YOUR PRINTER IF YOU PRINT LARGER THAN MAX-Z MINUS 30 MM
// G90                  ; Switch back to absolute mode
G1 X0 Y0             ; Move X/Y to origin
M84                  ; Disable steppers


You could easily change the temperatures to standby values:

 M106 S0              ; Turn fan off
M104 S160            ; Turn extruder to standby
M140 S40             ; Turn bed to standby
// G91                  ; Change to relative positioning
// G1 Z30 E-2 F3000     ; Raise Z 30mm (lowers the bed) NEVER DO THIS, IT WILL DESTROY YOUR PRINTER IF YOU PRINT LARGER THAN MAX-Z MINUS 30 MM
// G90                  ; Switch back to absolute mode
G1 X0 Y0             ; Move X/Y to origin
M84                  ; Disable steppers

• Wouldn't the dwell command leave the printer in a state of "still processing SD card print job"? If so, I don't think that behaves well with respect to removing the SD card. Maybe I just need to run one of the print servers you can queue jobs through and all rather than moving each revision of a test over via SD card.. Jul 6 '19 at 4:26
• @R.. If you "dwell" indefinitely, you could abort the print, insert a new SD card and continue.
– 0scar
Jul 6 '19 at 9:09
• Yeah, that's a possibility. I was looking for something less hackish (and with less manual steps each time) but maybe there isn't one. Jul 6 '19 at 21:16
• Hmm, maybe M85 Inactivity Shutdown? I'm not sure how widely supported it is though. Guess I can try it. Jul 6 '19 at 23:05