It could be interference. The encoder shield needs to be grounded.