Noise problem with md09b stepper motor board

I am using an Arduino Due to control a 24V bipolar stepper motor using the Pololu md09b breakout board. I actually have the board working and am able to step the motor with it. My problem is that the device I am trying to control also includes two limit switches at either end of the travel. These are simple microswitches which I have separately connected to the Due and turned on the on-board pull-up resisters (20k) of the Due to these inputs so they are not floating. I monitor the limit switches by attaching interrupts to them. The interrupts are CHANGE interrupts so I can motor going on or off the limit switch.

I know that the interrupt routines are working, because with the md09b not connected, closing the microswitches generates the expected interrupt and only one interrupt for open and one for close. When I connect the md09b to the Due but do not apply the 24V DC motor power to the md09b, the interrupts continue to work just fine (closing and opening the switches produces a single interrupt for each). But the problem is that once I turn on the external DC power supply (a BK Precision 1626A) and apply 24VDC to the VMOT pins of the md09b, a steady stream of interrupts starts being produced by the limit switch inputs. If I turn off the 24V DC supply, the interrupts stop.

Why is this happening? Do I need to add some filtering? If so, where, and what?

Thank you in advance for your help.

Hello.

You might try using stronger pull-up resistors (maybe 1k) for the microswitches. Also, adding a capacitor (maybe 0.1 uF) between that input and ground might help with noise suppression. If you continue to have problems after making those changes, could you post some photos and schematic of your entire setup?

- Jeremy