Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

quick fix for NIDEC #188

Open
wants to merge 3 commits into
base: deprecated-beta2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions selfdrive/car/honda/carcontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ def brake_pump_hysteresis(apply_brake, apply_brake_last, last_pump_ts, ts):
if ts - last_pump_ts < 0.2 and apply_brake > 0:
pump_on = True

# some hybrid nidecs like Odyssey hybrid and Clarity need to keep pump on during braking or they'll lose pressure
if self.CP.carFingerprint == CAR.ODYSSEY_HYBRID:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks not necessary?

pump_on is always set to True for ODYSSEY_HYBRID AFTER the brake_pump_hysteresis?

pump_on = apply_brake > 0

return pump_on, last_pump_ts


Expand Down Expand Up @@ -226,8 +230,6 @@ def update(self, CC, CS, now_nanos, dragonconf):
apply_brake = clip(self.brake_last - wind_brake, 0.0, 1.0)
apply_brake = int(clip(apply_brake * self.params.NIDEC_BRAKE_MAX, 0, self.params.NIDEC_BRAKE_MAX - 1))
pump_on, self.last_pump_ts = brake_pump_hysteresis(apply_brake, self.apply_brake_last, self.last_pump_ts, ts)
if self.CP.carFingerprint == CAR.ODYSSEY_HYBRID:
pump_on = True

pcm_override = True
can_sends.append(hondacan.create_brake_command(self.packer, apply_brake, pump_on,
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/car/honda/hondacan.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,10 @@ def create_ui_commands(packer, CP, enabled, pcm_speed, hud, is_metric, acc_hud,
'IMPERIAL_UNIT': int(not is_metric),
'HUD_LEAD': 2 if enabled and hud.lead_visible else 1 if enabled else 0,
'SET_ME_X01_2': 1,
'ACC_ON': int(enabled),
}

if CP.carFingerprint in HONDA_BOSCH:
acc_hud_values['ACC_ON'] = int(enabled)
acc_hud_values['FCM_OFF'] = 1
acc_hud_values['FCM_OFF_2'] = 1
else:
Expand Down