diff --git a/config/example-extras.cfg b/config/example-extras.cfg index 0e712f7e..97183b7c 100644 --- a/config/example-extras.cfg +++ b/config/example-extras.cfg @@ -29,7 +29,8 @@ # Heater cooling fans (one may define any number of sections with a # "heater_fan" prefix). A "heater fan" is a fan that will be enabled -# whenever its associated heater is active. +# whenever its associated heater is active. In the event of an MCU +# software error the heater_fan will be set to its max_power. #[heater_fan my_nozzle_fan] # See the "fan" section for fan configuration parameters. #pin: ar4 @@ -40,6 +41,10 @@ #heater_temp: 50.0 # A temperature (in Celsius) that the heater must drop below before # the fan is disabled. The default is 50 Celsius. +#fan_speed: +# The fan speed (expressed as a value from 0.0 to 1.0) that the fan +# will be set to when its associated heater is enabled. The default +# is max_power. # Additional micro-controllers (one may define any number of sections diff --git a/klippy/fan.py b/klippy/fan.py index 3f9bd63d..5401c5ec 100644 --- a/klippy/fan.py +++ b/klippy/fan.py @@ -39,6 +39,10 @@ class PrinterHeaterFan: heater = config.get("heater", "extruder0") self.heater = extruder.get_printer_heater(printer, heater) self.heater_temp = config.getfloat("heater_temp", 50.0) + max_power = self.fan.max_power + self.fan_speed = config.getfloat( + "fan_speed", max_power, minval=0., maxval=max_power) + self.fan.mcu_fan.setup_shutdown_value(max_power) printer.reactor.register_timer(self.callback, printer.reactor.NOW) def callback(self, eventtime): current_temp, target_temp = self.heater.get_temp(eventtime) @@ -47,7 +51,7 @@ class PrinterHeaterFan: return eventtime + 1. power = 0. if target_temp or current_temp > self.heater_temp: - power = 1. + power = self.fan_speed print_time = self.mcu.estimated_print_time(eventtime) + FAN_MIN_TIME self.fan.set_speed(print_time, power) return eventtime + 1.