-
Notifications
You must be signed in to change notification settings - Fork 100
/
fan.cfg
167 lines (150 loc) · 4.49 KB
/
fan.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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
#####################################################################
# Fan Control
#####################################################################
## Hotend Fan - XYE board, E1 Connector
[heater_fan hotend_fan]
pin: P2.4
max_power: 1.0
fan_speed: 1
kick_start_time: 0
heater: extruder
heater_temp: 50.0
## Print Cooling Fan (24V Fan 4 wire)
## Z board, X Endstop (PWM)
## Z board, E1det (Tacho)
[fan]
pin: z:P1.29
cycle_time: 0.0001 #10 kHz PWM signal
hardware_pwm: False
kick_start_time: 0
off_below: 0.05
tachometer_pin: z:P1.25
tachometer_ppr: 2
## Controller fan (5V Fan 4 wire)
## Z board, NeoPixel Connector (PWM)
## Z board, Y Endstop (Tacho)
[heater_fan controller_fan]
pin: z:P1.24
max_power: 1.0
shutdown_speed: 1.0
cycle_time: 0.0001 #10 kHz PWM signal
hardware_pwm: False
kick_start_time: 0
fan_speed: 0.9
heater: heater_bed
heater_temp: 45.0
tachometer_pin: z:P1.28
tachometer_ppr: 2
## Chamber temp / Exhaust fan (24V Fan 4 wire)
## XYE board, NeoPixel Connector (PWM)
## XYE board, TH1 Connector
## XYE board, Z Endstop (Tacho)
[temperature_fan chamber]
pin: P1.24
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: ATC Semitec 104GT-2
sensor_pin: P0.23
min_temp: 0
max_temp: 70
target_temp: 0
max_speed: 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
tachometer_pin: P1.27
tachometer_ppr: 2
## Nevermore Micro filter
## - Z board, E1 Connector
[fan_generic filter]
pin: z:P2.4
max_power: 1.0
kick_start_time: 0.5
off_below: 0.10
[temperature_sensor RPi]
sensor_type: temperature_host
min_temp: 10
max_temp: 100
gcode_id: PI
## Z board, TH1 Connector
[temperature_sensor endstop]
sensor_type: Generic 3950
sensor_pin: z:P0.23
min_temp: 10
max_temp: 100
gcode_id: E
## dummy output to get an switch in Mainsail
## any unused mcu pin can be defined you will not connect anything
## as I use the rPi as mcu I will use a pin from it
## Off -> M106 will update fan
## On -> M106 can not uodate fan
[output_pin lock_M106]
pin: rpi: gpio16
value:0
#####################################################################
# Macros
#####################################################################
# M106 with lock and manual set feature
# M106 S128 M1 will update the fan in any case
[gcode_macro M106]
description: set fan with manual override and lock option
rename_existing: M106.1
gcode:
{% if printer['output_pin lock_M106'].value|int == 0 or params.M|default(0) == '1' %}
M106.1 {rawparams}
{% else %}
{action_respond_info("M106 update is locked")}
{% endif %}
[gcode_macro M141]
description: Set temperature of chamber fan
gcode: SET_TEMPERATURE_FAN_TARGET temperature_fan=chamber target={params.S|default(0)}
[gcode_macro _SET_FILTER]
description: Helper: Set Nevermore filter speed
gcode: SET_FAN_SPEED FAN=filter SPEED={params.S|default(0)}
[gcode_macro _FILTER_ON]
description: Helper: Nevermore on
gcode: _SET_FILTER S={printer['gcode_macro _USER_VARIABLE'].peripheral.filter.on_val}
[gcode_macro FILTER]
description: Toggle Nevermore fan
gcode:
{% if printer['fan_generic filter'].speed|float > 0.0 %} _SET_FILTER {% else %} _FILTER_ON {% endif %}
_FILTER_INFO
[delayed_gcode _DELAY_FILTER_OFF]
gcode:
{% if printer.print_stats.state|lower != "paused" and printer.print_stats.state|lower != "printing" %}
_SET_FILTER
_FILTER_INFO
{% endif %}
## Chamber Ventilation Control in Mainsail
[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)}
[gcode_macro _FILTER_INFO]
description: Helper: Print Nevermore speed
gcode: {action_respond_info("Filter fan %s" % 'on' if printer['fan_generic filter'].speed|float > 0.0 else 'off')}