Cable shielding groundloop
All of your GND connections should be referenced together in order to ensure they are all at the same potential. This includes the encoder ground line, the casing of the encoder, as well as the shielding connections.