From 2a04e4bd31e00b0eadba689a495708a7c393c3a9 Mon Sep 17 00:00:00 2001 From: whoisdomi Date: Sun, 6 Sep 2026 19:33:37 -0500 Subject: [PATCH] Summer cooling curve --- system/hardware/fan_controller.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/system/hardware/fan_controller.py b/system/hardware/fan_controller.py index 6795073d3..a1888c3a3 100755 --- a/system/hardware/fan_controller.py +++ b/system/hardware/fan_controller.py @@ -7,7 +7,12 @@ from openpilot.common.swaglog import cloudlog from openpilot.common.pid import PIDController from openpilot.system.hardware import HARDWARE -OFFSET = 0 +# comma 3/3X (tici/tizi) run a more aggressive, cooler-targeting curve than comma 4 (mici) +IS_MICI = HARDWARE.get_device_type() == "mici" +OFFSET = 0 if IS_MICI else -5 +K_P = 0 if IS_MICI else 1.0 +FF_LOW = 60.0 if IS_MICI else 55.0 +FF_HIGH = 100.0 if IS_MICI else 80.0 class BaseFanController(ABC): @abstractmethod @@ -21,7 +26,7 @@ class TiciFanController(BaseFanController): cloudlog.info("Setting up TICI fan handler") self.last_ignition = False - self.controller = PIDController(k_p=0, k_i=4e-3, rate=(1 / DT_HW)) + self.controller = PIDController(k_p=K_P, k_i=4e-3, rate=(1 / DT_HW)) def update(self, cur_temp: float, ignition: bool) -> int: self.controller.pos_limit = 100 if ignition else 30 @@ -33,7 +38,7 @@ class TiciFanController(BaseFanController): error = cur_temp - (75 + OFFSET) fan_pwr_out = int(self.controller.update( error=error, - feedforward=np.interp(cur_temp, [60.0 + OFFSET, 100.0 + OFFSET], [0, 100]) + feedforward=np.interp(cur_temp, [FF_LOW, FF_HIGH], [0, 100]) )) self.last_ignition = ignition