-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathfans.cfg
116 lines (101 loc) · 3.15 KB
/
fans.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
112
113
114
115
116
#####################################################################
# Fan Control
#####################################################################
[fan]
## Print Cooling Fan - FAN0
pin: PA8
kick_start_time: 0.5
off_below: 0.10
[heater_fan hotend_fan]
## Hotend Fan - FAN1
pin: PE5
max_power: 1.0
kick_start_time: 0.5
heater: extruder
heater_temp: 50.0
[fan_generic controller_fan]
# Controller fan - FAN2
# Generic so it can be controlled via delayed_gcode
pin: PD12
max_power: 1.0
kick_start_time: 0.5
[temperature_fan chamber]
pin: PD13
max_power: 1.0
shutdown_speed: 0.0
cycle_time: 0.0005 #2 kHz PWM signal
hardware_pwm: False
kick_start_time: 0
sensor_type: Generic 3950
sensor_pin: PF5
min_temp: 0
max_temp: 70
target_temp: 0
max_speed: 1.0 #0.7
min_speed: 0.1
control: pid
pid_Kp: 2.0 ;40
pid_Ki: 5.0 ;0.2
pid_Kd: 0.5 ;0.1
pid_deriv_time: 2.0
gcode_id: C
[fan_generic nevermore_fan]
## Nevermore - FAN4 on Octopus
pin: PD14
########################################
## Macros
########################################
# Start Pi temp monitoring loop.
[delayed_gcode skirt_fan_boot]
initial_duration: 1.0
gcode:
{% if printer.print_stats.state|lower != "printing" %}
SET_FAN_SPEED FAN=controller_fan SPEED=0.5
{% else %}
SET_FAN_SPEED FAN=controller_fan SPEED=0.75 #just so I can see if this is getting called
{% endif %}
UPDATE_DELAYED_GCODE ID=skirt_fan DURATION=5
# Pi temperature monitoring loop. Check temp every 5 minutes & turn on skirt fans if too hot. Turn off if cool.
[delayed_gcode skirt_fan]
gcode:
{% if printer.print_stats.state|lower != "printing" %}
{% if printer['temperature_sensor pi_4_mcu'].temperature >= 50 %}
SET_FAN_SPEED FAN=controller_fan SPEED=1
{% elif printer['temperature_sensor pi_4_mcu'].temperature < 40 %}
SET_FAN_SPEED FAN=controller_fan SPEED=0
{% endif %}
{% else %}
SET_FAN_SPEED FAN=controller_fan SPEED=1
{% endif %}
UPDATE_DELAYED_GCODE ID=skirt_fan DURATION=300
## Copied from zellneralex, works.
## Chamber Ventilation Control in Mainsail
[gcode_macro M141]
description: Set temperature of chamber fan. Usage M141 [S=target_temp(0)]
gcode:
SET_TEMPERATURE_FAN_TARGET temperature_fan=chamber target={params.S|default(0)}
[gcode_macro VENT]
description: Toggle Chamber fan
gcode:
{% if printer['temperature_fan chamber'].target|float > 0 and
printer['temperature_fan chamber'].target|float <= printer['gcode_macro _USER_VARIABLE'].peripheral.vent.on_val|float %}
M141
{% else %}
M141 S{printer['gcode_macro _USER_VARIABLE'].peripheral.vent.on_val}
{% endif %}
_VENT_INFO
[delayed_gcode _DELAY_VENT_OFF]
gcode:
{% if printer.print_stats.state|lower != "paused" and printer.print_stats.state|lower != "printing" %}
M141
_VENT_INFO
{% endif %}
[gcode_macro _VENT_INFO]
description: Helper: Print chamber fan temperature
gcode:
{% set txt = "off" if printer['temperature_fan chamber'].target == 0
else "target temp: %2dC" % printer['temperature_fan chamber'].target %}
{action_respond_info("Chamber fan %s" % txt)}
[delayed_gcode _NEVERMORE_OFF]
gcode:
SET_FAN_SPEED FAN=nevermore_fan SPEED=0