Electronic – arduino – “Standard orientation” for stepper motors in data sheets

arduinodc motormotorstepper motor

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:

enter image description here

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

enter image description here

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:

enter image description here

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!

Best Answer

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):

schematic

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):

schematic

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.