Ok, an interesting update. I watched this video, where this woman uses an a4988 driver to control a nema 17 stepper motor. She did a few things differently than I have:
She connected the Reset and sleep pins directly to each other.
She limited the potentiometer to 1.18 volts rather than the .28V i had done.
She used this code:
const int dirPin = 7;
const int stepPin = 6;
void setup() {
pinMode(dirPin, OUTPUT);
pinMode(stepPin, OUTPUT);
//pause before continuing with the program.
delay(2000);
//set stepper motor direction to clockwise
digitalWrite(dirPin, LOW);
}
void loop() {
//take one step
digitalWrite(stepPin, HIGH);
delayMicroseconds(3000);
//pause before taking next step
digitalWrite(stepPin, LOW);
delayMicroseconds(3000);
}
I did these things, and it works. I think the main thing is the slp and rst pins. It only partially works without them, and is much smoother when they are connected to eachother.
Also, the code is much more simple.
A few remaining questions for now:
Is it ok to supply my arduino with the 12V power supply, and to get the driver’s power (VMOT) from the Vin pin? This seems to work fine.
Is 12V sufficient? Again, it seems to work fine. There are about 11.7V across vin and gnd.
Yes, that's mandatory with the A4988, and I admit that I missed that in your 'schematic'.
That's because she used a low impedance stepper, that needs more current than yours.
As is yours it's only for testing purposes. And it is more simple, because it doesn' move the stepper back and forth, but only in one direction.
Later on you will need amuch more complex code to useful run your camera slider.
I wouldn't do that. The Vin pin is definitely not a power source.
You will not get much torque with 12V. The A4988 cannot do its job with that low voltage - even if it works in your test environment, its wrong.
@van_der_decken told you already in post #12. And another reason is, that 12V is too low for your combimation of stepper and driver. Do it correctly now, or you may run into trouble later! It mainly depends on how much torque you really need if your slider is to work with the camera on top of it.
I’ve got a 24V power supply and it is working well.
However, when I set the a4988’s potentiometer to .28v, which is what it should have, the motor buzzes more than if the voltage is higher. Should I just leave it at .28 and deal with the buzzing?
A higher reference voltage means more motor current, which will heat up the motor more.
Remember that a stepper motor uses the same (or more) power when standing still.
You can go as higher, but you eventually will burn the motor from overheating.
If you're using full-step now, then maybe you should try micro stepping.
Leo..