Nema motor wiggling insted of spinning

i hope some can help me out. I have D1 mini to controll a 17hs16-2004s stepper motor.
I have now manget to make some sound a got it wired up. Bu now i got a problem, i am using ESPhome to code,
open_action:
then:
# Move 150 steps forward
- stepper.report_position:
id: my_stepper
position: 0
- stepper.set_target:
id: my_stepper
target: 1000

But when pressing the button in home assistatnt the stepper is just wiggling, and not spinning. What can be wrong? i am noob when its about coding, i have M1.m2.m3 but dont use it in the code, maybe i need to?

The problem may occur due to insufficient voltage, current or both. Please check your power supply.

I’m a little unsure if I thought correctly when I did the calculation on A4988. I got 0.0.037 volts is what the a4988 sholde be turn to

If this is the problem.

The power supply is: 12v 2a that sholde be enough?

As long as i know all the power is good then i can start looking for ohter problem. regard

Hello.

A 12V, 2A supply should be fine for that stepper motor.

It sounds like you are using our A4988 carrier; if that is the case, please note that it can only handle around 1A per phase without additional cooling (your motor is rated for 2A per phase according to the datasheet you linked to). It might be possible to run your stepper motor at 1A per phase, depending on your application, but you will be severely limiting the maximum speed and torque it can achieve. Something like our TB67S128FTG Stepper Motor Driver Carrier would be more appropriate for a 2A per phase stepper motor.

The value you mentioned for VREF (0.0.037V) does not make sense. Please post pictures of your driver board, so I can see what version you have, and I should be able to help you with that.

Another potential problem that could cause the motor to have problems like you described would be if you got the coil wire connections mixed up. Could you also post pictures of your entire setup that show all of your connections?

Lastly, it isn’t clear to me from your code how quickly you are trying to step the motor, but I suggest testing with a slow speed (maybe something like 60 pulses per second).

Brandon

Thanks for the reply, i am not at home so cant post any pictures at the moment.

Will it be better to swap to a 1A instedd of a 2a nema motor? dont wont to burn anything.

Now i have like this:
B1-blue
A1-green
A2-black
B2-Red

I have 1.2 on the carrier

The speed is max_speed: 250 steps/s

Sleep and reset is “togheter”

The A4988 uses current limiting, so trying to use a 2A per phase stepper motor shouldn’t damage anything, as long as you are setting the current limit to something the A4988 can handle (i.e. 1A for our #1182 green carrier and 1.2A for our #2128 black edition carrier). However, depending on your stepper motor, it might not work well at those limits, so switching to a 1A per phase stepper motor might give you better performance.

I am not sure what you mean when you say you “have 1.2 on the carrier”; could you elaborate? If this is in reference to the VREF voltage, it is way too high for our A4988 carriers. Could you send me a picture of your driver board so I can see which version you have (please note that the green edition has 2 versions which have different calculations for setting the current limit)?

Your number/letter pairings do not match up with the pin names on our board (which have the number first and the letter second). But if you have blue connected to 1B and green connected to 1A, then those connections are incorrect according to the datasheet you linked to previously. According to that datasheet, one coil pair is red/blue and the other is black/green. So those pairs of wires should be connected to 2B/2A and 1A/1B on the A4988.

Brandon