Skip to content

Tesla: smooth transition after gas pedal override #3249

Open
lukasloetkolben wants to merge 3 commits intocommaai:masterfrom
lukasloetkolben:tesla-jerk-fix
Open

Tesla: smooth transition after gas pedal override #3249
lukasloetkolben wants to merge 3 commits intocommaai:masterfrom
lukasloetkolben:tesla-jerk-fix

Conversation

@lukasloetkolben
Copy link
Copy Markdown
Contributor

@lukasloetkolben lukasloetkolben commented Mar 28, 2026

ramps jerkMin/jerkMax from 0 back to their normal values after gas release. This limits how fast the DI rate limiter can move away from 0 after the override ends, giving a smooth transition instead of an instant jump.

Validation

  • Dongle ID: 0f79c454f812791a
  • Route: 0f79c454f812791a/00000011--f1fa3e189e

@github-actions github-actions bot added car related to opendbc/car/ tesla labels Mar 28, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 28, 2026

Car behavior report

Replays driving segments through this PR and compares the behavior to master.
Please review any changes carefully to ensure they are expected.

Testing 20 segments for: TESLA_MODEL_3, TESLA_MODEL_Y

✅ 0 changed, 20 passed, 0 errors

@lukasloetkolben
Copy link
Copy Markdown
Contributor Author

Without the fix, the acceleration undershoots to -2.2 m/s² on gas release:
Bildschirmfoto 2026-03-28 um 14 10 14

With the fix, the undershoot is reduced to -1.02 m/s² feels responsive and smooth:

Bildschirmfoto 2026-03-28 um 14 12 57

@dzid26
Copy link
Copy Markdown
Contributor

dzid26 commented Mar 30, 2026

Consider this one dzid26@3c3b826
I think using the cruise OVERRIDE state is a bit more robust. - I noticed that without limiting the jerk, whenever there is a high deceleration, the the OVERRIDE stayed on until the speed decreased even when after the gas was released.

It also was needed to only rate limit maximum jerk funnily enough.

@lukasloetkolben
Copy link
Copy Markdown
Contributor Author

I tested this again today, the bug with the rapid pedal pushes @sshane and i noticed during the test drive, is already present in the current implementation and isn't caused by this fix. The override state also doesn't seem to be necessary.

In my view, this is a clear improvement. I've already submitted a similar solution a year ago.
I'd like to just merge this fix for now. If a better solution comes along later, we can always merge that one instead, but as it stands, this PR is a clear improvement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

car related to opendbc/car/ tesla

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants