fancontroller: remove weird minus (#35983)

* fancontroller: remove weird minus

* another minus
honda-canfd^2
Harald Schäfer 2 days ago committed by GitHub
parent 3d6dfc864d
commit be934b3881
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 10
      system/hardware/fan_controller.py

@ -21,16 +21,16 @@ class TiciFanController(BaseFanController):
self.controller = PIDController(k_p=0, k_i=4e-3, k_f=1, rate=(1 / DT_HW)) self.controller = PIDController(k_p=0, k_i=4e-3, k_f=1, rate=(1 / DT_HW))
def update(self, cur_temp: float, ignition: bool) -> int: def update(self, cur_temp: float, ignition: bool) -> int:
self.controller.neg_limit = -(100 if ignition else 30) self.controller.pos_limit = 100 if ignition else 30
self.controller.pos_limit = -(30 if ignition else 0) self.controller.neg_limit = 30 if ignition else 0
if ignition != self.last_ignition: if ignition != self.last_ignition:
self.controller.reset() self.controller.reset()
error = 75 - cur_temp error = cur_temp - 75
fan_pwr_out = -int(self.controller.update( fan_pwr_out = int(self.controller.update(
error=error, error=error,
feedforward=np.interp(cur_temp, [60.0, 100.0], [0, -100]) feedforward=np.interp(cur_temp, [60.0, 100.0], [0, 100])
)) ))
self.last_ignition = ignition self.last_ignition = ignition

Loading…
Cancel
Save