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

Steer Rate consideration for Lateral Control #435

Closed
wants to merge 28 commits into from

Conversation

Gernby
Copy link

@Gernby Gernby commented Nov 14, 2018

This fix adds steering rate consideration to latcontrol.py, to reduce error (noise) in the torque calculation.

This has the following benefits:

  • Steering response is improved across all vehicle speed ranges
  • Latency is reduced
  • Overshooting / Undershooting is virtually eliminated
  • Actual angle follows desired angle much more closely
  • Dependency and sensitivity to PID "tuning" is reduced
  • Feed forward error due to suspension alignment, wind, and slope is reduced
  • Sample error from low resolution sensor data is reduced
  • Increases fluid movement of the steering mechanisms between planner updates
  • May allow lower steering rate cost and / or actuator delays
  • May increase peak achievable steering angles on some models, due to smoother sweep

steeringratecompensation

@Gernby
Copy link
Author

Gernby commented Nov 15, 2018

Here is a video from a test with very low values for steerRateCost and steerActuatorDelay.
https://www.youtube.com/watch?v=whMI91o0TOU

@Gernby
Copy link
Author

Gernby commented Nov 20, 2018

After feedback from several testers (Honda's and Toyota's), it was clear that the previous logic was better in cases that the steer rate was low OR the steer error was low.

My last commit seems like the best of both.

@Gernby
Copy link
Author

Gernby commented Nov 30, 2018

This PR has become rather outdated, since I've continued making progress using various strategies. However, I finally made a large break-through yesterday, which results in virtually "ideal" steering response.

It needs testing on other vehicles, and the code needs to be refactored (hopefully with your input), so I'm not sure whether this PR should be closed, or not. Please advise.

Also, here is a video of the results, which also explains how the steering system can be treated as a resonant circuit by making the PID inputs more reactive, inductive, and resistive.
https://www.youtube.com/watch?v=8sTyDbXJIRo

screenshot 2018-11-30 09 43 24

This shows how quickly and smoothly the steering recovers after manual disturbance of lane position.
screenshot 2018-11-30 10 01 27

@Gernby
Copy link
Author

Gernby commented Nov 30, 2018

As I said, it's not "PR ready" yet, but you can view the logic in this branch.
https://github.com/Gernby/openpilot/tree/Feed-Forward-Accel-Rate

@Gernby
Copy link
Author

Gernby commented Dec 18, 2018

I'm closing this PR since the enhancements have been ongoing. I will create a new PR (or multiple separate PR's) for the following soon:

  • Add interpolation of desired angle between MPC updates
  • Convert torque logic to a virtual "resonant circuit"
  • Filter latent steering error from MPC's input to reduce feedback noise
  • Split Feed-Forward logic into 2 modes (rate or angle)
  • Smooth steering by limiting angular acceleration
  • Improve accuracy of the future state using observed steering rate and acceleration

These enhancements exist in the branch below, and have been tested with success on Honda's, Toyota's, and Tesla's.

https://github.com/Gernby/openpilot/tree/Feed-Forward-Resonant

@Gernby Gernby closed this Dec 18, 2018
@Gernby Gernby deleted the Feed-Forward_Steer_Offset branch December 30, 2018 22:56
pd0wm pushed a commit that referenced this pull request Feb 18, 2020
769ade0 Harness orientation designation fixes (#435)
eb5020b Add the ability to communicate with BSM (#433)

git-subtree-dir: panda
git-subtree-split: 769ade0
pd0wm pushed a commit that referenced this pull request Feb 18, 2020
769ade0 Harness orientation designation fixes (#435)
eb5020b Add the ability to communicate with BSM (#433)

git-subtree-dir: panda
git-subtree-split: 769ade0
pd0wm pushed a commit that referenced this pull request Feb 18, 2020
769ade0 Harness orientation designation fixes (#435)
eb5020b Add the ability to communicate with BSM (#433)

git-subtree-dir: panda
git-subtree-split: 769ade0
pd0wm pushed a commit that referenced this pull request Feb 18, 2020
769ade0 Harness orientation designation fixes (#435)
eb5020b Add the ability to communicate with BSM (#433)

git-subtree-dir: panda
git-subtree-split: 769ade0
pd0wm pushed a commit that referenced this pull request Feb 18, 2020
769ade0 Harness orientation designation fixes (#435)
eb5020b Add the ability to communicate with BSM (#433)

git-subtree-dir: panda
git-subtree-split: 769ade0
pd0wm pushed a commit that referenced this pull request Feb 18, 2020
769ade0 Harness orientation designation fixes (#435)
eb5020b Add the ability to communicate with BSM (#433)

git-subtree-dir: panda
git-subtree-split: 769ade0
pd0wm pushed a commit that referenced this pull request Feb 19, 2020
769ade0 Harness orientation designation fixes (#435)
eb5020b Add the ability to communicate with BSM (#433)

git-subtree-dir: panda
git-subtree-split: 769ade0
Vaggysag pushed a commit to Vaggysag/openpilot that referenced this pull request Apr 21, 2020
* Fix orientation designations in harness.h

* Fix orientation designations in black.h

* Fix orientation designations in uno.h

* Fix typo
mlocoteta pushed a commit to mlocoteta/openpilot that referenced this pull request Aug 7, 2021
cfranyota pushed a commit to cfranyota/openpilot-retired that referenced this pull request Aug 8, 2021
Kirito3481 pushed a commit to Kirito3481/openpilot that referenced this pull request Oct 8, 2024
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.

1 participant