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)

  1. 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).
  2. 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.
  3. 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.
Tip: Do not ‘experiment’ by flipping the bit on a machine that previously worked and suddenly alarmed — a polarity that changed by itself means the FEEDBACK changed, not the parameter: a replaced motor wired differently, a repaired sensor mounted flipped, or a substituted cable with swapped signal pairs. Fix the hardware to match the machine's documented parameters, not the other way round.

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:

  1. 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.
  2. Inspect connectors at both ends for bent/mis-inserted pins.
  3. 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

  1. Test spindle orientation (M19) — it should reach position smoothly, without hunting or a full-speed swing past the target.
  2. If the machine rigid-taps, run a test tap in air — polarity faults show up as immediate tap breakage risk.

Related guides

Alarm 21 after a sensor or cable change? JJ Automation supplies correctly-terminated Fanuc feedback cables, repairs spindle sensors and amplifiers at component level, and can verify parameters against your machine's backup on site in NCR. WhatsApp us or call +91 88022 12394.
FanucParameter 4001Position sensorSpindle alarm 21Spindle driveTroubleshooting