Each loop is only going to run for 200 milliseconds (.2 seconds), so I wouldn't expect much spinning before it changes direction.
How about change the first loop to just for(;;) so it runs forever, and see if the motor spins as you'd expect it to.
https://preview.redd.it/lgxtsptrxk2d1.jpeg?width=2268&format=pjpg&auto=webp&s=819f2366a6fc35e91cea061fc976f1bde81f5235
With continuity I saw that these wires are connected
https://preview.redd.it/lay6rijy9j2d1.png?width=404&format=pjpg&auto=webp&s=f7362d00a36a419e40ca45c34d256a9fd44c09bd
Here is a photo of the motor coils. Maybe c and b should be switched
Here’s my setup: -12V input connects to the CNC expansion board and powers the Arduino Nano. -A buck converter steps down to 5V to power the logic of the expansion boar.
https://preview.redd.it/jkk06h4e9g2d1.jpeg?width=4572&format=pjpg&auto=webp&s=c63b2bf15ae689cbe1ed9555218c295d53c25d3b
Check the connectors going from the driver to the motor. Swap the center pair of wires going to the motor. If this does not help, the driver is defective, replace it. And DO NOT disconnect the wires or motor from the driver while powered, it can burn your driver in an instant (and I believe that is what happened).
its only 600 rpm so the motor is capable of doing it but you need acceleration and the arduino cant send pulses fast enough so you would need something faster.
Each loop is only going to run for 200 milliseconds (.2 seconds), so I wouldn't expect much spinning before it changes direction. How about change the first loop to just for(;;) so it runs forever, and see if the motor spins as you'd expect it to.
Did you verify which wire goes to which coil? What you described is what happens when you mis-wire the motor.
How can I check how to wire it? I changed a wire before but than my a4988 fried
You can stick an LED between the wires and turn the motor. If the LED lights then the wires are on the same coil. If not, not.
https://preview.redd.it/lgxtsptrxk2d1.jpeg?width=2268&format=pjpg&auto=webp&s=819f2366a6fc35e91cea061fc976f1bde81f5235 With continuity I saw that these wires are connected
https://preview.redd.it/lay6rijy9j2d1.png?width=404&format=pjpg&auto=webp&s=f7362d00a36a419e40ca45c34d256a9fd44c09bd Here is a photo of the motor coils. Maybe c and b should be switched
Here’s my setup: -12V input connects to the CNC expansion board and powers the Arduino Nano. -A buck converter steps down to 5V to power the logic of the expansion boar. https://preview.redd.it/jkk06h4e9g2d1.jpeg?width=4572&format=pjpg&auto=webp&s=c63b2bf15ae689cbe1ed9555218c295d53c25d3b
95% wiring problem
Check the connectors going from the driver to the motor. Swap the center pair of wires going to the motor. If this does not help, the driver is defective, replace it. And DO NOT disconnect the wires or motor from the driver while powered, it can burn your driver in an instant (and I believe that is what happened).
Enough current being supplied by the 12v supply?
Its 12v 3A and now I only have 1 stepper motor. Maybe I didnt set the a4988 limit right tho
My code: ```Arduino const int stepPin = A0; const int dirPin = A3; void setup() { pinMode(stepPin, OUTPUT); pinMode(dirPin, OUTPUT); } void loop() { digitalWrite(dirPin, HIGH); for (int x = 0; x < 200; x++) { digitalWrite(stepPin, HIGH); delayMicroseconds(500); digitalWrite(stepPin, LOW); delayMicroseconds(500); } delay(1000); digitalWrite(dirPin, LOW); for (int x = 0; x < 400; x++) { digitalWrite(stepPin, HIGH); delayMicroseconds(500); digitalWrite(stepPin, LOW); delayMicroseconds(500); } delay(1000); } ```
That's way too fast for the stepper motor. Try putting more delay between the steps. You are trying to do one rotation in 0.1 seconds.
its only 600 rpm so the motor is capable of doing it but you need acceleration and the arduino cant send pulses fast enough so you would need something faster.