Files
ESP32-S3-Touch-LCD-5B/wiki/pages/driveline-speed-signals.md
T
julian 0bd8f5c14d Drive capture: 0x0BA gear ladder verified, output-shaft scaling narrowed
First capture with the vehicle actually moving (raw/log_20260717_145930.txt,
1857 frames, filtered to 0x0BA + 0x1D2).

Verified, closing yesterday's inference: ST_GR_GRB values 6/7/8/9/A observed
directly = 2nd..6th. So 0x0BA byte 0's low nibble is a COMPLETE gear source
on its own - P/R/N plus 1st..6th, reverse included. 0x1D2 is now needed only
for the lever and the D/S/M mode, which 0x0BA does not carry. Value 4 is
still unaccounted for.

Also caught ST_CCLT (torque converter lockup clutch) live - 422 frames
"controlling", clustered in the higher gears. This matters beyond curiosity:
a closed clutch bolts the turbine to the impeller, so turbine == engine
exactly. Any turbine/engine slip ratio read at road speed must check CCLT
first or it will report "not engaged" for a perfectly healthy locked-up box.
Decoded into driveline_t with that warning attached.

Output shaft: identification now verified (rises monotonically 1139->16702
across gears 1->6, zero whenever the output is held). Scaling narrowed to
x0.125 but NOT adopted - it implies a coherent 901->1872 rpm upshift schedule
across five independent 6HP26X ratios, where raw-as-rpm would imply
7,200-15,000 rpm against a ~4,500 redline. Still rests on the unproven
assumption that each gear's max output is its upshift point, so the field
stays in raw counts. One capture including 0x1A2 settles it: turbine/output
gives each ratio directly.

Gearbox confirmed as ZF 6HP26X (user). Same gearset as the 6HP26, so the
ratio table holds; the X is the xDrive output variant, which dates the donor
to E60/E61 rather than E65 - the 7-series never took M57N with xDrive. That
partly answers a standing open question, and raises a new one: the X box
measures its output shaft upstream of the transfer case, so if a Patrol
transfer case sits in the path its ratio enters the km/h conversion and
changes with high/low range.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-17 15:15:35 +02:00

176 lines
11 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
type: concept
tags: [can-bus, egs, dde, speed, gear, cruise-control, verified]
updated: 2026-07-17
---
# Driveline Speed Signals
The three rotating speeds our bus exposes — **engine**, **turbine (gearbox input)**, and **output shaft** — and why they matter well beyond the gear display. Together they give (a) a physical proof of gear engagement that no status byte can provide, and (b) the feedback variable a **cruise-control proof of concept** would be built on.
> [!important] Why this page exists
> The swap bus carries **no DSC module** — the 2026-07-15 capture found 15 IDs and *none* of the chassis/stability IDs (`0x0CE`, `0x19E`, `0x1A0`) the [[e65-reverse-engineering-repo]] documents. **There is no wheel-speed message on this bus.** So the gearbox's own shaft speeds are not a nice-to-have — they are the *only* road-speed information available to us. Anything speed-dependent this project ever does, including cruise control, has to come from here.
## The three speeds
| What | ID | Bytes | Decode | Status |
|---|---|---|---|---|
| **Engine RPM** | `0x0AA` `RPM_ENG` | bits 32–47 | `(D4 + D5×256) × 0.25` 1/min | ✅ **verified** — 679–684 at idle |
| **Turbine (input)** | `0x1A2` `RPM_GRB_TURB` | bits 0–15 | `(D0 + D1×256) × 0.125 + 6` 1/min | ✅ **verified** — see below |
| **Output shaft** | `0x0BA` bits 20–39 | D3/D4 | ⚠ **uncalibrated** | 🔬 **hypothesis** — see below |
`0x1A2` is DLC 4 @ 20 ms; `0x0AA` is DLC 8 @ 10 ms; `0x0BA` is DLC 8 @ 20 ms. All three are fast — good for a control loop.
> [!note] Do not use `GRDT_REIN` (`0x0BA` bits 8–19)
> The repo documents it as a gearbox speed (×0.125 1/min), but on **our** bus it reads `0xFFE`/`0xFFF` — the invalid marker — across every frame of both captures. Not populated here. `0x1A2` is the turbine source that works. (verified, 2026-07-17)
## Turbine speed = physical proof of engagement ✅
The single most useful thing this ingest produced. Correlating `0x1A2` against lever position across the 2026-07-15 capture (engine idling ~680 rpm, vehicle stationary on its brakes):
| Lever | Frames | Turbine min | **avg** | max |
|---|---|---|---|---|
| P | 1370 | 6 | **634** | 652 |
| N | 95 | 6 | **628** | 649 |
| **D** | 458 | 6 | **70** | 652 |
| **R** | 2 | 6 | **~0** | 6 |
(verified, 2026-07-17 — derived from `raw/can-capture-2026-07-15-gearshift.csv`)
This is textbook torque-converter behaviour and it is unambiguous:
- **P/N** — nothing is engaged, so the turbine free-spins at roughly engine speed (~630 vs ~680; the gap is normal converter slip).
- **D/R** — the box engages, the output shaft is held by the brakes, and the turbine **stalls to near zero**.
The D column's `max` of 652 and the wide min/max spread are just the transition frames as the lever passed through — the *average* tells the story.
### Why this beats every status byte
`ST_GR_GRB` (`0x0BA`) tells you what the gearbox **intends**. `0x1D2` D0 tells you what the driver **selected**. Neither is proof that anything mechanically happened. **Turbine speed is a physical measurement of load** — the box can't fake it.
**The engagement test** is the *ratio* of turbine to engine speed, not the absolute value:
```
ratio = RPM_GRB_TURB (0x1A2) / RPM_ENG (0x0AA)
ratio ≈ 1.0 → turbine free-spinning → NOT engaged (normal in P/N)
ratio ≈ 0 → turbine stalled/loaded → engaged, output held
0 < ratio < 1 → engaged and moving (converter slip under load)
```
This directly answers the UX problem that motivated the search — *"lever says R but the car isn't moving."* With the vehicle on the ground and the brake released:
- lever = R, **ratio ≈ 0 or climbing from 0** → box engaged, it's working
- lever = R, **ratio ≈ 1.0** → **the box never took the request** ⚠ this is the fault to surface
> [!warning] The ratio is only meaningful under known output conditions
> On a **lift with the wheels free**, an engaged box spins the wheels up until the turbine approaches engine speed again — so `ratio ≈ 1.0` is normal there and does **not** indicate a fault. The test is only valid when the output is loaded (on the ground). Any firmware use of this must gate on output-shaft speed ≈ 0, or the display will cry wolf every time the car is jacked up.
>
> **Second exception: the lockup clutch.** `ST_CCLT` (`0x0BA` D0 bits 6–7) mechanically bolts the turbine to the impeller at cruise to eliminate slip — when it's closed, turbine = engine speed *exactly*. So at road speed, ratio ≈ 1.0 means "locked up", not "not engaged". Seen live in the higher gears of the 2026-07-17 capture (422 frames reading "controlling"). Any moving-vehicle use of the ratio must read `ST_CCLT` first. The standstill test is unaffected — the clutch is open at rest.
## Output shaft speed — the cruise-control variable 🔬
`0x0BA` bits **20–39** (D2 high nibble, D3, D4) are a **gap in the published source** — the [[e65-reverse-engineering-repo]] table jumps from `GRDT_REIN` at bit 19 straight to the checksum at bit 40. Its own E65 example leaves those bytes zero. **Our bus populates them.**
Evidence that they are an output-shaft/road-speed field (verified, 2026-07-17):
| Condition | D3 | D4 | Turbine | Interpretation |
|---|---|---|---|---|
| P — stationary | `00` | `00` | ~634 | output stopped |
| N — stationary | `00` | `00` | ~628 | output stopped |
| **D — stationary, brakes on** | `00` | `00` | **~70** | engaged but **output held** → zero |
| **R — wheels lifted & turning** | `A8` | `01` | — | **output turning → non-zero** |
The field is zero in *every* stationary frame **including engaged-in-D**, and non-zero the moment the wheels actually rotate. That decouples it from engine, turbine, and gear state — it tracks the **output shaft** and nothing else. Which is exactly the definition of road speed, minus a diff ratio and a tyre circumference.
### The drive capture — identification settled, scaling narrowed
The 2026-07-17 drive capture ([[can-capture-2026-07-17-drive]]) put the vehicle in motion through all six gears. Output vs `ST_GR_GRB` gear:
| Gear | Frames | Min | Avg | Max |
|---|---|---|---|---|
| 1 | 189 | 0 | 1139 | 1728 |
| 2 | 238 | 40 | 2911 | 4832 |
| 3 | 77 | 1640 | 6133 | 7888 |
| 4 | 93 | 2192 | 9152 | 11464 |
| 5 | 127 | 5160 | 12991 | 17272 |
| 6 | 94 | 13640 | 16702 | 18312 |
Monotonic with gear, overlapping at shift points, starting at zero. **The identification as output shaft speed is settled.** (verified, 2026-07-17)
### 🔬 Scaling: ×0.125 — strong hypothesis, not measured
Taking each gear's max output as its upshift instant and multiplying by the 6HP26 ratio recovers the engine speed at that shift:
| Gear | ×0.125 → rpm | ratio | **implied engine rpm** |
|---|---|---|---|
| 1 | 216 | 4.171 | **901** |
| 2 | 604 | 2.340 | **1413** |
| 3 | 986 | 1.521 | **1500** |
| 4 | 1433 | 1.143 | **1638** |
| 5 | 2159 | 0.867 | **1872** |
A smooth, gently-rising upshift schedule — textbook M57N at light throttle. Five independent ratios landing on a coherent curve is hard to get by chance. The alternative (raw = rpm) implies upshifts at **7,200–15,000 rpm** against a ~4,500 redline — ruled out.
The gearbox is a confirmed **6HP26X** (user, 2026-07-17), so the ratio table is right. The one assumption left standing is **max-output-per-gear = upshift point**.
### Finishing it (one capture)
Log **`0x1A2` alongside `0x0BA`** at steady speed through the gears. **Turbine ÷ output gives each gear ratio directly** — no assumption about shift points — and simultaneously cross-checks the box identity against the 6HP26 table. `0x0AA` for engine rpm makes it airtight. The 2026-07-17 capture was filtered to `0x0BA`/`0x1D2` only, which is the sole reason this is still open.
`docs/6HP26.pdf` in the source repo would confirm the ratios from a document rather than recollection. → [[open-questions]] wishlist.
### Raw counts → km/h
Still needs numbers nobody has written down. The 6HP26**X** measures its output shaft **upstream of the transfer case**, so the conversion depends on the swap's driveline:
- BMW transfer case retained → rear output ~1:1, math unaffected
- Transfer case deleted, straight to the Patrol driveline → also fine
- A Patrol transfer case in the path → its ratio enters the calculation **and changes with high/low range**, making road speed range-dependent
Plus the Patrol's final drive ratio and tyre size. → [[nissan-patrol-swap]], [[open-questions]] #10
## Cruise control: what the bus already gives us
The DME publishes its own cruise/ACC regulation state. `0x0AA` `ST_CLCTR_V` (bits 52–55):
| Value | Meaning |
|---|---|
| `0x0` | ACC regulation, pedal not pressed |
| `0x1` | ACC regulation, pedal pressed |
| `0x4` | **CC regulation, retard** |
| `0x5` | **CC regulation, constant speed** |
| `0x6` | **CC regulation, recall** |
| `0x7` | **CC regulation, speed up** |
| `0x8` | Pedal not pressed |
| `0x9` | Pedal pressed |
| `0xA` | Pedal transgress |
| `0xB` | Pedal kickdown |
(source: [[e65-reverse-engineering-repo]]. Our capture reads `0x0` on all 3835 frames — pedal untouched, consistent with a stationary idling test. (verified, 2026-07-17))
Also available: **`ANG_ACPD`** (`0x0AA` bits 24–31, ×0.39063 %) — accelerator pedal position, `0x00` unpressed → `0xFF` floored. And **`TORQ_DVCH`** (bits 12–23, signed ×0.5 Nm) — driver-demand torque.
### Why a PoC is architecturally plausible
The E65 powertrain is built around **external modules requesting torque from the DME** — that is precisely what `0x0B5` ("Torque Request EGS") is, and what `0x0BA`'s repo title ("Torque Request ACC") points at. The DME arbitrates requests from the EGS, from ACC, and from itself; `ST_CLCTR_V` is it *reporting which regulator currently has the ball*. So the plumbing for "another module asks the engine for torque" is native to this bus, not something we'd have to invent.
A PoC would then need:
- **Feedback**: output shaft speed (`0x0BA` D3/D4) — *the only road-speed source we have* ⬅ the reason this page exists
- **Actual/limits**: `RPM_ENG`, `ANG_ACPD` (driver override — pedal press must instantly disengage)
- **Engagement sanity**: turbine ratio, so it can't regulate against a box in N
- **Actuation**: a torque-request frame the DME accepts
> [!danger] Actuation is a different category of risk from everything so far
> Every capability in this project to date is **read-only**. A cruise-control PoC **transmits frames that command engine torque**. Getting the ID, scaling, checksum, or alive counter wrong doesn't produce a bad reading — it produces **unintended acceleration**. Additional hazards specific to our situation:
> - The board already runs `TWAI_MODE_NORMAL` and ACKs the bus, so transmit is one function call away — there is **no accidental-write safety margin** left. → [[can-bus-integration]]
> - `0x0B5`/`0x0BA` carry **checksums and alive counters**; the DME rejects (and may fault on) malformed requests. Both algorithms are unknown to us.
> - The swap has **no DSC and no brake-pedal switch on the bus** we've found — so the usual "brake cancels cruise" interlock has no source. A PoC would have no independent way to know the driver is braking.
>
> Treat this as a **bench/lifted-wheels-only** exercise until every one of those is resolved. Nothing here should be enabled on a moving vehicle on the strength of a wiki page.
## Related
[[e65-reverse-engineering-repo]] · [[can-id-candidates]] · [[gear-box-can-revealings]] · [[can-bus-integration]] · [[nissan-patrol-swap]] · [[open-questions]]