fix(throttle): avoid duplicate cruise command - #123
Conversation
zjwhitehead
left a comment
There was a problem hiding this comment.
LGTM. Cruise now publishes only through the shared relay-aware setESCThrottle path. Override behavior is unchanged.
(Could not formally approve: GitHub blocks self-approval on your own PR.)
|
Hardware-in-loop validation (M5Stack StampS3 over USB, no ESC/BMS connected): instrumented baseline produced 251 cruise control cycles and 502 high-level throttle commands in a full 5.0 s safe dry-cruise window. This PR produced 251 cycles and 251 commands. Control cadence remained 50 Hz, free heap was unchanged at 100,892 bytes, LVGL redraw traffic completed with 0 skipped flushes, and the controller restored to DISARMED after the 10 s probe. ESC transmission was explicitly suppressed at setESCThrottle for the probe. This confirms the duplicate-command hypothesis and the intended 50% reduction in cruise command work on real hardware. |
Summary
Why
Cruise mode currently queues the same throttle command once inside handleCruisingThrottle() and again through handleThrottle()'s common send path. This doubles cruise-mode CAN command and response work inside the 50 Hz control task without changing the requested throttle.
Validation