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

Toyota: fix acceleration discontinuity when stopping #1664

Merged
merged 1 commit into from
Jan 25, 2025

Conversation

sshane
Copy link
Contributor

@sshane sshane commented Jan 25, 2025

Regression from #1532

Due to Toyota PCM's overzealous processing of ACC acceleration requests, the small jump that can occur when stopping can cause the brake controller to overreact and let go of the brakes entirely. This is only possible if the PID controller is applying a smaller acceleration than feedforward.

This issue at least affects hybrids, as seen in this case:

https://connect.comma.ai/d9b97c1d3b8c39b2/00000020--177f5572ab/1346/1362

image

This usually does not happen as longcontrol.py starts with the last output accel when stopping, but Toyota is the only brand that has its final PID controller in carcontroller due to custom tuning/logic.

@sshane sshane added bugfix car related to opendbc/car/ toyota labels Jan 25, 2025
@sshane
Copy link
Contributor Author

sshane commented Jan 25, 2025

After:

image

The integral unwind we just added slowly corrects for the offset which is desireable.

@sshane sshane merged commit b949b43 into master Jan 25, 2025
4 checks passed
@sshane sshane deleted the fix-toyota-stopping branch January 25, 2025 01:05
rav4kumar pushed a commit to sunnypilot/opendbc that referenced this pull request Jan 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix car related to opendbc/car/ toyota
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant