First you should try, to remove and reconnect the connectors of the motor and the control for this motor.
It should often happen, that the connectors have bad contact, through water or the shake from machining. If this doesn't work, you should use a oszilloskope to see, if all signals in the connector are ok.