forked from 3DPrintDemon/Demon_Klipper_Essentials_Unified
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemon_chamber_heater_v1.0.cfg
111 lines (76 loc) · 4.65 KB
/
demon_chamber_heater_v1.0.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
109
110
111
###################################################
#######>>>>>>>>>> 3DPrintDemon <<<<<<<<<<<#######
####### https://github.com/3DPrintDemon #######
# IF YOU USE & LIKE THESE MACROS PLEASE CONSIDER SUPPORTING MY EFFORTS AT
# https://www.https://ko-fi.com/3dprintdemon
[gcode_macro _C_HEATER_VARS]
variable_min_thresold: 20
variable_max_thresold: 60
variable_mid_point: 40
gcode:
[gcode_macro _CHAMBER_HEATER_READ]
gcode:
{% set c_heater_vars = printer["gcode_macro _C_HEATER_VARS"] %}
{% set Temp = printer['temperature_fan chamber'].temperature %}
RESPOND TYPE=COMMAND MSG="Chamber Heater: Current chamber temp {Temp}c"
RESPOND TYPE=COMMAND MSG="Chamber Heater: Minimum thresold {c_heater_vars.min_thresold}c"
RESPOND TYPE=COMMAND MSG="Chamber Heater: Mid point {c_heater_vars.mid_point}c"
RESPOND TYPE=COMMAND MSG="Chamber Heater: Maximum thresold {c_heater_vars.max_thresold}c"
[gcode_macro _CHAMBER_HEATER_MONITOR]
gcode:
{% set start_vars = printer["gcode_macro _START_VARIABLES"] %}
{% set core_vars = printer["gcode_macro _CORE_VARS"] %}
{% set c_heater_vars = printer["gcode_macro _C_HEATER_VARS"] %}
# {% set Temp = printer["temperature_fan chamber"].temperature %}
{% if core_vars.chamber_thermal_sensor == 0 %}
{action_raise_error("This error is caused by no correctly named chamber sensor being available to the macro! Check the system is setup correctly!")}
{% elif core_vars.chamber_thermal_sensor == 1 %}
{% set Temp = printer["temperature_fan chamber"].temperature %}
{% elif core_vars.chamber_thermal_sensor == 2 %}
{% set Temp = printer["temperature_sensor Chamber_Temp"].temperature %}
{% endif %}
# {action_respond_info("Enclosure Temp %3.2fC " % (Temp))}
{% if start_vars.danger_will_robinson != True %}
{action_raise_error("This error is caused by you not agreeing to full & sole reasonability/liability of using a chamber heater with these macros before first use. Check demon_user_settings file for variable_danger_will_robinson & agree to the terms!")}
{% else %}
{% if printer.print_stats.state not in ["printing", "busy"] %}. #,"paused"
SET_HEATER_TEMPERATURE HEATER=Chamber_Heater TARGET=0
RESPOND TYPE=COMMAND MSG="Chamber Heater: Not Printing, Chamber Heater Control stopped, setting heater OFF"
UPDATE_DELAYED_GCODE ID=_CHAMBER_HEAT_CONTROL DURATION=0
{% else %}
{% if printer["output_pin DISABLE_CHAMBER_HEATER"].value == 0 %}
{% if Temp < c_heater_vars.min_thresold %}
SET_HEATER_TEMPERATURE HEATER=Chamber_Heater TARGET={start_vars.heater_high}
# RESPOND TYPE=COMMAND MSG="Chamber Heater: Under minimum thresold, setting heater {start_vars.heater_high}c"
UPDATE_DELAYED_GCODE ID=_CHAMBER_HEAT_CONTROL DURATION=20
{% elif Temp >= c_heater_vars.min_thresold and Temp <= c_heater_vars.mid_point %}
SET_HEATER_TEMPERATURE HEATER=Chamber_Heater TARGET={start_vars.heater_mid}
# RESPOND TYPE=COMMAND MSG="Chamber Heater: Under mid point, setting heater {start_vars.heater_mid}c"
UPDATE_DELAYED_GCODE ID=_CHAMBER_HEAT_CONTROL DURATION=20
{% elif Temp >= c_heater_vars.mid_point and Temp <= c_heater_vars.max_thresold %}
SET_HEATER_TEMPERATURE HEATER=Chamber_Heater TARGET={start_vars.heater_low}
# RESPOND TYPE=COMMAND MSG="Chamber Heater: Over mid point, setting heater {start_vars.heater_low}c"
UPDATE_DELAYED_GCODE ID=_CHAMBER_HEAT_CONTROL DURATION=20
{% elif Temp > c_heater_vars.max_thresold %}
SET_HEATER_TEMPERATURE HEATER=Chamber_Heater TARGET=0
# RESPOND TYPE=COMMAND MSG="Chamber Heater: Over maximum thresold, setting heater OFF"
UPDATE_DELAYED_GCODE ID=_CHAMBER_HEAT_CONTROL DURATION=20
{% endif %}
{% elif printer["output_pin DISABLE_CHAMBER_HEATER"].value == 1 %}
SET_HEATER_TEMPERATURE HEATER=Chamber_Heater TARGET=0
# RESPOND TYPE=COMMAND MSG="Chamber Heater: Heater disabled by switch, heater OFF ready to resume.
UPDATE_DELAYED_GCODE ID=_CHAMBER_HEAT_CONTROL DURATION=20
{% endif %}
{% endif %}
{% endif %}
[delayed_gcode _CHAMBER_HEAT_CONTROL]
gcode:
{% set start_vars = printer["gcode_macro _START_VARIABLES"] %}
{% if start_vars.danger_will_robinson != True %}
{action_raise_error("This error is caused by you not agreeing to full & sole reasonability/liability of using a chamber heater with these macros before first use. Check demon_user_settings file for variable_danger_will_robinson & agree to the terms!")}
{% else %}
_CHAMBER_HEATER_MONITOR
{% endif %}
[gcode_macro _CHAMBER_HEATER_VERSION]
variable_demon_chamber_heater_ver: 1.0
gcode: