Stepper wiring

From RepRap
Revision as of 18:09, 5 November 2012 by Traumflug (talk | contribs) ("pair" wires to determine coils)
Jump to: navigation, search

There are two basic ways to drive a stepper motor, depending on if you can reverse the polarity on a coil or not. The reprap can and does, and this makes the "extra" wires on some stepper motors redundant. see [wikipedia] for more detailed information on unipolor vs. bipolor steppers. The Reprap stepper drivers are bipolar, so if you're using the standard drivers, you will need a stepper than can be wired as bipolar.

For any stepper motor to be wired up properly, we'll need to determine which wires are "pairs" or connected to the ends of each coil. These are usually referred to as coil "A" and coil "B", but which is which doesn't matter as much as you'd think.

This picture shows how 6-wire steppers are wired:

Unipolar-stepper-motor-windings.png

Four wire motors don't have the common wire. We will use all four wires, and we'll only need to determine which wires make up the two pairs.

Five wire motors have the two common wires on each coil connected internally, and exposed as only one wire. This configuration won't work for the standard reprap electronics, as the coils can't be independently reversed. For unipolar drive, the common wire is usually connected to hot, and the four others are grounded in pairs in turn to energize half of each coil at a time, turning the motor. Some people have tried to take the motor apart and convert these into four-wire motors, but no result report yet. And no, cutting the fifth wire off won't work, as the centerpoints of each coil are still internally connected.

Six wire motors are wired as show. We won't be using the two common wires, but otherwise it's identical to the four wire version.

Eight wire motors have two common wires for each of those coils, which don't connect. This divides this into four electrically separate coils. Unless you have the datasheet, this can make things tricky. It's fairly simple to determine what the pairs are, but determining which two pairs of half-coils are which and getting the polarity right can be tricky.

So how do you determine which wire is which? Here's a process for you.

"pair" wires on 4 wire motors

This is about finding the two pairs of wires which are connected to the same coil. We don't need an ohm-meter for this, although it is helpful.

Method with an ohm-meter
Simply measure each pair of wires for their resistance. If the resistance is a few ohms ( < 100 Ω) only, you've found a pair. The other two wires should make up the other pair.
Method without an ohm-meter
First, try turning the motor with your fingers, and notice how hard it is. Then, stick wires together in pairs. If the motor turns noticeable harder, you've found a pair.

"pair" wires on 6 wire motors

On six-wire motors you'll find two groups of three wires in which all three wires are electrically connected to each other. These wires are connected to the same coil, one in the center of the coil, two at their ends. Accordingly, two of the possible pairings have a lower resistance, one pair has a higher one. Take the pair with the higher resistance and ignore the third wire.

The no-ohm-meter method can work here, too. Expect not two, but three stages of turning resistance. You want the two pairs which give the highest turning resistance.

After you found out which two of the six wires to ignore (one in each group), you can proceed as if you had four-wire motors.

match coils for 8 wire steppers

If you have a 8 wire stepper, you'll have 4 coils. You need to determine which pairs of coils are the "same". There are two "pairs" which are essentially the same. You want to hook these two pairs up in series so that you essentially have only two coils, each twice the length. You also need to hook them up so that the two coils "add" to each other - polarity matters.


The simplest way will be to find the datasheet. While other types of steppers make it straightforward to identify the correct coils, it'll probably be easier and faster to read the datasheet for 8-wire motors.

If you can't find the datasheet, all is not lost. Pick two coils at random, plug it in and see if it works. If it turns, you've got two coils that aren't the halves of the same coil. You can then "add" the other coils one at a time, trying different configurations and polarities until you've identified not only which two coils are which, but which way they need to be hooked up. Put some thought into it, it's straightforward, but somewhat involved. Since we don't care which direction the stepper turns, we can eliminate a lot of possibilities and just concern ourselves with the simple question "does it turn?".

Plug it into the stepper driver

The polarity of each coil doesn't matter, nor does which coil is which. So make sure each coil's wire is together on one side or the other of the plug, and plug it in.

It DOES actually matter which coil is which and what the polarity of the coils is, but if they're wrong the motor just turns the wrong way, which is easy to fix. Keep in mind the following:

1.Switching the polarity of either coil will reverse the stepper's direction.

2.Swapping the coils will reverse the stepper's direction.

3.The stepper direction can be reversed in the firmware.

4.Plugging the plug in backwards swaps the coils, and reversed both coil A and coil B. Thus the effect is to change the direction 3 times, which gives a net effect the same as changing the direction once.

Simplest solution to the stepper turning the wrong way is to turn the plug around, unless you've compiled your own firmware and already know how to reverse the direction in firmware.

Further reading

  • StepperMotor has a list of stepper motors that are known to work, a list of stepper motor drivers that are known to work, and some more tips.
  • NEMA Motor describes the NEMA standards for stepping motors -- in particular, what "NEMA 17" means.