In our article about stepper motors we have presented this type of electric motors, how they operate and what makes them highly compatible with digital control systems. Now we will talk about how to control such a motor together with a simple example, involving a H-bridge electronic circuit and simple scripting. In our implementation we have used a bipolar 23 stepper motor, however minor changes in control sequences are required for other types of stepper motors.
To summarize, the electromagnetic coils are located on the stator of the stepper motor, while permanent magnets, equal in pair numbers, are located on the rotor. A more detailed discussion about stepper motors can be found in our dedicated article, but making a long story short, like any DC motor, these motors rotate when the coils are energized however, if the coils are continuously energized in the same way, the movement will stop when opposite magnetic poles are aligned, e.g. S-pole on coil aligned with N-pole on rotor permanent magnet.
Electromagnetic coils found in a bipolar nema 17 stepper motor are arranged as independent windings, each of them corresponding to one phase. Usually such stepper motors have 6 terminals, 5 if the common wires of the two windings are internally connected, and the terminals can be identified by measuring the resistance between terminals using a multimeter.
In short, if resistance of a coil, between its two end terminal has a certain value, the resistance between the common lead and any of its terminals must a value divided by 2. In 5-lead motors, coil terminals can be determined by touching each two wires together. When the rotor shaft becomes harder to turn it means that the two connected wires belong to the same winding.