Stepper Motor Wiring Conventions

For some reason stepper motor pin naming conventions, physical connections and wire colours vary dramatically between manufacturers.  There is no single standard!   That said, at the end of the day it is a relatively simple process to get them to work.

If like me you are switching from the ANet A8 mainboard to the SKR V1.3 then you can probably skip this entire section and take it for granted that the motor cables are compatible and that dependent on your choice of stepstick driver board (e.g. TMC2208) then you will probably just need to configure Marlin to reverse the direction of a Motor Axis.

That said if ever there was a standard needed….

  1. Vendors name the 2 Motor Coils A&B or 1&2 then label each coils ends using the other pair 1&2 or A&B.  For example:
    a) DRV8825 uses Motor Coils A & B each with two wires 1 & 2
    i.e. A1&A2 for the first coil
    b) A4988  uses Motor Coils 1 & 2 each with two wires A & B
    i.e. 1A&1B for the first coil.
    c) TMC drivers use Motor Coils M1 & M2 each with two wires A & B
    i.e. M2A&M2B for the first coil.
  2. Board Manufacturers tend to use the A4988 stepstick pinouts to order the motor connector as this avoids having to cross wires (board tracks). But the JST connector can then be soldered onto the boards rotated thru 180 degrees or simply reversed on the flip side of the board.
  3. Motor cables come in either 4 pin or 6 pin connectors, colored Black, Green, Blue and Red – they seem to follow a standard color order at the board end but the connections at the motor end will vary.
  4. The JST and Dupont connectors used at either end of the cable do not have a defined standard Pin 1. Despite the JST being a handed connector (it can only be plugged in one orientation) different vendors will call opposite ends of the connector Pin 1.
  5. A Stepper Motor can come with either a 6 Pin JST socket or with a prewired 6-way cable that does not match the wiring colour scheme used by 3D printers
  6. Some Stepper Motors will have all 6 pins connected others will not wire the coil centre taps. Fortunately the centre taps are not actually used by 3D printer stepper drivers so this is a non-issue.

Stepper Drivers Board Connections

Figure: Mainboard Outputs  

So typically, a Stepper Motor cable will be 6 pin to 4 pin JST HX 2.54mm (0.1”) connectors or 6 pin JST to 4 pin Dupont connectors.

Nema 17 Cables

Figure: Motor Connection 

As you can see above the original ANet cables and the cheap spare eBay cables that I bought are not directly interchangeable, the effect of a direct swap out of cables is to reverse the motor direction.

Fortunately it is relatively simple to get them working.  To make a motor turn you just have to use an ohm meter or buzzer to make sure that you have the coils wired so that one coil is connected to pins 1&2 and the other coil to pins 3&4 at the connector on the mainboard end.  However, there is no guarantee that this will make the motor turn in the right direction.  To achieve that then you need to try some wires swaps as shown on this RepRap page

Rep Rap format main boards, and the A8 V1.5, are based on being A4988 compatible ie pin outs are in 2B,2A,1A,1B order.