From 1e21fe4acc4ea7069d7018de22d7385668a4df6e Mon Sep 17 00:00:00 2001 From: James <91348155+FrogAi@users.noreply.github.com> Date: Mon, 1 Dec 2025 12:00:00 -0700 Subject: [PATCH] Increase steering torque for "Global Gen2" Subaru --- opendbc_repo/opendbc/car/subaru/values.py | 6 +++--- opendbc_repo/opendbc/safety/modes/subaru.h | 2 +- opendbc_repo/opendbc/safety/tests/test_subaru.py | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/opendbc_repo/opendbc/car/subaru/values.py b/opendbc_repo/opendbc/car/subaru/values.py index 54d43da8..ddb1be19 100644 --- a/opendbc_repo/opendbc/car/subaru/values.py +++ b/opendbc_repo/opendbc/car/subaru/values.py @@ -20,9 +20,9 @@ class CarControllerParams: if CP.flags & SubaruFlags.GLOBAL_GEN2: # TODO: lower rate limits, this reaches min/max in 0.5s which negatively affects tuning - self.STEER_MAX = 1000 - self.STEER_DELTA_UP = 40 - self.STEER_DELTA_DOWN = 40 + self.STEER_MAX = 1500 + self.STEER_DELTA_UP = 35 + self.STEER_DELTA_DOWN = 50 elif CP.carFingerprint == CAR.SUBARU_IMPREZA_2020: self.STEER_DELTA_UP = 35 self.STEER_MAX = 1439 diff --git a/opendbc_repo/opendbc/safety/modes/subaru.h b/opendbc_repo/opendbc/safety/modes/subaru.h index d772c485..b8227d82 100644 --- a/opendbc_repo/opendbc/safety/modes/subaru.h +++ b/opendbc_repo/opendbc/safety/modes/subaru.h @@ -137,7 +137,7 @@ static void subaru_rx_hook(const CANPacket_t *msg) { static bool subaru_tx_hook(const CANPacket_t *msg) { const TorqueSteeringLimits SUBARU_STEERING_LIMITS = SUBARU_STEERING_LIMITS_GENERATOR(2047, 50, 70); - const TorqueSteeringLimits SUBARU_GEN2_STEERING_LIMITS = SUBARU_STEERING_LIMITS_GENERATOR(1000, 40, 40); + const TorqueSteeringLimits SUBARU_GEN2_STEERING_LIMITS = SUBARU_STEERING_LIMITS_GENERATOR(1500, 35, 50); const LongitudinalLimits SUBARU_LONG_LIMITS = { .min_gas = 808, // appears to be engine braking diff --git a/opendbc_repo/opendbc/safety/tests/test_subaru.py b/opendbc_repo/opendbc/safety/tests/test_subaru.py index 06f83f34..69e29dd0 100755 --- a/opendbc_repo/opendbc/safety/tests/test_subaru.py +++ b/opendbc_repo/opendbc/safety/tests/test_subaru.py @@ -187,9 +187,9 @@ class TestSubaruGen2TorqueSafetyBase(TestSubaruTorqueSafetyBase): ALT_MAIN_BUS = SUBARU_ALT_BUS ALT_CAM_BUS = SUBARU_ALT_BUS - MAX_RATE_UP = 40 - MAX_RATE_DOWN = 40 - MAX_TORQUE_LOOKUP = [0], [1000] + MAX_RATE_UP = 35 + MAX_RATE_DOWN = 50 + MAX_TORQUE_LOOKUP = [0], [1500] class TestSubaruGen2TorqueStockLongitudinalSafety(TestSubaruStockLongitudinalSafetyBase, TestSubaruGen2TorqueSafetyBase):