Skip to content

Hyundai: Car Port for Kona 2022#1137

Merged
adeebshihadeh merged 16 commits into
commaai:masterfrom
sunnypilot:kona-2022-port
Feb 23, 2025
Merged

Hyundai: Car Port for Kona 2022#1137
adeebshihadeh merged 16 commits into
commaai:masterfrom
sunnypilot:kona-2022-port

Conversation

@sunnyhaibin

@sunnyhaibin sunnyhaibin commented Aug 20, 2024

Copy link
Copy Markdown
Contributor

Checklist

  • added entry to CarInfo in selfdrive/car/*/values.py and ran selfdrive/car/docs.py to generate new docs
  • test route added to routes.py
  • route with stock system: 3bd70ed1a93771dc|2023-09-19--19-16-45
  • route with openpilot: 0099bdb24d82951b/00000005--c38d940b04
  • harness Type: Hyundai O
  • architecture: CAN

Link to all physical parts during installation

Thanks to the community 2022 Hyundai Kona owner big_bull_ (Discord) and johnnathanwood.

Requires

Supersedes commaai/openpilot#30025

@github-actions github-actions Bot added car related to opendbc/car/ hyundai fingerprint labels Aug 20, 2024
@github-actions

Copy link
Copy Markdown
Contributor

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

@sunnyhaibin

Copy link
Copy Markdown
Contributor Author

More Ecu.transmission firmware: 0099bdb24d82951b/00000001--582f1c0a5d

@jyoung8607 jyoung8607 self-assigned this Sep 26, 2024
@jyoung8607

Copy link
Copy Markdown
Collaborator

At a glance it looks okay, presuming the lateral accel magnitude tweak was correct, but that's hard to judge with the data available. The test routes are present, but I think they were probably driven on the higher limits, plus torqued wasn't running to judge how the car was performing, plus some actuator output structures have been refactored.

Can you procure a new test route for this one? Have them drive on this branch, with the proposed limits, and take some curves to see where it maxes out.

…port

# Conflicts:
#	opendbc/car/hyundai/interface.py
@jyoung8607
jyoung8607 marked this pull request as draft September 26, 2024 22:06
@sunnyhaibin

Copy link
Copy Markdown
Contributor Author

At a glance it looks okay, presuming the lateral accel magnitude tweak was correct, but that's hard to judge with the data available. The test routes are present, but I think they were probably driven on the higher limits, plus torqued wasn't running to judge how the car was performing, plus some actuator output structures have been refactored.

Can you procure a new test route for this one? Have them drive on this branch, with the proposed limits, and take some curves to see where it maxes out.

@johnnathanwood can you install and update here when you get a chance?

@sunnyhaibin

Copy link
Copy Markdown
Contributor Author

New test route: 0099bdb24d82951b/00000005--c38d940b04

@sunnyhaibin
sunnyhaibin marked this pull request as ready for review September 27, 2024 06:23
@jyoung8607
jyoung8607 marked this pull request as draft September 27, 2024 20:04
@github-actions

Copy link
Copy Markdown
Contributor

This PR has had no activity for 9 days. It will be automatically closed in 2 days if there is no activity.

@github-actions github-actions Bot added the stale label Nov 17, 2024
…port

# Conflicts:
#	opendbc/car/hyundai/fingerprints.py
#	opendbc/car/hyundai/interface.py
#	opendbc/car/hyundai/values.py
#	pyproject.toml
@github-actions github-actions Bot added car safety vehicle-specific safety code and removed fingerprint labels Feb 23, 2025
@sunnyhaibin
sunnyhaibin marked this pull request as ready for review February 23, 2025 06:12
@adeebshihadeh

Copy link
Copy Markdown
Contributor

So this ALT_LIMITS scheme has a unique failure mode, where a simple bug can silently allow more torque than expected. If the wrong safety mode is selected for any other supported car, the worst case is the RX checks are invalid (so no actuation) and any TX is blocked (since there's overlap).

I already wasn't super happy about this with the original ALT_LIMITS, but this car seems to have even more torque.

Net, I think it's better to get this merged as dashcam than not merge at all, such that it's detected and disabled. We'll have to revisit this at some point to un-dashcam it.

@adeebshihadeh
adeebshihadeh merged commit 7cb10b6 into commaai:master Feb 23, 2025
@adeebshihadeh
adeebshihadeh deleted the kona-2022-port branch February 23, 2025 07:33
@sshane

sshane commented Jun 2, 2025

Copy link
Copy Markdown
Contributor

@adeebshihadeh these cars are not dashcammed due to the line below...

ret.dashcamOnly = candidate in {CAR.KIA_OPTIMA_H, }

eli-davis pushed a commit to eli-davis/opendbc_reference that referenced this pull request Jul 15, 2025
* Hyundai: Car Port for Kona 2022

* alt steering 2 with 170

* add test route

* remove abs and engine fw

* no date platform

* point to feature branch to pass unit test for now

* another user's FW

* new test route

* add back flag

* migrate safety and safety tests to opendbc

* dashcam it

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
kamdeva pushed a commit to kamdeva/opendbc that referenced this pull request May 14, 2026
Revert "`LagdToggle`: refactor and only instantiate once (commaai#1130)"

This reverts commit 6ae668e.
kamdeva pushed a commit to kamdeva/opendbc that referenced this pull request May 14, 2026
) (commaai#1138)

* Reapply "`LagdToggle`: refactor and only instantiate once" (commaai#1137)

This reverts commit b4f19d4.

* infinite woo gone

* use them hz
FeistyFinn pushed a commit to FeistyFinn/opendbc that referenced this pull request Jun 25, 2026
* Hyundai: Car Port for Kona 2022

* alt steering 2 with 170

* add test route

* remove abs and engine fw

* no date platform

* point to feature branch to pass unit test for now

* another user's FW

* new test route

* add back flag

* migrate safety and safety tests to opendbc

* dashcam it

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
@johnnathanwood

Copy link
Copy Markdown
Contributor

I run one of these — a gas Kona 2022 (the ALT_LIMITS_2 / 170 Nm car, dashcamOnly today) — and I've been logging it against the current learned tune. Toward the un-dashcam revisit noted here, and jyoung8607's ask for a route that takes curves near the limit, here's what I have so far, stated with its limits up front.

  • ~67,376 actively-steering frames on one learned seed (latAccelFactor 2.84 / friction 0.087). Post-clamp commanded torque peaked at 170/170 Nm; 0 frames over 170 across all 67,376, and at the 170 ceiling only 0.3% of the time. The 170 is held independently by both the car-side limiter (apply_driver_steer_torque_limits, STEER_MAX 170, up 2 / down 3) and the panda TX check (HYUNDAI_LIMITS(170, 2, 3)).
  • Live torque learner converged: latAccelFactor 2.747 ±0.033 (3.3% off seed), friction 0.083 ±0.002 (4.9% off seed), over 21/38 liveValid drives. Lateral-accel tracking error 0.043 m/s² mean; actual/desired gain 1.006.
  • Steer faults: 0 permanent, 166 transient (stating both).

Honest gaps: this is only ~2.0 engaged hours, and envelope coverage is 14/16 cells — I don't yet have hard cornering (>3 m/s² lateral accel) at 40–60 mph or 60+ mph. So it's data toward the question, not a claim the envelope is fully exercised. I'm happy to go collect the missing cells — curves near the limit, the kind of route jyoung8607 asked for — if that would help the revisit.

One thing I wanted to check before doing anything beyond that: I take it the intended direction (per #3026 / #2072) is to move torque cars off the ALT_LIMITS-style tier flags rather than keep tuning them, so the flag becomes a transition detail. I'd rather pull in that direction than propose anything of my own. As a small interim guard, I opened #3523 to add ALT_LIMITS_2 coverage to test_alternate_limits, so the conservative tier can't silently regress in the meantime.

Separately, and unrelated to the safety limits: I'm also planning a normal tuning PR for this car's native lateral torque params (it currently borrows the EV Kona's). That's a tuning change only.

Mostly I want to make sure I'm helping in the direction you already intend. Glad to pitch in on the Hyundai safety cleanup in #1942 if that's useful.

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 stale

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants