The AC amplifier uses 3 wires at power on to determine the initial position of the motor. Once the motor rotates, the amplifier will not use the commutation/hall tracks anymore. So, this error will only occur at power on and when the motor initially begins to rotate. Below are some suggestions to determine the cause.
If the fault is all the time then the wire is broken or the encoder is contaminated.
Opening the rear cap of the motor and there is fluid present is probably going to indicate the encoder is contaminated. The motor will need to be replaced since encoders are not replaceable in the field on an AC motor.
If the fault is intermittent, then typically the cause of a commutation fault is a loose wire or poor connection.
To test the wiring on an AC motor, check the wiring from the amplifiers 20 pin connector all the way back to the motors encoder. Use the diode test on the meter to look for issues at each point along the wires path through each connector. Note that some wires might have different colors, but the pin used will match the tables below.
The 20 pin connector on the amplifier uses pins 14, 15, and 16 for the hall/commutation. These are used when the motor initially turns. (Note: the halls/commutation pins are powered with the +5V and common wires as well).
Amplifier 20 pin connector:
If there is a 19 pin circular disconnect the commutation/hall pins will be A, B and M. This connector is also used on some AC motors.
At the motor there are 3 types of connections, the 19 pin circular, 15 pin circular, and the 15 pin square connector. The 19 pin at motor will use the A to V, 19 pin table above. Use the appropriate chart below if the motor uses a 15 pin type:
15 pin circular type disconnect at motor:
15 pin square connector type at the motor. Note also how the pin is engaging inside the connector housing. Make sure pin is straight and engages with the sockets: