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>
This commit is contained in:
2026-07-17 15:15:35 +02:00
parent 1f39e5537a
commit 0bd8f5c14d
12 changed files with 2099 additions and 27 deletions
+3
View File
@@ -83,6 +83,9 @@ typedef struct {
uint8_t pedal_percent; // 0x0AA ANG_ACPD
uint8_t engine_run_state; // 0x1D0 ST_ENGINE_RUN (ENGINE_RUN_* constants)
uint8_t gearbox_cooling; // 0x0B5 ST_OTMP_GRB (GEARBOX_COOL_* constants)
uint8_t converter_clutch; // 0x0BA ST_CCLT (CCLT_* constants). When CLOSED,
// turbine_rpm == engine_rpm by design — read this
// before interpreting the two as a slip ratio.
bool gear_mismatch; // lever (0x1D2) vs gearbox (0x0BA) disagree,
// sustained past the debounce window
} driveline_t;
+41 -8
View File
@@ -156,19 +156,40 @@ typedef struct __attribute__((packed)) {
#define CAN_ID_GEARBOX_STATE 0x0BA
#define CAN_BYTE_GEARBOX_TARGET 0 // low nibble = ST_GR_GRB
// ST_GR_GRB (byte 0, low nibble). 1/2/3/5 verified live; 6..0xA inferred from
// the identical ladder in 0x1D2 byte 1. Value 4 unaccounted for.
// ST_GR_GRB (byte 0, low nibble). Every value 1/2/3/5..0xA observed live in the
// 2026-07-17 drive capture. Value 4 remains unaccounted for.
// This nibble alone is a COMPLETE gear source: P/R/N plus 1st..6th, reverse
// included. 0x1D2 is still needed for the lever and the D/S/M mode, which this
// message does not carry.
#define GRB_TARGET_NEUTRAL 1
#define GRB_TARGET_REVERSE 2
#define GRB_TARGET_PARK 3
#define GRB_TARGET_GEAR1 5 // ..0xA = 6th
#define GRB_TARGET_GEAR6 0xA
#define GRB_TARGET_INVALID 0xF
// Bytes 3-4: output shaft speed. UNDOCUMENTED in every source; zero in every
// stationary frame (including engaged-in-D), non-zero once the wheels turn.
// This is the project's only road-speed signal — there is no DSC/wheel-speed
// module on this bus. SCALING IS NOT CALIBRATED — do not convert to a physical
// unit yet. See wiki/pages/driveline-speed-signals.md
// Byte 0 bits 6-7: ST_CCLT, torque converter lockup clutch. Relevant to any
// turbine-vs-engine ratio test: a CLOSED clutch makes turbine == engine exactly,
// so ratio ~1.0 at road speed means "locked up", not "not engaged".
#define CAN_BYTE_CONVERTER_CLUTCH 0
#define CCLT_DISENGAGED 0
#define CCLT_CONTROLLED 1
#define CCLT_CLOSED 2
#define CCLT_INVALID 3
// Bytes 3-4: output shaft speed, 16-bit little-endian. UNDOCUMENTED in every
// source. Identification is verified (rises monotonically 1st->6th under drive,
// zero whenever the output is held, including engaged-in-D). This is the
// project's only road-speed signal — there is no DSC/wheel-speed module on this
// bus.
//
// SCALING IS STILL A HYPOTHESIS: raw * 0.125 = output shaft rpm implies a
// coherent 901->1872 rpm upshift schedule across the five 6HP26X ratios, where
// raw-as-rpm would imply 7,200-15,000 rpm against a ~4,500 redline. But it rests
// on "max output per gear = the upshift point", which is unproven. Carried as
// RAW COUNTS until a capture including 0x1A2 settles it (turbine / output gives
// each ratio directly). Do not convert to a physical unit here.
// See wiki/pages/driveline-speed-signals.md
#define CAN_BYTE_OUTPUT_SHAFT_L 3
#define CAN_BYTE_OUTPUT_SHAFT_H 4
@@ -358,10 +379,22 @@ static inline gear_position_t can_to_target_gear(uint8_t nibble) {
default: break;
}
// 5..0xA = forward gears 1..6 (same ladder as 0x1D2 byte 1)
if (nibble >= GRB_TARGET_GEAR1 && nibble <= 0xA) return GEAR_DRIVE;
if (nibble >= GRB_TARGET_GEAR1 && nibble <= GRB_TARGET_GEAR6) return GEAR_DRIVE;
return GEAR_UNKNOWN;
}
/**
* Extract the engaged gear number from a 0x0BA ST_GR_GRB nibble.
* Unlike 0x1D2 byte 1, this ladder is the whole picture — but it numbers only
* the forward gears, so P/R/N still return 0.
* @param nibble Low nibble of 0x0BA byte 0
* @return 1..6, or 0 if not in a numbered forward gear
*/
static inline uint8_t can_to_target_gear_num(uint8_t nibble) {
if (nibble < GRB_TARGET_GEAR1 || nibble > GRB_TARGET_GEAR6) return 0;
return (uint8_t)(nibble - GRB_TARGET_GEAR1 + 1);
}
/**
* Get human-readable gear position string
* @param gear Gear position enum value