reset on ignition edge (#22915)

old-commit-hash: 1d03f2a97b
commatwo_master
Robbe Derks 3 years ago committed by GitHub
parent 37c7137220
commit bad079992c
  1. 7
      selfdrive/thermald/thermald.py

@ -126,16 +126,23 @@ def handle_fan_uno(controller, max_cpu_temp, fan_speed, ignition):
return new_speed return new_speed
last_ignition = False
def handle_fan_tici(controller, max_cpu_temp, fan_speed, ignition): def handle_fan_tici(controller, max_cpu_temp, fan_speed, ignition):
global last_ignition
controller.neg_limit = -(80 if ignition else 30) controller.neg_limit = -(80 if ignition else 30)
controller.pos_limit = -(30 if ignition else 0) controller.pos_limit = -(30 if ignition else 0)
if ignition != last_ignition:
controller.reset()
fan_pwr_out = -int(controller.update( fan_pwr_out = -int(controller.update(
setpoint=(75 if ignition else (OFFROAD_DANGER_TEMP - 2)), setpoint=(75 if ignition else (OFFROAD_DANGER_TEMP - 2)),
measurement=max_cpu_temp, measurement=max_cpu_temp,
feedforward=interp(max_cpu_temp, [60.0, 100.0], [0, -80]) feedforward=interp(max_cpu_temp, [60.0, 100.0], [0, -80])
)) ))
last_ignition = ignition
return fan_pwr_out return fan_pwr_out

Loading…
Cancel
Save