In the system shown below, the PLC sends pulses up to 200kHz and the driver is controlled by the pulse and direction method. In the current design, when there is magnetic noise in the system (when the relay or contactor operates), the noise goes to the processor (TMS32F28069) as a pulse. The pulse pin is sent to the eqep pins in the processor. When we made changes to the filter on the Schmitt trigger input, we saw an improvement up to 150kHz. But we still have a problem at 200Khz. Do you have any hardware design suggestions? Or is there anything we can do in software to prevent such problems in the processor we are using?