Stepper motors are amazing: with them you can build 3d printers, robotic arms, automatic window blinds and just scare the living sh*t out of your wife with autonomous moving halloween props. Obtaining a stepper motor always brings that awesome warm "ummm" feeling – either salvaging one from old printer or getting some in the mail, ordered from fleebay.
Recently I got my hands on a whole bunch of rather nice looking stepper motors in a random 'loot' box from a deceased neighbour who was some kind of electrical engineer or whatever else the profession name is. Anyways, he had about a dozen of NEMA 17 motors in that box, but after a short loud "YAY" I did a long sad "awww" since ALL of those motors were unipolar.
Unipolar motors, compared to bipolar are less powerful, more power hungry and generally are considered to be old outdated technology nuggets. They are visually indistinguishable from their superior bipolar brethren apart from the wiring connector: unipolar buddies have 5 leads while bipolar have 4. Five is more than four and you'd think more wires = more better, but not in this case. Fifth wire is essentially a centre tap interconnecting the coils inside the motor so it can be made turn with only one polarity of the current (therefore the name – UNIpolar).
In such motor, there is no way of energising one coil in one polarity and another one in the opposite - you will always run current to 1\2 of the other coil and that would give motor a seizure and possibly let the magic blue smoke out of something. Well, why would anyone make this kind of motor you might ask? This takes us back to the times where there were no single-chip stepper drivers available (chopper drivers) and steppers were powered by H-bridges – electronics were simple and motors were weak. But now we have stepper drivers available for less than a buck a piece so most of the stepper motors are now bipolar because of that.
Obviously enough, chopper driver chips designed for bipolar motors can not properly control unipolar steppers at all (well, mine can not do that for sure). I could get a driver that turns unipolar motors, but then I need to go research about what chip to use, buy parts, wait a month and go along with 10 feeble motors. No.
Just if you're curious, motors in question are TEAC 14769070-90, but I am sure this will work for many more different models.
Step 1: Soldering Fine Wire
My grampa told me never to open a stepper motor so for not letting the motor squirrel escape, but I always suspected he was not a real electrician. Therefore, I'ma gonna pop some steppers open and convert them to bipolar today. And having said that, it turns out it is no rocket surgery to monkey inside the stepper at all. In fact, it is so easy even I could do it.
I should mention that there is a possibility that your motor cannot be converted to bipolar at all because of the way coils are interconnected internally. I've never seen motor in the wild wound that way but hey, I didn't see many motors in the wild. After detaching the 4 screws holding the shell together you can carefully pop the cover open to see the intestines – 8 coils of wire and a rotor with all the magnets. Here's the moment of truth: if you can see a circuit board with pads and thin wires attached to them – seek for one pad that has like 4 wires coming to it. If you've found it – you're in luck.
That pad is where the centre taps are connected together, forming the unipolarity of the motor. Our task here is to separate them. First, I've unsoldered all the hair wires. Then I detached the PCB from the motor housing and removed the old 5-pin wiring. I've used 8 pin ribbon cable instead of whatever's left from 5-wire connector. I've drilled some little holes through this PCB and pulled new wiring through it in order to give wires a strain relief. Count the hair wires. There should be 8 of them, by the number of actual coils in the motor housing. Obviously, there are not enough soldering pads to accommodate 8 wire ends, but luckily enough there was some lettering etched on the PCB – so I just scraped the shielding off it, tinned and used as a soldering pad.
Carefully put motor back together. Now we have 8 pin stepper! Everyone knows that more pins = more better as long as you are talking about a bipolar motor. 8 pins gives you the freedom to connect your motor coils in series for more torque or in parallel for more speed. Or, if you decide to go back to unipolar setup for some bizarre reason you can interconnect all negative terminals and that's your fifth wire and no one can judge you.
Step 2: Determining the Motor Pinout
With so many wires there is so much variance in connecting it all one can quickly get table flip frustrated. While pinout is relatively easy to determine for 4 pin bipolar motor, it is not so much so for 8-pin. But do not be scared by the motor's new wire beard width, it is all solvable by every electronic shop resident tool – oscilloscope. (If you ain't got one - get one).
Firstly, you have to determine the coil ends. In 8-pin there are 4 coils with 2 tails each, giving you 4*2 = 8 pins, duh. Take your multimeter and switch it to resistance measuring mode. Logic is simple: wires that do not belong to the same coil would give you no connection while wires that are tails of the same coil will show you some low resistance (~70 ohm in my case). Make a list: A B C D for coils and number pair for pins. Like this:
A = 1 7
B = 2 4
C = 3 6
D = 5 8
Then, we need to determine the location of each coil inside the motor. I know we could just open it and take a looksie, but this is: a) no fun, b) wires there are hair thin and look the same and c) I've already powered up an oscilloscope here. Plug Channel 1 of the scope to a random pair in random polarity. Plug Channel 2 to another random pair in another random polarity. And now, give the motor a slight spin in whatever direction. As I was told by a fat lady in my 6th grade physics class, spinning a permanent magnet near a conductor generates a current in this conductor – this is exactly what we're going to see on the scope: two wavy patterns.
There are three options of what you are going to see:
- Two lines will be in sync This essentially means you've found opposite coils that sit against each other, but you got the polarity of one of them backwards.
- Two lines are beating in the exact opposite directions This is the same thing, but this time you've figured the polarity right.
- Lines are slightly out of sync This means coils you are probing sit 90 degrees of each other.
If you, say, put ch1 probe on coil A and ch2 on coil D to get such picture, that'd mean coils are located like this in a motor:
A ?? or ?? A
It does not really matter if this is exact picture of how coils are located in the motor from the top side to bottom – as long as all the relative positions are determined motor will spin.
Now, after you've located each coil in the motor relative to each other, it's time to figure out the polarities of those coils. Again, as with positions – everything is relative so it does not matter if you get the whole motor backwards – as long as all relative polarity constraints are met the motor will chooch just fine. Having said that, grab a random coil and absolutely arbitrarily call one of it's ends a + and another a -. Mark them on the pinout table:
1 = A+
7 = A-
Now, put a Channel 1 of the scope on it in the polarity you've just guesstimated and Channel 2 to the coil that is located on the opposite side of the motor against it in arbitrary polarity. Spin the motor clockwise slightly. It is important to spin motor only in one direction to not to circumvent the testing conditions. If you see absolutely synchronous graph on the scope – you plugged the coil 2 in the same polarity, means whatever your scope if connected to is the right polarity. If two graphs you are seeing are totally opposite – your polarity on scope channel 2 is backwards (not a bad thing). Now, you can put the polarities for the second coil in the table:
5 = D-
8 = D+
Now, you need to determine the relative locations of the side coils. That is, is the coil C on the left or on the right to coil D in my example.
Determining it is quite easy: if you put a scope channel 1 on coil A with respect to polarity you've determined and channel 2 on coil C in an arbitrary polarity you'll see a graph #3 from the pictures: two graphs are 90 degrees out of sync. And here's the tricky part: if your channel 2 graph (the one with arbitrary polarities) comes BEFORE the channel 2 then you've got the polarity right. If not – you got it backwards (again, not a bad thing).
Now you put it all to the pinout table and it is now complete!
Beware that while my motor pinout is like this, it does not mean that yours must be such. In fact, anyone familiar with my soldering skills level would say my pinout is bizarre (and probably would advise you to not trust any of my instructables, too).
Step 3: Wiring It Up
Now, you can wire your new bipolar motor to any bipolar motor driver chip. For this example I am using a pololu-format DRV8825 chip, but you don't have to. Any bipolar stepper driver should work fine (like A4988).
With 8 pin motors you get two variants of how you can wire your motor: series and parallel. Wiring coils in parallel you decrease the coils inductance and can deliver higher currents to it, but will operate at lower voltage. Series connection requires higher voltage to produce same power, but will require less current.
Since delivering voltage is a no-problemo for a driver chip, but delivering current IS – you should use your motor in series fashion, unless you know what you are doing.
So, to wire up your motor in parallel, you connect pairs of wires to each driver coil terminal:
A1: 7 8 (A+ D+)
A2: 1 5 (A- D-)
B1: 2 6 (B+ C+)
B2: 4 3 (B- C-)
In my example I connected the A and D coils to terminals in A group because as you may remember coil D sits 180 degrees from coil A (on the opposite side).
to connect the motor in the series configuration you need to connect
A1: 7 (A+)
A2: 3 (C-)
B1: 2 (B+)
B2: 5 (D-)
Interconnect 1 (A-) and 6 (C+)
Interconnect 4 (B-) and 8 (D+)
As you might already figure out, we are making a giant coil on every phase: end of coil A goes into the start of coil C. This allows us to make a bigger coil, doubling the inductance.
If you have any questions - put them into the comments. I'd be glad to answer.