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

Hyundai CAN Longitudinal: New tuning with new API #33032

Closed
wants to merge 13 commits into from

Conversation

sunnyhaibin
Copy link
Contributor

@sunnyhaibin sunnyhaibin commented Jul 20, 2024

The new longitudinal API from bc303df does not work well for Hyundai CAN cars that support longitudinal control, whether the car has radar tracks or not. The tuning needs to be updated to adapt to the new longitudinal API.

Observed issues

  • Very delayed take off when the lead car starts taking off
Screencast.from.06-28-2024.10.26.21.PM.webm
  • Inconsistent acceleration when the speed reaches 20-25 MPH during acceleration
  • Delayed braking when coming to a stop

All sample routes are recorded from a 2023 Genesis G70 3.3T V6 AWD. Chill Mode in all routes. This means that the tuning may work well for ICE cars, but may observe a different experience for non-ICE cars (HEV, PHEV, EV).

Known Issues

  • Slowing down to zero behind a stopped lead car is still way too close for comfort. This is the same in stock openpilot without these changes. This PR does not target the new long API issue with stopped too close behind the stopped lead car.

Notes

  • All tests are done on a radar tracks available car. If the car does not have radar tracks available, it still uses the VOACC policy in Chill Mode, therefore the new tuning may not solve issues that are inherited from openpilot's VOACC in Chill Mode
  • This tune may apply to CAN-FD platforms, but untested. If you get a chance to verify on your CAN-FD platform, please let us know in the comments!

Baseline routes

  • 2bbe12792a30f61f/000001bf--ee29ef6515
  • 2bbe12792a30f61f/000001c0--ba9cfc8d23
  • 2bbe12792a30f61f/000001c1--1d6982f192
  • 2bbe12792a30f61f/000001c8--c2c44bb16e

Copy link
Contributor

github-actions bot commented Jul 20, 2024

Thanks for contributing to openpilot! In order for us to review your PR as quickly as possible, check the following:

  • Convert your PR to a draft unless it's ready to review
  • Read the contributing docs
  • Before marking as "ready for review", ensure:
    • the goal is clearly stated in the description
    • all the tests are passing
    • the change is something we merge
    • include a route or your device' dongle ID if relevant

@github-actions github-actions bot added car vehicle-specific hyundai labels Jul 20, 2024
@sunnyhaibin
Copy link
Contributor Author

sunnyhaibin commented Jul 23, 2024

Stock SCC behavior (SCC Reaction is set to Normal in car's settings)

JerkUpperLimit goes from the default 0.5 m/s^3 to 1.7 m/s^3. This seems to correlate with the differences between aReqRaw and aReqValue when StopReq is 1. JerkUpperLimit then ramps down in 0.1 m/s^3 interval after ~4 frames till aReqValue reaches 0 m/s^2, then "resets" to 0.5 m/s^3.

It is also observed that aReqValue converges from its current value to aReqRaw gracefully when there is a considerable difference between the 2 values, which currently is not being applied in stock openpilot.

Screencast.from.2024-07-22.11-08-48.webm

@sunnyhaibin
Copy link
Contributor Author

sunnyhaibin commented Jul 26, 2024

New tuning feedback on my 2023 Genesis G70 3.3T AWD (ICE):

  • Faster take off
  • Smoother slow down to stop
  • Smoother transitions between positive and negative accelerations

Slowing down to 0 behind a stopped lead car is still way too close for comfort. This is the same in stock openpilot without these changes. I believe the shouldStop bit can be improved a bit as @haraschax mentioned. @haraschax please let me know if you have any insights on this.

@sunnyhaibin sunnyhaibin force-pushed the hkg-can-long-tuning branch from c96fad9 to 39383f6 Compare July 26, 2024 15:36
zulufoxtrot added a commit to zulufoxtrot/frogpilot that referenced this pull request Aug 4, 2024
zulufoxtrot added a commit to zulufoxtrot/frogpilot that referenced this pull request Aug 17, 2024
@sshane
Copy link
Contributor

sshane commented Aug 20, 2024

We've moved the car interfacing code to our opendbc repository, which is now the new home for car ports and fingerprints. Please re-open your pull request against opendbc at your convenience by using this command below. This will transform all changes under selfdrive/car/ to opendbc/opendbc/car/. Make sure you have initialized submodules beforehand and have checked out the latest opendbc commit.

PR_NUMBER=33045
curl -L https://github.com/commaai/openpilot/pull/$PR_NUMBER.patch | sed -e 's/selfdrive\/car/opendbc_repo\/opendbc\/car/g' | git apply -v --reject

Simply replace the PR number with your own. Once done, add the files, fix any conflicts, and open a new PR. Alternatively, you may start a new PR from scratch if that is easier for you.

@sshane sshane closed this Aug 20, 2024
@sunnyhaibin sunnyhaibin deleted the hkg-can-long-tuning branch November 26, 2024 03:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
car vehicle-specific hyundai
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants