aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdrian Keet <arkeet@gmail.com>2020-05-17 13:26:51 -0700
committerKevinOConnor <kevin@koconnor.net>2020-05-24 11:46:46 -0400
commitb2671783700fa1891454d5841985cb3c3b5c6db3 (patch)
treec595c2d0cdb13cdca37a260b5fac3efe7431e414
parent9530373ccbf71f652d0cd0a6d1a22c84f68247e6 (diff)
downloadkutter-b2671783700fa1891454d5841985cb3c3b5c6db3.tar.gz
kutter-b2671783700fa1891454d5841985cb3c3b5c6db3.tar.xz
kutter-b2671783700fa1891454d5841985cb3c3b5c6db3.zip
controller_fan: Add fan_speed parameter.
This gives it parity with heater_fan. Also change the default speed from max_power to 1.0, since it is already scaled by max_power in set_speed. Signed-off-by: Adrian Keet <arkeet@gmail.com>
-rw-r--r--config/example-extras.cfg7
-rw-r--r--klippy/extras/controller_fan.py10
2 files changed, 9 insertions, 8 deletions
diff --git a/config/example-extras.cfg b/config/example-extras.cfg
index 53488f44..bf7a73f5 100644
--- a/config/example-extras.cfg
+++ b/config/example-extras.cfg
@@ -1086,6 +1086,10 @@
#kick_start_time:
# See the "fan" section in example.cfg for a description of the
# above parameters.
+#fan_speed: 1.0
+# The fan speed (expressed as a value from 0.0 to 1.0) that the fan
+# will be set to when a heater or stepper driver is active.
+# The default is 1.0
#idle_timeout:
# The ammount of time (in seconds) after a stepper driver or heater
# was active and the fan should be kept running. The default
@@ -1093,8 +1097,7 @@
#idle_speed:
# The fan speed (expressed as a value from 0.0 to 1.0) that the fan
# will be set to when a heater or stepper driver was active and before
-# the idle_timeout is reached. This must be greater or equal
-# max_power. The default is max_power
+# the idle_timeout is reached. The default is fan_speed.
#heater:
# Name of the config section defining the heater that this fan is
# associated with. If a comma separated list of heater names is
diff --git a/klippy/extras/controller_fan.py b/klippy/extras/controller_fan.py
index 89e365a9..1828a200 100644
--- a/klippy/extras/controller_fan.py
+++ b/klippy/extras/controller_fan.py
@@ -17,12 +17,10 @@ class ControllerFan:
self.heaters = []
self.fan = fan.PrinterFan(config)
self.mcu = self.fan.mcu_fan.get_mcu()
- self.max_power = config.getfloat(
- 'max_power', default=1.,
- minval=0., maxval=1.)
+ self.fan_speed = config.getfloat(
+ 'fan_speed', default=1., minval=0., maxval=1.)
self.idle_speed = config.getfloat(
- 'idle_speed', default=self.max_power,
- minval=0., maxval=self.max_power)
+ 'idle_speed', default=self.fan_speed, minval=0., maxval=1.)
self.idle_timeout = config.getint("idle_timeout", default=30, minval=0)
self.heater_name = config.get("heater", "extruder")
self.last_on = self.idle_timeout
@@ -45,7 +43,7 @@ class ControllerFan:
active = True
if active:
self.last_on = 0
- power = self.max_power
+ power = self.fan_speed
elif self.last_on < self.idle_timeout:
power = self.idle_speed
self.last_on += 1