Nissan: fix driver override fault by winding down torque more (#3407)

* see if fix

* add ego accel

* add ego accel

* add stock dm

* revert

* clean up

* simple

* param it
This commit is contained in:
Shane Smiskol
2026-05-27 22:04:55 -07:00
committed by GitHub
parent bc8fa34e94
commit f5d3a310c2
2 changed files with 5 additions and 5 deletions

View File

@@ -37,12 +37,11 @@ class CarController(CarControllerBase):
if not bool(CS.out.steeringPressed):
lkas_max_torque = CarControllerParams.LKAS_MAX_TORQUE
else:
# Scale max torque based on how much torque the driver is applying to the wheel
# Scale max torque based on how much torque the driver is applying to the wheel.
# Start scaling torque at STEER_THRESHOLD down to 0.2. If we don't scale this low, EPS will temp fault from high driver and LKAS torque
lkas_max_torque = max(
# Scale max torque down to half LKAX_MAX_TORQUE as a minimum
CarControllerParams.LKAS_MAX_TORQUE * 0.5,
# Start scaling torque at STEER_THRESHOLD
CarControllerParams.LKAS_MAX_TORQUE - 0.6 * max(0, abs(CS.out.steeringTorque) - CarControllerParams.STEER_THRESHOLD)
CarControllerParams.LKAS_MIN_TORQUE,
CarControllerParams.LKAS_MAX_TORQUE - 0.6 * max(0, abs(CS.out.steeringTorque) - CarControllerParams.STEER_THRESHOLD),
)
if self.CP.carFingerprint in (CAR.NISSAN_ROGUE, CAR.NISSAN_XTRAIL, CAR.NISSAN_ALTIMA) and pcm_cancel_cmd:

View File

@@ -19,6 +19,7 @@ class CarControllerParams:
([0., 5., 15.], [5., 3.5, 0.4]),
)
LKAS_MIN_TORQUE = 0.2 # Adequate torque when overriding without faulting
LKAS_MAX_TORQUE = 1 # A value of 1 is easy to overpower
STEER_THRESHOLD = 1.0