Skip to content

mazda: filter false steerFaultTemporary at standstill (2022+ CX-5)#3145

Open
zephleggett wants to merge 7 commits intocommaai:masterfrom
zephleggett:mazda-fix-standstill-steer-fault
Open

mazda: filter false steerFaultTemporary at standstill (2022+ CX-5)#3145
zephleggett wants to merge 7 commits intocommaai:masterfrom
zephleggett:mazda-fix-standstill-steer-fault

Conversation

@zephleggett
Copy link

@zephleggett zephleggett commented Feb 21, 2026

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_BLOCK at standstill as a low-speed lockout (not actually a fault).
This causes every stop-and-go cycle to trigger a false steerFaultTemporary alert.

Older Mazdas never hit this because they don't engage LKAS below 45 kph — LKAS_BLOCK is already clear by the time steering activates.

How the filtering works

  • lkas_init_complete starts as False at every standstill
  • When the car moves and LKAS_BLOCK clears for the first time, lkas_init_complete flips to True
  • From that point on, if LKAS_BLOCK comes back while driving, it's treated as a real fault
  • When the car stops again, the flag resets and the cycle repeats

This 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 steerFaultTemporary are not filtered.

@github-actions github-actions bot added car related to opendbc/car/ mazda labels Feb 21, 2026
Copy link
Contributor

@github-actions github-actions bot left a comment

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
Copy link
Contributor

github-actions bot commented Feb 21, 2026

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 17 segments for: MAZDA_CX5, MAZDA_CX9_2021, MAZDA_CX5_2022

⚠️ 1 changed, 16 passed, 0 errors

Show changes

MAZDA_CX5_2022 - 8a9dac95d24c4e8d/2025-04-15--07-27-00/2

  steerFaultTemporary (1554 diffs)

  frames 0-489
  master:   _/‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾...
  PR:       ____________________________________________________________________...

  frames 4925-5999
  master:   _____/‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾...
  PR:       ____________________________________________________________________...

@zephleggett zephleggett marked this pull request as draft February 22, 2026 17:52
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.
@zephleggett zephleggett force-pushed the mazda-fix-standstill-steer-fault branch from 3b594c4 to 1656a20 Compare February 23, 2026 07:57
@zephleggett zephleggett changed the title mazda: fix spurious steer fault at standstill mazda: filter false steerFaultTemporary at standstill (2022+ CX-5) Feb 23, 2026
@zephleggett zephleggett marked this pull request as ready for review February 23, 2026 18:41
@zephleggett
Copy link
Author

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).
@zephleggett
Copy link
Author

I added a safety timer (500 frame) incase we enter fault during standstill and LKAS_BLOCK never goes to true.
This ensures this fix will never cause a real alert to be suppressed even during faults.

@yummydirtx
Copy link

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.

@chinna244
Copy link

I tried this out on my Mazda CX-5, and I’m super impressed! It works really well!

@zephleggett
Copy link
Author

@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

@yummydirtx
Copy link

Seconding on what @zephleggett said, this is a needed QOL change, hope for review or merge soon!

@zephleggett
Copy link
Author

I'll get some before and after segments to post :)

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

Labels

car related to opendbc/car/ mazda

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants