Pedro Pathing 2.0.0 has released! If you haven't already, migrate now.
Pedro Pathing LogoPedro Pathing

Predictive Braking

Predictive Braking is a positional control technique that maximizes deceleration by measuring the robot’s braking behavior rather than assuming it.

Core Idea:

Instead of relying on a manually tuned derivative term to prevent overshoot, this controller predicts how far the robot will slide if it brakes using a small negative voltage. It uses the predicted braking distance to anticipate positional error, effectively treating it as reaction time. This allows the robot to brake precisely when needed, maximizing deceleration and accuracy.

Key benefits:

  • Faster: maximizes deceleration, giving more time to accelerate and less time spent slowing down (~15% faster).
  • Automatically tuned empirically: eliminates overshoot and mis-tuning; only kP requires manual adjustment.
  • Easier proportional tuning: with braking behavior already known and maximized, kP can be set higher and adjusted more easily.
  • Accurate, responsive, and strong: higher kP reduces steady-state error, improves responsiveness, and provides stronger corrective and holding forces.
  • Advanced movement capabilities: treats braking distance as reaction time, enabling instant direction changes, sharp-angle turns at full speed, and natural centripetal correction for curves.

Trade-offs

  • Sharper stops: can feel less smooth as the robot slides to a stop
  • No acceleration constraints: always uses maximum deceleration when braking

Back-EMF Braking: Modeling and Control

Applying small reverse motor power locks the wheels using internal back-EMF, letting the robot’s momentum resist motion without drawing voltage. This achieves the theoretical maximum deceleration as the robot slides to a stop.

In reality, braking is not perfectly linear. When the wheels lock, they slide across the floor, introducing nonlinear friction that must be accounted for to maximize deceleration.

Modeling Real-World Behavior

The controller measures real-world braking by allowing the robot to slide to a stop with a small reverse voltage. When plotting velocity versus stopping distance, the relationship typically shows a combination of linear and quadratic terms.

  • Linear term: braking distance roughly proportional to velocity; caused by velocity-dependent braking forces such as back-EMF voltage, viscous friction, and controller delay.
  • Quadratic term: braking distance proportional to velocity squared; caused by constant forces such as sliding friction at high speeds.
SpeedDominant effectModelBraking distance ∝
HighSliding frictionQuadratic-dominated(v^2)
MediumMixedLinear + quadratic(v + v^2)
LowBack-EMFLinear-dominated(v)

A combined linear–quadratic braking model applies across all speeds. At low speeds, the linear term dominates, while at high speeds, the quadratic term dominates.

Why not use a traditional Derivative term?

A standard PID controller struggles with high-speed braking because it assumes linear deceleration, while the robot actually slides and experiences non-linear friction effects. Using only a derivative term forces you to lower aggressiveness to prevent oscillation, which reduces both responsiveness and maximum speed. Another approach is to rely on a secondary PID based on the error, with one controller more aggressive and one less aggressive. However, this becomes complicated to tune manually and does not fully capture the robot’s real behavior. By measuring actual behavior instead of assuming it, the controller predicts slippage rather than trying to prevent it.

Common Questions

Does maintaining traction with the ground result in faster deceleration?

Most robots maintain significant friction with the ground when they are sliding, which leads to immediate stops. Only if your robot is so light that it completely removes contact with the ground when braking will it potentially have faster deceleration. 99% of FTC robots are heavy enough that they maintain some contact with the ground when braking. Consider adding weight to lighter robots to increase their friction with the ground when braking.

Why not use full-power reversal?

Alternating between full forward (+1) and full reverse (−1) can cause voltage spikes that may burn out or reset the control hub. Instead, braking is applied with a small opposite voltage. Even a tiny voltage (e.g., −0.0001) locks the wheels like zero-power brake mode, using the motor’s momentum to stop without consuming significant energy. However, if the opposite voltage is too low, it won’t provide enough braking once the robot slows down where the motor’s momentum is no longer sufficient to brake.

Last updated on