mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-07-13 01:37:55 -06:00
fan: Scale fan speed requests between 0 and max_power
If the fan's max power is limited by the config, then scale speed requests between 0 and max_power. This makes more sense for typical g-code fan speeds. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
48e9fa04e7
commit
85e6cd865c
4 changed files with 9 additions and 8 deletions
|
@ -19,7 +19,7 @@ class PrinterFan:
|
|||
hardware_pwm = config.getboolean('hardware_pwm', False)
|
||||
self.mcu_fan.setup_cycle_time(cycle_time, hardware_pwm)
|
||||
def set_speed(self, print_time, value):
|
||||
value = max(0., min(self.max_power, value))
|
||||
value = max(0., min(self.max_power, value * self.max_power))
|
||||
if value == self.last_fan_value:
|
||||
return
|
||||
print_time = max(self.last_fan_time + FAN_MIN_TIME, print_time)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue