Biased Sensor

You inherited a fixed-point field-oriented speed controller for a three-phase PMSM drive. 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. The inner dq current loops regulate the winding current toward the torque the outer speed loop asks for.

On the bench it holds its commanded speed cleanly, and a serviced field unit still tracks the setpoint perfectly and never trips the inverter. But that unit runs noticeably HOTTER on one winding than the identical bench rig, even though the reported shaft speed and the peak phase current both read normal. Something is heating the winding that the speed loop is silently absorbing.

The culprit is a current sensor that reads with a constant DC OFFSET (a bias) on one phase: it adds a fixed error to every sample. The current loop faithfully regulates the MEASURED (biased) current to the torque the speed loop asks for, so the speed holds — but the TRUE winding current it is really driving quietly carries that offset as a DC component, dissipating heat for no torque. The commanded speed is delivered in an SRAM mailbox at 0x2000FF00 in milli-RPM (8,000,000 mRPM is 8,000 RPM). The sensed phase currents are reported in IA/IB/IC, the rotor's electrical sector in SECTOR, and the measured speed in SPEED. The bring-up, the angle estimation, the transforms, and the control tuning are all correct.

Find how the firmware can tell a phase-current sensor is reading with a DC offset, and fix it so the drive holds the commanded speed AND keeps the true per-phase winding current centered — do not trust the raw reading.

Loading the interactive arena.