From 88a3d4382697fe0c3e75a1a5bc4d14c2dd834aa4 Mon Sep 17 00:00:00 2001 From: kegman Date: Wed, 19 Dec 2018 20:22:43 -0500 Subject: [PATCH] Fix Pedal Grinding noise (#70) * BRAKE_STOPPING_TARGET to 0.0 * Pedal noise mitigation v1 * Fix Syntax error * Grinding noise code cleanup * Pedal Grinding further code cleanup * Pedal grind further Code cleanup * Update carstate.py * Revert "BRAKE_STOPPING_TARGET to 0.0" This reverts commit 7a6b3a67826dd1fd5b942b06eb7c1d15b0f3c23a. * Revert "BRAKE_STOPPING_TARGET reduced to 0.1 from 0.25" This reverts commit b0d75c5d8d7186c1ef7ee095c9b349f29b1b74f8. --- selfdrive/car/honda/carstate.py | 8 +++++++- selfdrive/controls/lib/longcontrol.py | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/selfdrive/car/honda/carstate.py b/selfdrive/car/honda/carstate.py index 927e3363ff044e..f744a5e06adf9a 100644 --- a/selfdrive/car/honda/carstate.py +++ b/selfdrive/car/honda/carstate.py @@ -278,7 +278,6 @@ def update(self, cp, cp_cam): self.steer_torque_driver = cp.vl["STEER_STATUS"]['STEER_TORQUE_SENSOR'] self.steer_override = abs(self.steer_torque_driver) > STEER_THRESHOLD[self.CP.carFingerprint] - self.brake_switch = cp.vl["POWERTRAIN_DATA"]['BRAKE_SWITCH'] if self.CP.radarOffCan: @@ -305,6 +304,7 @@ def update(self, cp, cp_cam): self.brake_pressed = cp.vl["POWERTRAIN_DATA"]['BRAKE_PRESSED'] or \ (self.brake_switch and self.brake_switch_prev and \ cp.ts["POWERTRAIN_DATA"]['BRAKE_SWITCH'] != self.brake_switch_ts) + self.brake_switch_prev = self.brake_switch self.brake_switch_ts = cp.ts["POWERTRAIN_DATA"]['BRAKE_SWITCH'] @@ -312,6 +312,12 @@ def update(self, cp, cp_cam): self.pcm_acc_status = cp.vl["POWERTRAIN_DATA"]['ACC_STATUS'] self.hud_lead = cp.vl["ACC_HUD"]['HUD_LEAD'] + # gets rid of Pedal Grinding noise + if self.user_brake > 0.05 or self.brake_pressed: + self.brake_pressed = 1 + else: + self.brake_pressed = 0 + # when user presses distance button on steering wheel if self.cruise_setting == 3: if cp.vl["SCM_BUTTONS"]["CRUISE_SETTING"] == 0: diff --git a/selfdrive/controls/lib/longcontrol.py b/selfdrive/controls/lib/longcontrol.py index c7c8ad299a34c7..db92430e61dbcf 100644 --- a/selfdrive/controls/lib/longcontrol.py +++ b/selfdrive/controls/lib/longcontrol.py @@ -12,7 +12,7 @@ STOPPING_BRAKE_RATE = 0.2 # brake_travel/s while trying to stop STARTING_BRAKE_RATE = 0.8 # brake_travel/s while releasing on restart -BRAKE_STOPPING_TARGET = 0.1 # apply at least this amount of brake to maintain the vehicle stationary +BRAKE_STOPPING_TARGET = 0.25 # apply at least this amount of brake to maintain the vehicle stationary _MAX_SPEED_ERROR_BP = [0., 30.] # speed breakpoints _MAX_SPEED_ERROR_V = [1.5, .8] # max positive v_pid error VS actual speed; this avoids controls windup due to slow pedal resp