diff --git a/selfdrive/thermald/thermald.py b/selfdrive/thermald/thermald.py index 5e67858791..1f42471455 100755 --- a/selfdrive/thermald/thermald.py +++ b/selfdrive/thermald/thermald.py @@ -126,16 +126,23 @@ def handle_fan_uno(controller, max_cpu_temp, fan_speed, ignition): return new_speed +last_ignition = False def handle_fan_tici(controller, max_cpu_temp, fan_speed, ignition): + global last_ignition + controller.neg_limit = -(80 if ignition else 30) controller.pos_limit = -(30 if ignition else 0) + if ignition != last_ignition: + controller.reset() + fan_pwr_out = -int(controller.update( setpoint=(75 if ignition else (OFFROAD_DANGER_TEMP - 2)), measurement=max_cpu_temp, feedforward=interp(max_cpu_temp, [60.0, 100.0], [0, -80]) )) + last_ignition = ignition return fan_pwr_out