Slingshot
You inherited the speed controller for a brushed DC drive. A colleague wrote a tidy PI control loop: every millisecond it reads the measured speed, folds the error into an integral term, sums the proportional and integral parts into a PWM duty, ramps the duty in gently, and clamps. The integral term is what lets it hold a speed exactly against a load it cannot measure.
Spinning up and holding speed, it is flawless. But whenever the shaft catches on something for a moment and then frees, the drive does not simply return to speed — it sprints far past the commanded speed, races there for a while, and only slowly drifts back down. A quarter-second hang turns into a wild speed excursion every single time.
The commanded setpoint is delivered in an SRAM mailbox at 0x2000FF00. A load torque is applied to the plant independently, and it is not the same from run to run, so the duty that holds a given speed cannot be memorized — the loop has to feed back to find it. Speed is reported in milli-RPM (12,000,000 mRPM is 12,000 RPM). A correct drive holds the setpoint, rides out a transient hang, and returns to speed cleanly once the shaft is free.
Find why a momentary hang throws the shaft so far past the setpoint, and fix it so the drive recovers cleanly.