diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2017-03-08 20:00:27 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2017-03-08 20:23:09 -0500 |
commit | bcaf818c0e2bc6b92a579318b9ac97911d0104bf (patch) | |
tree | 50ce5f15e290ea56a9d1658f9ef834bff64af9a7 /klippy/fan.py | |
parent | 37bac916e7dd7159fe731f313859e31e743f7f23 (diff) | |
download | kutter-bcaf818c0e2bc6b92a579318b9ac97911d0104bf.tar.gz kutter-bcaf818c0e2bc6b92a579318b9ac97911d0104bf.tar.xz kutter-bcaf818c0e2bc6b92a579318b9ac97911d0104bf.zip |
fan: Default to using software PWM
Not all hardware has PWM support and there is no compelling reason to
use hardware PWM for fans. Change the default to use software PWM.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/fan.py')
-rw-r--r-- | klippy/fan.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/klippy/fan.py b/klippy/fan.py index 739af2f1..2f9fb7a5 100644 --- a/klippy/fan.py +++ b/klippy/fan.py @@ -5,6 +5,7 @@ # This file may be distributed under the terms of the GNU GPLv3 license. FAN_MIN_TIME = 0.1 +PWM_CYCLE_TIME = 0.010 class PrinterFan: def __init__(self, printer, config): @@ -16,8 +17,9 @@ class PrinterFan: self.kick_start_time = config.getfloat('kick_start_time', 0.1) def build_config(self): pin = self.config.get('pin') - hard_pwm = self.config.getint('hard_pwm', 128) - self.mcu_fan = self.printer.mcu.create_pwm(pin, hard_pwm, 0) + hard_pwm = self.config.getint('hard_pwm', 0) + self.mcu_fan = self.printer.mcu.create_pwm( + pin, PWM_CYCLE_TIME, hard_pwm, 0.) # External commands def set_speed(self, print_time, value): value = max(0., min(1., value)) |