Recently, I have been testing the encoders to successfully trigger interrupts on the Arduino board to record the distance the wheels of the platform have traveled. This is so that the platform can travel precise distances using PID algorithms and feedback from the encoders.
While the motors of the platform are not active, the interrupts trigger successfully as the wheels are rotated manually. This is because the encoders produce a clean digital signal to the interrupt pins on their own. However, when any of the motors are active, the inductive noise generated gets carried into the interrupt pins which causes the interrupts to trigger much more often than they are supposed to. This is a problem if we want to get reliable feedback from the encoders.
With the encoder connector carrying the motor noise, one solution was to control the signal from the connector using a pull-up resistor. A pull-up resistor ties the input of the interrupt pin to 5 volts or a HIGH value so that when the encoder signal goes HIGH, it actually translates to 5 volts instead of where the interrupt pin’s threshold voltage may be. Unfortunately, this method was not effective in reducing the false interrupt triggers.
Another solution was to add a 10 microFarad capacitor between ground and the same pin to filter out the inductive noise being carried by the connector. While the capacitive effect on the signal was measured, it also was not effective. This was to be expected because the oscilloscope measurements did not show any noise affecting the signal while the motors were active. Yet the interrupts on the board react as though it is coming from the signal.
Further solutions were to ground the motors directly to the board as well as rearranging the motor and encoder connectors away from each other but to no avail. So while the problem seems to be motor noise travelling through the encoder connector, none of the solutions made a difference which suggests that the problem may be elsewhere.
However, one test showed some results that verified the issue. When connecting only the right motor’s encoder to an interrupt pin with only the left motor active, the same issue in triggering the interrupts occur. Also, the further the left encoder connector is from the right, much less interrupts are triggered. These results definitely indicate motor noise being carried.
Further testing will be done to solve the issue at hand.