Stepper motor is an impressive piece of engineering. Instead of making full turns like a normal motor, stepper motor make steps, one small degree at a time. It is commonly used in photocopy machines, printers, CNC machines, robotics, etc where precision motion (steps) and controls are needed.
UPDATE 2015: How Stepper Motor, Stepper Driver and Stepper Controller Work - Unipolar and Bipolar Motor Examples
Stepper motors fall into 3 main categories namely Unipolar, Bipolar, or Hybrid (Unipolar + Bipolar).
A Unipolar stepper motor must be driven in Unipolar mode;
A Bipolar stepper motor must be driven in Bipolar mode;
A Hybrid stepper motor can be driven in Unipolar or Bipolar mode.
I’m going to focus on Unipolar. They normally have 5, 6, and (sometimes) 8 wires.
The stepper motor I have lying around. A 6-wire Unipolar Stepper Motor
For the 6-wire variant, it consists of 4 Coil End wires and 2 Center Tap wires; and for the for 5-wire variant, there are 4 Coil End wires and 1 Center Tap wire.
How Stepper Motor Works (Unipolar)
Although in reality there are several set of coils in a stepper motor forming what is known as a phase, for understanding purposes it is best to imagine the there are 4 coils in a stepper motor ( namely Coil 1, 2, 3 and 4). If any one of the coil is energized, the motor will make one step, then stays in that place (after 1 step is completed). The motor I have lying around as pictured above turns 1.8 degree per step.
In order for the motor to complete one full revolution, it needed to make multiple steps. The coils need to be energized in the proper sequence to achieve this. In all, 200 sequential steps (1.8 degree x 200 steps) are needed for the motor pictured above to make 360 degree turn (one full revolution). Read the specification of your motor carefully to find out the details.
The animation below on the other hand shows the steps and coil energizing sequence depicted in a simplified 90 degree per-step motor with 4 coils. Therefore it needed 4 steps to make one 360 degree turn. In principle, all stepper motor works in the same way.
If you are interested in reading on further, there are tons of resources to dig online. Google is your friend.
Step One – Identify The Center Tap Wires
This is the part where we map out the wires. You will need a multimeter, and set it to measure resistance. You will have to go through series of elimination process to map out which colored wire corresponds to which Coil End / Center Tap.
By referring to the diagram above:
1) The resistance between Coil End A and Coil End B is DOUBLE the resistance between Coil End A to the Center Tap 1.
2) The resistance between Coil End B and Coil End A is DOUBLE the resistance between Coil End B to the Center Tap 1.
3) The resistance between Coil End C and Coil End D is DOUBLE the resistance between Coil End C to the Center Tap 2.
4) The resistance between Coil End D and Coil End C is DOUBLE the resistance between Coil End D to the Center Tap 2.
The resistance readout 4.8 ohm. That means either White or Blue is the Center Tap while the other is the Coil End. Repeat the same process with the other wires.
Well..somewhat double resistance, 8.3 ohm. That means both Blue and Red are the Coils End wires and therefore White is their Center Tap. Repeat the same process with other pairings to find the next Center Tap.
NOTE: For a 5-wire unipolar stepper motor. Center Tap 1 and Center Tap 2 are internally connected together with just one wire out, but the rules above still apply. The resistance between Coil End B and Coil End A as well as the resistance between Coil End C and Coil End D are DOUBLE the resistance between any of the Coil Ends A, B, C and D to the single Center Tap.
NOTE: For a 6-wire unipolar stepper motor such as mine, There is no internal connection between (Coil End A - Coil End B - Center Tap 1) and (Coil End C - Coil End D - Center Tap 2). Therefore there is no current flow.
No current flow (Readout = 1). We therefore can establish that White, Red, Blue wires are isolated (no internal connection) from the Green, Black Yellow wires.
Step Two – Identify the Coil End
At this point, we’ve identified the 2 Center Tap wires. Join the two together (for 6-wire motor). In my case the Center Tap are the yellow and white wires. Attach (+) end of the batteries to the joined Center Taps (or in the case of 5-wire motor, the sole Center Tap).
Randomly choose any one of the Coil End and attach the (-) of the batteries. In the set-up below, I attach the (-) to the red wire, no special reason.
The set-up (click to enlarge)
Label the random wire you have chosen as Coil End A and with it you are energizing Coil 1. It doesn’t matter which wire you choose just assume it as Coil End A (Coil 1).
By touching the unattached end of the (black) alligator clip to the to the remaining 3 wires one by one, you will see the motor twitches (it makes half or no step). This is because there are now 2 coils that are being energized simultaneously (Coil 1 plus 1 other). The motor stator will move half way between the two energized coils (half step). No step when the two energized coils are adjacent to each other.
By closely looking at the direction of the half step, you can identify which wire and coil are being energize, as below.
On my motor, I have identified that Center Tap 1 is White, Center Tap 2 is Yellow, Coil End A is Red, Coil End B is Black, Coil End C is Green, Coil End D is Blue.
By energizing the coils/wire in repetitive sequence of Red-Green-Blue-Black, the motor will turn (step-by-step) clockwise.
Energize the coils/wires in repetitive sequence of Red-Black-Blue-Green will cause the motor will turn (step-by-step) counter-clockwise.