From 6ce511cc605782c25d45c66b55f859caaf7ce516 Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Fri, 7 Oct 2022 16:12:58 -0700 Subject: [PATCH] GM: use ECM brake-pressed threshold (#25970) * This brake position value disengages stock ACC, use it to avoid controls mismatch. 2016-2017 Volt will hit this threshold and disengage, must install new design of brake pedal retaining clip, TSB 16-NA-147. * 80 hz * comment * bump panda * update refs * bump panda * bump panda * bump panda * bump panda to master Co-authored-by: qadmus <42746943+qadmus@users.noreply.github.com> --- panda | 2 +- selfdrive/car/gm/carstate.py | 13 ++++++++----- selfdrive/test/process_replay/ref_commit | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/panda b/panda index 3334dc21f5..1303af2db2 160000 --- a/panda +++ b/panda @@ -1 +1 @@ -Subproject commit 3334dc21f5c55007c5a754dfd8ee5d642be3e2bb +Subproject commit 1303af2db29a72eee180b10c6097fa5b19c29207 diff --git a/selfdrive/car/gm/carstate.py b/selfdrive/car/gm/carstate.py index 0bba1d29b8..f96a234dbd 100644 --- a/selfdrive/car/gm/carstate.py +++ b/selfdrive/car/gm/carstate.py @@ -40,9 +40,12 @@ class CarState(CarStateBase): else: ret.gearShifter = self.parse_gear_shifter(self.shifter_values.get(pt_cp.vl["ECMPRDNL2"]["PRNDL2"], None)) - # Brake pedal's potentiometer returns near-zero reading even when pedal is not pressed. - ret.brake = pt_cp.vl["EBCMBrakePedalPosition"]["BrakePedalPosition"] / 0xd0 - ret.brakePressed = pt_cp.vl["EBCMBrakePedalPosition"]["BrakePedalPosition"] >= 10 + # Some Volt 2016-17 have loose brake pedal push rod retainers which causes the ECM to believe + # that the brake is being intermittently pressed without user interaction. + # To avoid a cruise fault we need to match the ECM's brake pressed signal and threshold + # https://static.nhtsa.gov/odi/tsbs/2017/MC-10137629-9999.pdf + ret.brake = pt_cp.vl["ECMAcceleratorPos"]["BrakePedalPos"] / 0xd0 + ret.brakePressed = pt_cp.vl["ECMAcceleratorPos"]["BrakePedalPos"] >= 8 # Regen braking is braking if self.CP.transmissionType == TransmissionType.direct: @@ -100,7 +103,7 @@ class CarState(CarStateBase): def get_can_parser(CP): signals = [ # sig_name, sig_address - ("BrakePedalPosition", "EBCMBrakePedalPosition"), + ("BrakePedalPos", "ECMAcceleratorPos"), ("FrontLeftDoor", "BCMDoorBeltStatus"), ("FrontRightDoor", "BCMDoorBeltStatus"), ("RearLeftDoor", "BCMDoorBeltStatus"), @@ -141,7 +144,7 @@ class CarState(CarStateBase): ("ASCMSteeringButton", 33), ("ECMEngineStatus", 100), ("PSCMSteeringAngle", 100), - ("EBCMBrakePedalPosition", 100), + ("ECMAcceleratorPos", 80), ] if CP.transmissionType == TransmissionType.direct: diff --git a/selfdrive/test/process_replay/ref_commit b/selfdrive/test/process_replay/ref_commit index 78367235e6..a89b4c2d71 100644 --- a/selfdrive/test/process_replay/ref_commit +++ b/selfdrive/test/process_replay/ref_commit @@ -1 +1 @@ -f9536e41a6a160bdaa29d42bb164b0e4033857e5 +338c24158bb28952dcd1554ea91734b4281e2fed \ No newline at end of file