Fanuc spindle alarm 21 means the specified polarity of the spindle position sensor is incorrect — the direction the sensor reports does not match what the drive has been told to expect. In practice the sensor counts ‘backwards’ relative to the parameter setting, so orientation and position control cannot work. This alarm almost never appears out of nowhere: it follows parameter work, motor/sensor replacement, a swapped feedback cable, or a restore from another machine. Fanuc lists two checks, and they are the whole story.
Check 1 — The polarity parameter (bit 4 of parameter 4001)
- Note when the alarm started. Right after a parameter restore or manual parameter edits → this bit is the prime suspect (see our wrong-data guide for why sister-machine files bite).
- Enable parameter writing (PWE), open parameter 4001 and check bit 4 — the position sensor polarity bit. Compare against the machine's original parameter backup or the builder's parameter sheet; flip it only if the documentation says it was different.
- Set PWE back to 0 and power-cycle. If orientation now works and the alarm is gone, done — record the correct value in the machine file.
Check 2 — The position sensor feedback cable
A feedback cable with swapped differential pairs (A/B phases crossed — typical after a field-made replacement cable) reverses the apparent rotation direction:
- If the cable was recently replaced or re-terminated, verify its pinout against the Fanuc connection manual — wire colour conventions are NOT consistent between cable batches; check pin-to-pin.
- Inspect connectors at both ends for bent/mis-inserted pins.
- If the cable is original and undisturbed, go back to Check 1 — an undisturbed cable does not change polarity by itself.
After the fix — verify properly
- Test spindle orientation (M19) — it should reach position smoothly, without hunting or a full-speed swing past the target.
- If the machine rigid-taps, run a test tap in air — polarity faults show up as immediate tap breakage risk.
Related guides
- Fanuc spindle alarm 31 (motor lock / speed detection)
- Fanuc spindle alarm 73 (motor sensor disconnected)
- Fanuc αi drive alarms — PSM, SVM & SPM codes explained
