I do not have a ramps board so this is more or less a shot in the dark. Check decopling caps c6 and c2, especially c6 because it has a polarity. If those are damaged then your power supply, if not a well made unit, may not have the cleanest power. Which could lead to noise causing issues your board.
Also is it happening when both your min and max endstops are engaged?
Also is it happening when both your min and max endstops are engaged?