I wrote this sketch to move 2 actuators on a mobile fertilizer spreader. When stationary, it works as intended. The issue I am having is that when the machine moves through the field, the vibrations from the tires causes the arduino to read “false” hall effect movement, even though the actuators have not moved.
As my sketch is designed to keep the actuators at a target location, these false/phantom readings cause the actuators to drift.
I have tried dampening the mounting box with rubber which helped but did not cure it. My next thought is to detach the interrupt to prevent the sketch from reading the phantom pulses. Unless someone has come across this before and has another idea.
McClaryActuatorswithHallSensorsV4.ino (31.4 KB)