Yaskawa error A840. Encoder data error


I have a cnc which the yaskawa drive gives an error on the Z axis. A840 error. I read the manual and it says encoder data error. I checked the encoder and it works. The machine homes the Z axis but does not go down. The error comes when I tell the axis to go down. I'm not sure wether I should buy a new drive or is it the servo motor not giving enough voltage

What could be the problem?