You are on the right track. 95% of the time that I get that error it is the spindle encoder. It is belt driven to the right side of the spindle inside the head. There are variations. The best ones were made by Heidenhain. The ones I avoid were made by encoder technologies and had a silver can. The high speed spindles had a bearing housing for the pulley to protect the encoder from loads.
The fact that you can turn the encoder and see a spindle speed is very good.
Next try in MDI a S0M3. This will show you the drift in the drive. Anything greater than 2 RPM will give you that alarm and will fail in a tool change as the spindle will drift out of orient position. Even at a spindle speed of 2000, a deviation greater than 20 percent will trigger that alarm. You should have a second or two to see the actual spindle speed before it fsaults out. The screen can display either the commanded speed or the actual speed.
Thus do you have the correct encoder? And do you have the parameters set corrrectly? Both for the encoder resolution, sample rate, spindle gain etc..
Drift is set on the Yaskawa as a parameter. But will get affected by changing the spindle gain parameter 71.
George
(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)