From dcb882a6905ded8d6789b07915260264a41d9a5c Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Fri, 21 Oct 2022 01:14:15 -0700 Subject: [PATCH] GM: inactive gas/regen safety (#26184) * Add INACTIVE_REGEN * bump * Update selfdrive/car/gm/carcontroller.py old-commit-hash: 3a70253567cc908204b73cf5df53369b19506b7b --- panda | 2 +- selfdrive/car/gm/carcontroller.py | 4 ++-- selfdrive/car/gm/values.py | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/panda b/panda index fcb1a5a8e2..d51dd496cb 160000 --- a/panda +++ b/panda @@ -1 +1 @@ -Subproject commit fcb1a5a8e233a8b520c42c58cf8bfaa82753ac5a +Subproject commit d51dd496cbdc8665928af40247582bc62dba1f2a diff --git a/selfdrive/car/gm/carcontroller.py b/selfdrive/car/gm/carcontroller.py index dbad355c46..f28a0f7b59 100644 --- a/selfdrive/car/gm/carcontroller.py +++ b/selfdrive/car/gm/carcontroller.py @@ -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: diff --git a/selfdrive/car/gm/values.py b/selfdrive/car/gm/values.py index 999dabfee3..f8f9e7f043 100644 --- a/selfdrive/car/gm/values.py +++ b/selfdrive/car/gm/values.py @@ -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