Cnc shield and a4988 motors behaving strangely

I was trying out my cnc shield v3 with an uno, a A4988 driver, and a 17HS4401 nema 17 stepper motor, and a 12v 10a power supply. As I continued to attempt adjusting the driver's current limit, many unexpected behaviors happened. In all of these cases, my arduino is running an empty script. I never disconnect the motor when power is still on.

  1. The motor starts spinning as I proceed to grab the cnc shield

  2. As I turn the current limit screw, the motor starts emitting this noise with increasing frequency. At first I thought it was the sound of it holding its position, but I don't recall such a prominent noise coming from other similar motors I've see

  3. I was trying to read the current by using the multimeter (set to 200mA). But even as I turn the screw, the current reading remains low and doesn't change.

The driver is also smelling very toasty (it burns if I touch it). I supposed that could be normal but I was concerned about potential hazards since all the motor should be doing is holding its stationary position. How can I resolve these issues? I don't want to cause an electrical fire.

I have no idea how the motor could turn in the absence of step pulses. Strange indeed.

You do not measure motor current. Measure and set the reference voltage.

What value are the sense resistors on your A4988 modules? What was the value of Vref that you calculated?

Use the procedure found on thr Pololu A4988 page to set coil current limit. Make sure that you know the value of the sense resistors on your modules for the Vref calculation.

I think I figured out current limiting by measuring the voltage of the VRef hole or on the potentiometer. At first, I followed many video examples and put my probe in the center of the potentiometer screw, which didn't work. But after some tries, I was able to get a value that changes with the potentiometer if I place the probe on the rim of the screw, not the center. It works on VRef hole too, of course. I set the voltage to around 0.270 V, as to get a current rating around 0.5 A (.270 V * 8 * 0.068 Ohm) for the purposes of this test. I was able to get the motor to work with this driver on the CNC shield. The temp is generally low. Big thanks to you, groundFungus!

I am using a test setup like this (I know I should add a capacitor):

Several other things: it appears that I damaged 2 other drivers I had with my previous fiddling. Once I replace the working driver with a defective driver in the setup above, my Arduino shuts down. Could I have damaged those driver by using too much current before? Why does Arduino shutdown in response?

I did some more tests with that: it seems like when I put my finger near the arduino pin that corresponds to the particular motor, that motor begins to turn until I remove my finger. This isn't a CNC shield problem, as it also works if I touch the same pins at the bottom of the Arduino.

I am not really familiar with electricity, but I suspect it is static related? It still turns even if I touch the plastic part of the shield near those pins. It also stops consistently if I put my other hand on my metal PC case. I just didn't expect static to give such a consistent signal to those pins (it turns very smoothly if I keep my finger on).