Skip to content

Implement sport kick-down automation - #73

Merged
wpmed92 merged 1 commit into
mainfrom
sport-kickdown
Sep 14, 2026
Merged

wpmed92 merged 1 commit into
mainfrom
sport-kickdown

Conversation

@wpmed92

@wpmed92 wpmed92 commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Switches the pedal map from Chill to Sport while the accelerator is held past
a threshold in Drive, and reverts when the pedal is released.

How it works

  • On every DI_systemStatus frame, read DI_accelPedalPos and DI_gear.
    Pedal >= threshold in Drive starts injection; pedal < threshold-10 stops it
    (hysteresis so hovering on the line doesn't flap the torque map).
  • Injection is a continuous RMW on the car's live UI_powertrainControl
    frame at 10 ms: only UI_pedalMap is overwritten, every other signal stays
    as the car emits it. Counter is seeded from the car's last frame; checksum
    is recomputed by the DBC layer.
  • Also stops when the car leaves Drive, the driver changes the pedal map in
    the UI, or the automation is disabled. Does nothing if the car is already
    in Sport.

DBC

  • UI_powertrainControl moved from 0x313 to 0x334 on current Tesla firmware
    (2026.x). Located via the tesla-can-explorer dataset and confirmed on the bus.
  • UI_pedalMap widened from 1 to 2 bits (explorer lists a third value,
    PERFORMANCE). Bit 5 = Sport verified against the car's UI.
  • Added to used_messages.txt as bus 1 decode; tables regenerated.

BLE opcodes (config only, persisted in NVS)

  • 0x49 VC_CMD_SPORT_KICKDOWN_ENABLE — 1/0
  • 0x4A VC_CMD_SPORT_KICKDOWN_THRESHOLD — pedal percent, clamped 10..95,
    default 80

Logs (sport_kd)

READY at boot, START / STOP (reason), throttled TX 0x334, and an
RX 0x334 line whenever the car's payload changes (counter/checksum masked).

Tested on the car: START/TX/STOP cycle observed and Sport engaged while held.
Companion app change: dashpilot-android sport-kick-down branch.

@wpmed92
wpmed92 merged commit 67605af into main Sep 14, 2026
2 checks passed
@wpmed92
wpmed92 deleted the sport-kickdown branch September 14, 2026 09:32
@wpmed92

wpmed92 commented Sep 14, 2026

Copy link
Copy Markdown
Contributor Author

Closes #75

This was referenced Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant