mazda: filter false steerFaultTemporary at standstill (2022+ CX-5)#3145
mazda: filter false steerFaultTemporary at standstill (2022+ CX-5)#3145zephleggett wants to merge 7 commits intocommaai:masterfrom
Conversation
There was a problem hiding this comment.
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
Car behavior reportReplays driving segments through this PR and compares the behavior to master. Testing 17 segments for: MAZDA_CX5, MAZDA_CX9_2021, MAZDA_CX5_2022 Show changes |
The CX-5 2022 has minSteerSpeed=0, so it engages steering from 0 kph. The EPS asserts LKAS_BLOCK at standstill as a low-speed lockout, not a real fault. Older Mazdas never see this because they don't engage below 45 kph. Track when LKAS_BLOCK clears for the first time after each standstill via `lkas_init_complete`, and only report steerFaultTemporary after that point. This prevents false alerts in stop-and-go traffic.
3b594c4 to
1656a20
Compare
|
I've tested this for a couple days now and everything is working as expected. |
If LKAS_BLOCK is persistently asserted from startup (genuine EPS fault), lkas_init_complete would never become True, permanently hiding the fault. Add a 500-frame (5s) timeout so the filter expires and steerFaultTemporary surfaces. Normal EPS boot clears in ~3.6s so 5s gives comfortable margin. Matches VW's eps_init_complete pattern (frame > 600).
|
I added a safety timer (500 frame) incase we enter fault during standstill and |
|
Tested this on a few real drives in my Mazda CX-5, seems to successfully eliminate the annoying and frequent pings whenever the car reached a standstill in traffic on ACC. |
|
I tried this out on my Mazda CX-5, and I’m super impressed! It works really well! |
|
@adeebshihadeh Sorry to bug you, but I think this change would make the experience much better for our Mazda drivers. Please let me know if I can assist or change anything. thanks for your time! :3 |
|
Seconding on what @zephleggett said, this is a needed QOL change, hope for review or merge soon! |
|
I'll get some before and after segments to post :) |
Motivation
Users with 2022+ Mazda CX-5s experience unneeded 'Place Hands on Wheel' alerts during stop and go traffic when cruise engaged. The alert only happens at standstill speeds so it's more an annoyance than helping the user stay safe.
Details
The 2022+ Mazda CX-5 has
minSteerSpeed=0, so openpilot engages steering from 0 kph.However, the EPS asserts
LKAS_BLOCKat standstill as a low-speed lockout (not actually a fault).This causes every stop-and-go cycle to trigger a false
steerFaultTemporaryalert.Older Mazdas never hit this because they don't engage LKAS below 45 kph —
LKAS_BLOCKis already clear by the time steering activates.How the filtering works
lkas_init_completestarts asFalseat every standstillLKAS_BLOCKclears for the first time,lkas_init_completeflips toTrueLKAS_BLOCKcomes back while driving, it's treated as a real faultThis means the EPS low-speed lockout at standstill is ignored, but any real steering fault while driving is still caught.
VW uses the same pattern (
eps_init_complete) to filter EPS init faults before the HCA module is ready.Testing Notes
I've been testing this on real drives for a couple day. I have also replayed old rlogs through Mazda CarState to verify that any real
steerFaultTemporaryare not filtered.