Skip to main content
Firmware Stable

Combined Brake and Reverse

This feature implements a common RC car braking system. When enabled (via drvopts bit 0), negative input first results in braking. To reverse, release the input (enter the center deadzone), then apply negative input again.

This feature is enabled by setting bit 0 of drvopts.

Setup

  1. Enable the feature by setting drvopts bit 0
  2. Map your control input symmetrically (either analog or servo PWM) by setting an appropriate center:
    • Set /pwm_input/center to 1500 and/or /analog_input/center to 2500
  3. Configure driver modes for each operational state:

State Machine

The combined brake and reverse logic uses a three-state sequence:

  1. State 0 — Forward or idle. Negative input transitions to State 1 (braking).
  2. State 1 — Braking. The driver uses ctl_brake_mode. Releasing input (returning to zero) transitions to State 2.
  3. State 2 — Reverse ready. Negative input now drives in reverse using ctl_reverse_mode. Positive input returns to State 0.