reset on ignition edge (#22915)
parent
8e12b9ca76
commit
1d03f2a97b
|
@ -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
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue