Stepper wiring

From RepRap
Revision as of 16:31, 24 November 2011 by Glenn (talk | contribs) (+ Category:Parts)
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 to determine coils

We don't even need an ohm-meter for this, although it is helpful. Try this experiment:

First, try turning the motor with your fingers, and notice how hard it is.

Second, twist all the wires together, and notice that it's much harder to turn. This is because each coil is now shorted, and turning the stepper becomes equivalent to a generator, trying to make infinite current in each coil.

We can use this effect to indirectly measure the resistance, or the resistance can be measured directly using an ohm meter. Either way, the objective is to determine which wires make up pairs.

Start by picking a wire at random. This will become the first wire of pair one. Pick another wire at random and measure resistance. If it's got a resistance, that's a pair. If it's a 6-wire motor, there will be two other wires, so pick the pair (out of those three) that gives the higher resistance. The third wire will be the "common" wire from the diagram above, which we won't be using.

Do that until you've got your two pairs.

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.