shielding wire of the encoder isn't grounded, or the signal wire and power wire haven't been separated, with interference from the power wire. if is more serious for the synchronous motor. sincos encoder or rotary encoder is small analog signal, which is easily disturbed, representing as the random non-leveling