Skip to content

Conversation

felsager
Copy link
Contributor

@felsager felsager commented Sep 9, 2025

The torque PI controller currently computes its error using the desired lateral acceleration indexed liveDelay frames into the future. When the absolute desired lateral acceleration increases sharply, that step shows up in both the feed-forward term and the error, effectively double-counting the command.

This likely explains the lateral acceleration overshoot observed on some torque-controlled Toyota platforms under large lateral acceleration commands.
I propose computing the PI-controller error and integrated error from the current (raw) desired lateral acceleration instead.

@commaci-public
Copy link
Contributor

commaci-public commented Sep 9, 2025

@felsager felsager force-pushed the use-non-delay-action branch from 6756948 to d1129a9 Compare September 10, 2025 18:51
@felsager felsager requested a review from haraschax September 10, 2025 19:57
@sshane
Copy link
Contributor

sshane commented Sep 11, 2025

Does this only affect ramp up? So constant large desired lateral acceleration requests are mostly unchanged?

@haraschax
Copy link
Contributor

Like @sshane mentioned that should be called something else. RawAction is confusing. But actually this also exposes the problem with this, this will mostly just get "observed current curvature" which is different from lag_compensated_curvature lag seconds ago.

You really need to do the second one. You'll need to keep a buffer around somewhere, if it can be done cleanly I think it should be done in the controller, and leave modeld unchanged.

@felsager
Copy link
Contributor Author

large
Yes, it should only affect absolute increases (or ramping up from 0.0). When ramping down to 0.0 the feedforward will be close to 0.0 (ignoring lat_accel_offset). Constant large desired lat accel should also remain mostly unchanged.

@felsager felsager force-pushed the use-non-delay-action branch from 4b0161b to fe76768 Compare September 16, 2025 21:27
@felsager felsager force-pushed the use-non-delay-action branch from 3344ce6 to c1cf773 Compare September 30, 2025 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants