Update fan_controller.py
This commit is contained in:
parent
ae1c4f48b0
commit
4b2a0d6432
|
@ -28,11 +28,14 @@ class TiciFanController(BaseFanController):
|
||||||
self.controller.reset()
|
self.controller.reset()
|
||||||
|
|
||||||
error = 70 - cur_temp
|
error = 70 - cur_temp
|
||||||
fan_pwr_out = -int(self.controller.update(
|
#fan_pwr_out = -int(self.controller.update(
|
||||||
error=error,
|
#error=error,
|
||||||
feedforward=interp(cur_temp, [60.0, 100.0], [0, -100])
|
#feedforward=interp(cur_temp, [60.0, 100.0], [0, -100])
|
||||||
))
|
#))
|
||||||
|
fan_pwr_out = int(interp(cur_temp, [60.0, 80.0], [0, 65]))
|
||||||
|
|
||||||
|
# 确保风扇功率在 0 到 65 之间
|
||||||
|
fan_pwr_out = max(0, min(65, fan_pwr_out))
|
||||||
self.last_ignition = ignition
|
self.last_ignition = ignition
|
||||||
return fan_pwr_out
|
return fan_pwr_out
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue