fan_pwr_out 65%

This commit is contained in:
luckylz2git
2024-10-16 11:39:12 +08:00
parent 3309ac51c5
commit 2123a12507
+7 -4
View File
@@ -28,10 +28,13 @@ class TiciFanController(BaseFanController):
self.controller.reset()
error = 70 - cur_temp
fan_pwr_out = -int(self.controller.update(
error=error,
feedforward=interp(cur_temp, [60.0, 100.0], [0, -100])
))
# fan_pwr_out = -int(self.controller.update(
# error=error,
# 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
return fan_pwr_out