# “Standard orientation” for stepper motors in data sheets

I just finished getting a SOYO 6V@0.8A unipolar stepper motor working, and wanted to know more about an issue I faced while doing so.

I used the stepping sequence below with an L293D chip to drive the current for the stepper motor:

So, I pulled up the datasheet for the motor, and took a look at the wiring diagram:

Based on this layout, I assumed the polarities (assuming M1+==1a, M1-==1b, M2+==2a, and M2-==2b):

• M1+: Blk
• M1-: Grn
• M2+: Red
• M2-: Blu

So, I wired the motor like so with respect to my current driver:

However, this did not work as expected, and when I used my gray code logic, the motor just ticked back and forth. So, I ended up changing the wiring to the following, and it worked:

• M1+: Grn
• M1-: Blk
• M2+: Blu
• M2-: Red

And it worked. So, my question is: is there a "standard" representation of stepper motor diagrams in data sheets I could use so I get this right the first time the next time I use a different motor?

Thank you!

• Wow, that's a shit datasheet. It has no phasing information whatsoever. You're going to have to determine it experimentally. – Connor Wolf Nov 27 '14 at 17:27
• @ConnorWolf Thank you. I figured it was missing data. – Cloud Nov 27 '14 at 17:29
• @ConnorWolf Also, if that's the case, and there is no additional information beyond me needing to experimentally determine the phasing information, please post this as an answer and I will mark it accepted. Thanks! – Cloud Nov 27 '14 at 17:31
• It would help if you used the same notation for the stepping tables (1a, 1b, 2a, 2b) and how you've connected the motor (M1+, M1-, M2+, M2-). – Phil Frost Nov 27 '14 at 19:09

Well, as Connor Wolf says, sometimes the datasheets are crappy and you just have to determine things experimentally. However, I don't think that's your problem.

Your motor has six wires. It has two coils, each one tapped in the middle. You don't need the center taps because they are designed for a simpler drive circuit that can only drive its load in one polarity, like this (half your motor):

simulate this circuit – Schematic created using CircuitLab

By closing SW1, the magnetic field generated by the coil goes in one direction. By closing SW2, it goes in the opposite direction. Thus, even though the driver can drive only one polarity, it can still flip the magnetic field around which is necessary to turn the motor.

The disadvantage here is that at any given time you are only using half the turns in the coil. But you have an L293 which can be used to make an H-bridge, which can drive the coils in either polarity. You don't need the center taps (yellow and white wires) at all. Leave them disconnected. With an H-bridge, you can do this (again just half the motor):

simulate this circuit

For one polarity, close SW1 and SW4. To go the other way, SW2 and SW3. You don't need the center wire at all, you can still go both ways, and you can use the whole coil all the time.

Don't ever close SW1 and SW3, or SW2 and SW4 at the same time, since that just shorts out the power supply. You may blow a fuse or just trip the thermal protection in the motor driver. Either way, not what you want.

Each of the outputs on the L293 is just half this H-bridge, so just S1 and S3, for example. Each output can be connected to Vcc or ground. With the four half-bridges in the L293 you can make two H-bridges, one for each coil in your motor.

To make the motor spin, call one coil A and the other B. Start in any state. Then:

1. Reverse the polarity of coil A.
2. Reverse the polarity of coil B.
3. Repeat.

There's some ambiguity in this definition, but the motor should turn no matter what. It just might be the wrong way. If it turns the wrong way, then do one of these things:

• Run the algorithm backwards,
• exchange coil A and coil B, or
• reverse the polarity of one of the coils.