
Productive Robotics
Trajectory Buffer Smoothing Fix
Discovered and fixed a subtle bug in the real-time control loop where a smoothing filter interacted poorly with short incremental commands, causing the robot to under-travel. Continuous motion masked the bug because the filter converged correctly over many cycles. The same class of real-time servo-loop debugging done at the top robotics companies.
The trajectory buffer's smoothing filter behaves correctly for continuous jogging — new commands arrive every cycle and the filter converges smoothly. For short incremental jogs, the completion criterion looked at the unfiltered input rather than the filtered output, so the trajectory could complete and be cleared from the buffer before the filter had time to catch up — leaving the robot short of the commanded position.
The fix adds a per-command smoothing-enable toggle to the trajectory buffer, disabling smoothing for one-shot incremental moves while preserving it for continuous jog where it provides valuable jitter reduction. The diagnosis — recognizing the mismatch between a filter sized for steady-state convergence and a short single-cycle command — demonstrates the kind of mathematical analysis required for real-time control system debugging.