The engine first computes requested lock percent in get_lock_target_adjustment(), then converts it per-byte with get_lock_target_adjusted_value(base, invert).
// lock_target conversion (simplified)
requested_lock = clamp(lock_target, 0, 100)
if (requested_lock >= 99.5) requested_lock = 100
if (requested_lock >= 100) return invert ? (0xFE - base) : base
if (requested_lock <= 0) return invert ? 0xFE : 0x00
factor = (requested_lock * 0.5) + 20
corrected = uint8_t(base * (factor / 100))
return invert ? (0xFE - corrected) : corrected
| Input |
Example |
Result |
requested_lock = 50%, base = 0xFE, invert = false |
factor = 45, corrected = 254 * 0.45 |
0x72 (114 decimal) |
requested_lock = 50%, base = 0xFE, invert = true |
0xFE - 0x72 |
0x8C (140 decimal) |
requested_lock = 0% |
neutral output |
0x00 (or 0xFE when inverted) |
requested_lock = 100% |
full-scale output |
base (or 0xFE - base when inverted) |
Important: this is an empirically tuned command-level abstraction. A requested 50% lock is not guaranteed to equal an exact physical 50:50 torque split under all driveline conditions.