Conversation
MORE_GAS (0x167) byte 7 carries the cylinder mode: 41 = all cylinders, 10-17 = the PCM confirmation ramp toward deactivation, 20 = two cylinders latched off. The byte reports all-cylinders during fuel cut, so engineBraking is inferred from pedal-up and converter coupling (a flat rpm/speed ratio) with a 0.5 s confirm; there is no decel gate, because fuel cut survives grades. MORE_GAS is registered with the pt parser up front, unmapped modes hold the resolved state, and the DBC names the CYL_DEACT_STATE values.
mzdnick
force-pushed
the
mazda-cyl-deact-ui
branch
from
September 12, 2026 20:39
9d8f8f7 to
a5ee763
Compare
Idle creep in Drive holds the rpm/speed ratio flat at idle rpm, so the coupling gate passes without fuel cut and the ring shows engine braking in parking lots: 63 windows under 20 kph across the 12-route rlog corpus, 60 of them fully below 900 rpm (the idle band). Fuel cut never runs at idle rpm. Gate the overrun on EB_MIN_RPM = 1000. Corpus replay through this code: sub-20 kph engine braking 92.0 s -> 7.9 s; 40+ kph unchanged (863.1 s -> 861.1 s). Mazda tests: 571 pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Mazda reports cylinder deactivation on the bus but nothing decodes it. The PCM encodes it as a state machine in MORE_GAS (0x167) byte 7. There is no discrete fuel-cut flag anywhere: all 128 addresses in a driving capture were checked.
What
mazda_2017.dbc: newCYL_DEACT_STATEon MORE_GAS, value table in the signal comment: 41 all cylinders (also during fuel cut), 10-17 entry ramp, 20 two cylinders active, 30/40 exit transients.carstate_ext.py:CylinderState(normal / entry / deactivated / engineBraking) pluscyl_entry_progress, the ramp mapped to 0-1.engineBrakingis inferred: pedal up, rolling, converter coupled, confirmed 0.5 s. Coupling means the trailing 0.5 s of rpm/kph ratio stays flat (p95-p5 under 2.5 rpm/kph, above 8 kph). The inference is needed because the byte reads 41 during fuel cut, and fuel cut survives grades, so a decel gate cannot detect it.Validation
test_mazda_cyl_deact.py: 17 cases, all pass. Covers the state boundaries, ramp progress, coupling lock/unlock, and confirm timing.Known limitation
Merge note
Prerequisite for zoompilot/zoompilot#18
AI Usage
Disclaimer: GLM-5.3 by Z.ai was used to help develop, debug, and document this submission. All changes were reviewed and validated by a human.