Skip to content

Commit be934b3

Browse files
authored
fancontroller: remove weird minus (commaai#35983)
* fancontroller: remove weird minus * another minus
1 parent 3d6dfc8 commit be934b3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

system/hardware/fan_controller.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@ def __init__(self) -> None:
2121
self.controller = PIDController(k_p=0, k_i=4e-3, k_f=1, rate=(1 / DT_HW))
2222

2323
def update(self, cur_temp: float, ignition: bool) -> int:
24-
self.controller.neg_limit = -(100 if ignition else 30)
25-
self.controller.pos_limit = -(30 if ignition else 0)
24+
self.controller.pos_limit = 100 if ignition else 30
25+
self.controller.neg_limit = 30 if ignition else 0
2626

2727
if ignition != self.last_ignition:
2828
self.controller.reset()
2929

30-
error = 75 - cur_temp
31-
fan_pwr_out = -int(self.controller.update(
30+
error = cur_temp - 75
31+
fan_pwr_out = int(self.controller.update(
3232
error=error,
33-
feedforward=np.interp(cur_temp, [60.0, 100.0], [0, -100])
33+
feedforward=np.interp(cur_temp, [60.0, 100.0], [0, 100])
3434
))
3535

3636
self.last_ignition = ignition

0 commit comments

Comments
 (0)