Is it possible the encoder phasing is wrong?
If the encoder direction is opposite to the motor direction, it is possible that this fault may occur.
This can usually be cured by swapping the A & /A on a differential encoder.
Or a quick easier test is to swap the motor leads, as long as it does not have a tach, as this would lead to another test of motor/tach phasing.
Al.
CNC, Mechatronics Integration and Custom Machine Design
“Logic will get you from A to B. Imagination will take you everywhere.”
Albert E.