Skip to content

hyundai: add speed-dependent steering torque limits for Kia EV6 - #3720

Open
TonyBinheWu wants to merge 1 commit into
commaai:masterfrom
TonyBinheWu:feature/hyundai-canfd-dynamic-torque
Open

hyundai: add speed-dependent steering torque limits for Kia EV6#3720
TonyBinheWu wants to merge 1 commit into
commaai:masterfrom
TonyBinheWu:feature/hyundai-canfd-dynamic-torque

Conversation

@TonyBinheWu

@TonyBinheWu TonyBinheWu commented Sep 5, 2026

Copy link
Copy Markdown

This proposes an EV6-only, speed-dependent steering torque envelope to investigate reported saturation near 13 m/s. A preliminary, user-provided qlog summary from a downstream build reports output at -270 before driver steering input, with desired curvature about 14% above achieved curvature. The raw route was not re-analyzed during this implementation. The 310 maximum is a candidate for validation, not a validated physical steering limit.

Changes:

  • Enable the new platform and safety flags only for CAR.KIA_EV6.
  • Use the lookup [9, 13, 17] m/s -> [310, 310, 270]: 310 through 13 m/s, linearly decreasing to 270 at 17 m/s.
  • Use vEgoRaw for controller scaling, driver torque limiting, and normalized actuator feedback.
  • Have Panda independently calculate the limit from its existing wheel-speed samples using dynamic_max_torque / max_torque_lookup. Cap the generic framework's speed/torque tolerance at the rounded nominal curve, so the limit is 270 once the minimum sampled speed reaches 17 m/s. This EV6-specific cap leaves the shared framework unchanged.
  • Preserve rate up/down 2/3, RT delta 112, driver allowance/multiplier 250/2, and the existing EPS fault-avoidance behavior.

Tests cover platform scope, emitted CAN torque and feedback, interpolation boundaries, wheel-speed quantization, flag reset, driver intervention, rates, and steering-request checks across six CAN-FD safety configurations. The existing non-actuating CAN-address overlap exception is extended to the new LKAS-longitudinal test class.

Validation

  • Dongle ID: 6ad0cf8b8fa699c3
  • Route: https://connect.comma.ai/6ad0cf8b8fa699c3/0000004e--70042997e1
  • python -m unittest discover -q: 4,206 tests, 726 skipped, passed.
  • UV_OFFLINE=1 ./opendbc/safety/tests/test.sh: 3,391 tests, 416 skipped, passed; 100% line coverage for all checked safety files.
  • Ruff, ty, codespell, cpplint, MISRA, and git diff --check: passed.
  • ./test.sh was attempted. Its parallel unittest runner could not start because this environment denies its local IPC socket. The same default unittest discovery passed in a single process, as listed above.

Keeping this PR in draft pending stock openpilot reproduction and before/after route plots for requested/applied torque, curvature tracking, driver torque, lateral acceleration, and jerk. Bench tests do not establish the vehicle's physical steering limits.

@github-actions github-actions Bot added car related to opendbc/car/ hyundai car safety vehicle-specific safety code labels Sep 5, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for contributing to opendbc! 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
    • include a route or your device' dongle ID if relevant

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

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 260 segments for: HYUNDAI_AZERA_HEV_6TH_GEN, HYUNDAI_ELANTRA_GT_I30, HYUNDAI_ELANTRA_2021, HYUNDAI_ELANTRA_HEV_2021, HYUNDAI_GENESIS, HYUNDAI_IONIQ, HYUNDAI_IONIQ_HEV_2022, HYUNDAI_IONIQ_EV_2020, HYUNDAI_IONIQ_PHEV_2019, HYUNDAI_IONIQ_PHEV, HYUNDAI_KONA_2022, HYUNDAI_KONA_EV, HYUNDAI_KONA_EV_2022, HYUNDAI_KONA_EV_2ND_GEN, HYUNDAI_SANTA_FE, HYUNDAI_SANTA_FE_2022, HYUNDAI_SANTA_FE_HEV_2022, HYUNDAI_SANTA_FE_PHEV_2022, HYUNDAI_SONATA, HYUNDAI_SONATA_LF, HYUNDAI_STARIA_4TH_GEN, HYUNDAI_PALISADE, HYUNDAI_SONATA_HYBRID, HYUNDAI_IONIQ_5, HYUNDAI_IONIQ_6, HYUNDAI_TUCSON_4TH_GEN, HYUNDAI_SANTA_CRUZ_1ST_GEN, HYUNDAI_CUSTIN_1ST_GEN

✅ 0 changed, 260 passed, 0 errors

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

Labels

car safety vehicle-specific safety code car related to opendbc/car/ hyundai

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant