GM: inactive gas/regen safety (#26184)

* Add INACTIVE_REGEN

* bump

* Update selfdrive/car/gm/carcontroller.py
This commit is contained in:
Shane Smiskol 2022-10-21 01:14:15 -07:00 committed by GitHub
parent 3a50d5fd85
commit 3a70253567
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 3 deletions

2
panda

@ -1 +1 @@
Subproject commit fcb1a5a8e233a8b520c42c58cf8bfaa82753ac5a
Subproject commit d51dd496cbdc8665928af40247582bc62dba1f2a

View File

@ -67,8 +67,8 @@ class CarController:
# Gas/regen, brakes, and UI commands - all at 25Hz
if self.frame % 4 == 0:
if not CC.longActive:
# Stock ECU sends max regen when not enabled
self.apply_gas = self.params.MAX_ACC_REGEN
# ASCM sends max regen when not enabled
self.apply_gas = self.params.INACTIVE_REGEN
self.apply_brake = 0
else:
if self.CP.carFingerprint in EV_CAR:

View File

@ -30,6 +30,7 @@ class CarControllerParams:
ZERO_GAS = 2048 # Coasting
MAX_BRAKE = 400 # ~ -4.0 m/s^2 with regen
MAX_ACC_REGEN = 1404 # Max ACC regen is slightly less than max paddle regen
INACTIVE_REGEN = 1404
# Allow small margin below -3.5 m/s^2 from ISO 15622:2018 since we
# perform the closed loop control, and might need some