24/7 Emergency Service

+86 167 3023 1836

Contact us Now!

admin@songweicnc.com

EN

How to Solve Fanuc Alarm 21?

OCT. 27, 2026

Alarm 21 appears on the Fanuc spindle amplifier (on some of the αi-B models it will show as SP9021). Again, these are just two names for the same thing and both point to the polarity of the spindle position sensor's settings and direction feedback (i.e. are the parameters correct, is the A/B phase feedback reversed, is there slippage in the mechanical drive etc.)

How to Solve Fanuc Alarm 21?

For all the years we've been supplying Fanuc spares we've had literally loads of calls of this nature. Six or seven in ten will start off with "How much is an amplifier?" That makes perfect sense really as the alarm is coming from the amplifier so it seems to be the culprit. The code 21 itself doesn't in any way prove that the amplifier is at fault though. It could be incorrect parameters, it could be the wiring is reversed, it could be the belt is slipping, it could be a faulty sensor giving a bad signal. Any one of those would be sufficient to generate that code.

One more thing you need to do first is write down the full alarm message (including the full CNC model and amplifier model). Depending on the Fanuc series, amplifier type and feedback type the same code number can mean different things. Code 21 on one machine may mean one thing and on another machine may mean something completely different.

What does alarm code 21 actually indicate?

The spindle control system uses feedback from position sensors to establish spindle position and direction of rotation. If the polarity setting in the parameters is not in line with the actual feedback, the system is unable to determine spindle position or direction of rotation and will therefore trigger the alarm.

In short it's "the feedback I'm getting is not what I expect" rather than "I'm burnt out internally". That's the key difference as the entire troubleshooting process that follows is predicated on that point.

Bit 4 of parameter 4001: Verify it first

In the maintenance docs for both the αi and the αi-B the "position sensor polarity" entry is bit 4 of parameter 4001. If that bit is not in line with the actual configuration the position feedback will be wrong.

How to verify it? Get the Fanuc parameter manual and retrieve the machine's factory default parameter backup. Compare the two side by side. If you don't have a backup you can get the manufacturer to provide it or check the maintenance records from the last time the machine was serviced. While you're at it, check the spindle rotation direction settings as per the actual configuration too as these two are frequently changed together.

One thing to bear in mind: don't go fiddling with the spindle parameters just to get the SP9021 to go away. The spindle parameters are all interlinked so changing one arbitrarily may well get the alarm to stop right away, only to create a whole host of other problems down the track. This is particularly true of machines where the amp has been repaired, parameters have been reset and/or the control board has been replaced. The first thing to do is go through the parameters one at a time and compare the current values with the factory defaults. Don't rely on memory for this.

If phases a and b are reversed, an error will still occur

Once you've confirmed the parameters and found nothing amiss, the next thing is to check the sensor feedback lead and connectors. There's one particular thing to watch out for: are Phases A and B actually connected in accordance with this machine's actual wiring diagram?

Here's another very common scenario: the sensor has been replaced or the feedback wires have been fiddled with and error 21 has now appeared. In that situation you need to go back and look at the bits that have been changed recently. Check that the connector is properly seated, that the latch is actually in place, that the wires haven't been squashed by sheet metal and that the A and B wires haven't been swapped. The problem isn't always apparent from the outside. The insulation on the wire may look perfectly fine but the pins inside could well be loose.

When you're doing the testing stick to the wiring diagram for that particular machine. Use a multimeter to check for continuity and if you've got an oscilloscope then look at the waveforms directly. Only once you've established that the signal is in fact OK should you consider replacing the sensor or the cable. Doing the tests and skipping them entirely to just replace the part is very easily going to result in you just going round in circles.

Don't overlook mechanical issues like V-belt slippage

Fanuc's spindle maintenance manual lists belt slippage as a potential cause. That only applies to machines with V-belts. Once slippage occurs between the belt and the pulley the speed relationship between the spindle and the drive motor is upset and the feedback will no longer match.

When you're looking at the problem check three things:

  • The amount of belt wear
  • The tension
  • Whether there's any oil or grease on the pulley

With regard to tension a deflection of roughly 1cm when you press down can be used as a guide but again you should always follow the manufacturer's recommendations as there can be a big variation between machines.

Don't apply that rule strictly to machines with direct drive or other types of drive. Code 21 isn't purely a belt code and belt slip doesn't always give rise to a Code 21.

The sensor itself: When to inspect it

If you've eliminated the parameter, wiring and mechanical transmission issues and Code 21 is still occurring then you'll need to test the sensor's feedback signal. Check that the output is in accordance with the system requirements and look for any anomalies in the signal as it is being transmitted.

See the maintenance manual for your particular model as to what tools to use and what points to test (don't just go on general principles). If the signal is wrong then use the results to establish whether the fault is with the sensor, the leads or some related control.

There are two typical traps here: one is to see "SP9021" on the screen and just write it off as the amp; the other is to replace the sensor with no justification at all. Both of those options cost you money and you can't be sure of the outcome.

When should the amplifier be considered?

Only after having checked all of the above and the alarm still not cleared should the amplifier actually be considered as part of the troubleshooting. At that point you'll present the full alarm info and test records to see if there's an internal circuitry fault. If the test results still point to position feedback or external wiring then deal with those first of course, don't just go and replace the amplifier.

If you do end up having to buy a replacement part then please do ensure you have the full model number and that it is compatible with your existing CNC, spindle motor and feedback system. Just because they're from the same Fanuc series and have similar looking enclosures doesn't mean they're interchangeable. A single letter difference in the model number could mean the interface definitions and internal parameters are totally different and you could end up with a different alarm being triggered as a result.

Before contacting us, please have the following information ready

SongWei supply spares for Fanuc spindle amps, servo amps and motors and also provide the testing, repair and replacement service.

If you've got a 21 or SP9021 then we'd recommend you get the following ready first:

  • The full amp model number
  • The CNC model
  • The full alarm display text
  • The relevant parameters (particularly 4001)
  • The actual state of the position sensor
  • The feedback cables

If the machine has had a sensor, amp or feedback cable changed recently then please do give the date and which parts were changed.

This tells us whether the fault is in the polarity parameters, the A/B phase sequence, the sensor feedback or within the amplifier itself. You save both time and money by knowing precisely where the fault is before you decide whether to repair the unit or supply a suitable replacement rather than just go guessing and buy parts blind.

Finally, safety is non-negotiable

The spindle drive has high voltage and high speed rotating parts. Prior to opening the electrical cabinet, touching any feedback wires or handling the spindle drive itself, the machine must be switched off, the power disconnected and the presence of any residual voltage verified in accordance with the manufacturer's safety instructions.

Have a qualified technician carry out the parameter adjustments and take the live wire measurements, using the relevant maintenance documentation for the Fanuc system. Don't just go and unplug the power cable until you're absolutely sure it's safe to do so. Make sure you save the original parameters prior to changing the spindle parameters otherwise you'll be in a right old mess later on.

Code 21 is really simple really: you have to first get a full understanding of how this machine is actually set up and what the feedback is before you go and fiddle with anything. We've seen enough instances of people ordering an amp on the basis of an alarm code and ending up with the same problem and having spent the money.

Related Product Types

If you found this article interesting, you may want to know more about these related product types. 

Contact Us to Maximize Your Profit

Enter part information below to check price and availability.

Usually ship by UPS or DHL with delivery around 3 working days.

All parts are tested OK before shipping out with a 12-month warranty.

Provide technology guidance service upon receiving the part.

CONTACT US
Thank you! Your message has been sent.
Unable to send your message. Please fix errors then try again.

Search