Skip to content

mazda: sync CX-9 cruise set speed with cluster for PXM7 PCM - #7

Open
maxzzznz wants to merge 1 commit into
zoompilot:mazda-devfrom
maxzzznz:pr/cx9-pxm7-cruise-scale
Open

mazda: sync CX-9 cruise set speed with cluster for PXM7 PCM#7
maxzzznz wants to merge 1 commit into
zoompilot:mazda-devfrom
maxzzznz:pr/cx9-pxm7-cruise-scale

Conversation

@maxzzznz

@maxzzznz maxzzznz commented Aug 25, 2026

Copy link
Copy Markdown

Summary

  • detect the PXM7 engine-firmware family on the 2021-23 CX-9 platform
  • use the observed PXM7 MRCC set-speed scale when publishing cruiseState.speed
  • keep the existing shared Mazda DBC scale for PXM4 North American CX-9s and every other Mazda platform

Problem

  • On a 2022 New Zealand-market CX-9 with PCM firmware PXM7-188K2-E, the set speed shown by ZoomPilot was consistently below the cluster value. The error grew with speed: roughly 2 km/h at moderate speeds and 3 km/h at 100 km/h.

  • This also means that when Speed Limit Assist applies a detected speed limit through ICBM, the vehicle’s cruise set speed can end up approximately 2–3 km/h higher than the requested limit, with the discrepancy increasing at higher speeds.

The shared Mazda DBC decodes CRZ_EVENTS.CRZ_SPEED as:

raw / 200 - 0.5

The route samples from this PXM7 CX-9 instead match:

(raw + 96) / 196

Extracted from real frames (route can be shared privately if needed):

Raw value Shared DBC result PXM7 result / cluster
6176 30.38 km/h 32 km/h
7352 36.26 km/h 38 km/h
10098 49.99 km/h 52 km/h
19504 97.02 km/h 100 km/h

This explains why the mismatch is proportional rather than a fixed rounding error. In terms of the already-decoded DBC value, the PXM7 conversion is equivalent to:

decoded * 50 / 49 + 1

Scope

The correction is deliberately gated on both:

  • MAZDA_CX9_2021 (the platform entry covering 2021-23 CX-9s)
  • engine firmware beginning with PXM7-188K2-

This targets the observed Oceania/export PCM family without changing the shared DBC or relying on the user's metric-display preference. A North American CX-9 owner reported that the existing scale is already correct, so PXM4 firmware remains on the current path.

Because this changes the published cruiseState.speed, downstream consumers such as the UI and cruise-button management receive the cluster-correct setpoint; this is not only an on-screen offset.

Tests

  • real route samples at 32, 38, 52, and 100 km/h
  • PXM7 D/E/F firmware revisions select the corrected scale
  • PXM4 CX-9 firmware keeps the shared DBC scale
  • CX-5 2022 and the older CX-9 platform remain unchanged
  • complete Mazda test suite: 130 passed
  • targeted Ruff checks pass

@maxzzznz maxzzznz changed the title mazda: fix CX-9 cruise set speed for PXM7 PCM mazda: sync CX-9 cruise set speed with cluster for PXM7 PCM Aug 25, 2026
@maxzzznz
maxzzznz marked this pull request as ready for review August 25, 2026 01:05
@mzdnick

mzdnick commented Aug 25, 2026

Copy link
Copy Markdown

Hey @maxzzznz , can you send the logs used to validate this to me on discord?

@zephleggett

Copy link
Copy Markdown

@maxzzznz Is this fixed for you in latest main/develop?

@maxzzznz

Copy link
Copy Markdown
Author

@maxzzznz Is this fixed for you in latest main/develop?

Just tested it unfortunately not fixed still have the discrepency on develop

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants