good reference for wiring step motor.
How to find which wire is A+/A- and B+/B- for a unknown 4-wire stepper motor :
- Place stepper on table in front of you, all 4 wires are free / unconnected and not touching each other.
- By hand, rotate the motor shaft and get a feel for the friction, there will be some but fairly smooth and uniform
Now connect any two of the wires together:
- Rotate the shaft again by hand, is it now harder to spin and feel “notchy”?
=> If yes, you have found one pair (A+/A- or B+/B-, doesn’t matter), the other two wires is the other pair obviously.
=> If no, then you have one of the A´s and one of the B´s connected to each other. Rearrange so both A´s and both B´s are paired up. If you rotate by hand now you will feel the full holding torque of your motor.
If you want to switch the direction of a stepper motor, simply flip “polarity” for either the A´s or B´s.