-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathheater.cfg
62 lines (56 loc) · 1.8 KB
/
heater.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
# this is needed to support the M118 and/or RESPOND command
[respond]
[heater_fan chamber_fan]
pin: PC8
kick_start_time: 0.5
off_below: 0.03
heater: chamber
heater_temp: 35
fan_speed: 0.5
[heater_generic chamber]
heater_pin: PA3
sensor_type: Generic 3950
sensor_pin: PA1
min_temp: 0
max_temp: 70
control = pid
pid_kp = 55.031
pid_ki = 0.475
pid_kd = 1595.197
[verify_heater chamber]
max_error: 120
check_gain_time:60
hysteresis: 10
heating_gain: 1
[gcode_macro M191]
# this is needed to support slicers' chamber heater options
# https://marlinfw.org/docs/gcode/M191.html
gcode:
{% set target = params.S | default(0) | float %}
RESPOND MSG="Heating chamger to {target}C ..."
SET_HEATER_TEMPERATURE HEATER=chamber TARGET={target}
RESPOND MSG="Waiting for chamber to reach {target}C ..."
TEMPERATURE_WAIT SENSOR="heater_generic chamber" MINIMUM={target}
RESPOND MSG="Chamber heating {target}C is done."
UPDATE_DELAYED_GCODE ID=_scheduled_exhaust DURATION=10
[delayed_gcode _scheduled_exhaust]
gcode:
{% if printer.idle_timeout.state == "Printing" %}
UPDATE_DELAYED_GCODE ID=_scheduled_exhaust DURATION=10
{% else %}
# if we got here, the chamber heater was used, and printing is done
RESPOND MSG="Printing finished, starting to cool chamber ..."
SET_PIN PIN=fan3 VALUE=255
UPDATE_DELAYED_GCODE ID=_check_exhaust_needed DURATION=10
{% endif %}
# once the exhaust fan starts, check to see if the chamber has cooled sufficiently
[delayed_gcode _check_exhaust_needed]
gcode:
# check the current chamber temp
{% set chamber_temp = printer['heater_generic chamber'].temperature|float %}
{% if chamber_temp >= 30 %}
UPDATE_DELAYED_GCODE ID=_check_exhaust_needed DURATION=10
{% else %}
RESPOND MSG="Chamber sufficiently cooled, disabling exhaust ..."
SET_PIN PIN=fan3 VALUE=0
{% endif %}