The pulses generated by encoder. pulses are properly counted till the machine is swithed off but due to emi/emc once machine is turned on the readings are going berserk. how can I eliminate noise to get consistant encoder pulses. I'm using raspberry pi to monitor the pulses generated by the encoder.

