forked from rootiest/zippy-klipper_config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSET_IDLER.cfg
108 lines (98 loc) · 3.73 KB
/
SET_IDLER.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# Use SET_IDLER to control idle timeout and behavior
#
# The default behavior is to only turn off the extruder heater.
# Set a parameter to 1 to keep that component on and 0 to turn it off.
#
# Examples:
#
# Power off printer after 15 minutes:
# SET_IDLER TIME=900 POWER=0
#
# Turn off only the bed_heater after 5 minutes:
# SET_IDLER TIME=300 EXTRUDER=1 BED=0
#
# Turn off only extruder after 1 minute:
# SET_IDLER TIME=60
#
# Turn off bed and extruder, set chamber, but leave steppers on after (default) 15 minutes:
#
# SET_IDLER EXTRUDER=0 BED=0 CHAMBER=0 STEPPERS=1 POWER=1
#
#
# The CHAMBER section offers several options depending on your configuration.
#
# The first is my personal config, which sets the chamber fan target to the temperature
# read by my ambient room temperature sensor
#
# The second is for if you have an active chamber heater.
#
# The final one just sets the chamber fan to off.
# You could instead set the target to any arbitrary value you like by changing the target on that line
#
# If you don't have any chamber temperature components, you can just comment out all three options.
[gcode_macro SET_IDLER]
description: Sets the idle timeout and behavior
variable_extruder: 0
variable_bed: 1
variable_chamber: 1
variable_steppers: 1
variable_power: 0
gcode:
{% set VAR_POWER = printer["gcode_macro SET_IDLER"].power %}
{% set VAR_BED = printer["gcode_macro SET_IDLER"].bed %}
{% set VAR_EXTRUDER = printer["gcode_macro SET_IDLER"].extruder %}
{% set VAR_CHAMBER = printer["gcode_macro SET_IDLER"].chamber %}
{% set VAR_STEPPERS = printer["gcode_macro SET_IDLER"].chamber %}
{% set POWER = params.POWER|default(VAR_POWER)|int %}
{% set TIME = params.TIME|default(900)|int %}
{% set BED = params.BED|default(VAR_BED)|int %}
{% set EXTRUDER = params.EXTRUDER|default(VAR_EXTRUDER)|int %}
{% set CHAMBER = params.CHAMBER|default(VAR_CHAMBER)|int %}
{% set STEPPERS = params.STEPPERS|default(VAR_STEPPERS)|int %}
SET_GCODE_VARIABLE MACRO=SET_IDLER VARIABLE=power VALUE={POWER}
SET_GCODE_VARIABLE MACRO=SET_IDLER VARIABLE=bed VALUE={BED}
SET_GCODE_VARIABLE MACRO=SET_IDLER VARIABLE=extruder VALUE={EXTRUDER}
SET_GCODE_VARIABLE MACRO=SET_IDLER VARIABLE=chamber VALUE={CHAMBER}
SET_GCODE_VARIABLE MACRO=SET_IDLER VARIABLE=steppers VALUE={STEPPERS}
SET_IDLE_TIMEOUT TIMEOUT={TIME}
[gcode_macro _IDLER]
gcode:
{% set POWER = printer["gcode_macro SET_IDLER"].power %}
{% set BED = printer["gcode_macro SET_IDLER"].bed %}
{% set EXTRUDER = printer["gcode_macro SET_IDLER"].extruder %}
{% set CHAMBER = printer["gcode_macro SET_IDLER"].chamber %}
{% set STEPPERS = printer["gcode_macro SET_IDLER"].chamber %}
{% if POWER == 0 %}
# Disable steppers
M84
# Disable all heaters
TURN_OFF_HEATERS
# Run macro to turn off relay or smart switch
_POWER_SAVE
{% endif %}
{% if STEPPERS == 0 %}
# Disable steppers
M84
{% endif %}
{% if BED == 0 %}
# Disable bed heater
SET_HEATER_TEMPERATURE HEATER=heater_bed
{% endif %}
{% if EXTRUDER == 0 %}
# Disable extruder
SET_HEATER_TEMPERATURE HEATER=extruder
{% endif %}
{% if CHAMBER == 0 %}
# Set chamber heater fan target to ambient room temp
{% set chamber_target = printer["temperature_sensor ambient"].temperature|default(25)|float %}
#SET_TEMPERATURE_FAN_TARGET temperature_fan=chamber target={chamber_target}
# Turn off active chamber heater
# SET_HEATER_TEMPERATURE HEATER=chamber
# Turn off chamber heater fan
#SET_TEMPERATURE_FAN_TARGET temperature_fan=chamber target=0
{% endif %}
[idle_timeout]
timeout: 900
gcode:
# Run the idler macro
_IDLER