Swapped Leads

You inherited the firmware for a small field-oriented (FOC) speed drive on a three-phase brushless motor. Every 100 microseconds it reads the phase currents and the rotor's electrical sector, rotates the currents into the rotor frame, runs a cascaded current/speed control law, and rotates the commanded voltages back out to the three phase modulations.

On the bench it "just sits there." Commanded to speed, the shaft barely moves: it twitches, holds near standstill (the console shows the speed hovering around zero, sometimes drifting slightly backward), and never accelerates to the setpoint — yet the phase currents run high the whole time and the windings heat up. It behaves the same no matter where the rotor is resting when it starts, and no fault is reported.

The commanded speed arrives in an SRAM mailbox at 0x2000FF00 in milli-RPM (4,000,000 mRPM is 4,000 RPM). The rotor's present electrical sector is reported in SECTOR (0 through 5) and the measured speed in SPEED. The bring-up, the rotor-angle estimation, the control tuning, and the reporting are all correct.

Find why the drive circulates heavy current but develops no net torque, and fix it so the shaft spins up cleanly to the commanded speed from any starting angle.

Loading the interactive arena.