The four wires connected to driver board

Mitsumi M49SP-3K

Preamble

I found a stepper motor at the night market just off Pracha Songkro, for 10 baht

Mitsumi M49SP-3K Stepper
Mitsumi M49SP-3K Stepper

It is slightly damaged

Unfortunately, the connector part of the PCB was broken off, leaving only the 8 solder points, meaning that I am missing the connector. This is what it should look like:

M49SP-3K Stepper PCB
M49SP-3K Stepper PCB

and this is what mine looks like

Mitsumi stepper motor with broken PCB
Mitsumi stepper motor with broken PCB

From Arduino/Junk pile steeper motor survey, the photo shows that there are two pairs, orange/yellow and brown/black:

The four wires connected to driver board
The four wires connected to driver board

However, the question is how do these four wires connect to the eight solder points?

The answer is given on What Is The Difference Between 4-Wire, 6-Wire, and 8-Wire Stepper Motors?

Problem:
I have a stepper motor with either 4, 6, or 8 lead wires available to connect to a stepper drive. What is the difference between these wiring types, and does this affect how I connect the motor to my drive?

Solution:
The basic operation of any stepper motor relies on the use of inductive coils which push or pull the rotor through its rotation when they are energized. A pair of wire leads coming from a stepper motor will correspond to at least one of these windings and possibly more depending on the motor type. In each of the following cases a chassis ground lead is also pictured to ensure the motor is correctly grounded.

4-Wire Stepper Motors
While many motors take advantage of 6- and 8-wire configurations, the majority of bipolar (one winding per phase) stepper motors provide four wires to connect to the motor windings. A basic 4-wire stepper motor is shown in Figure 1. Connecting this motor type is very straightforward and simply requires connecting the A and A’ leads to the corresponding phase outputs on your motor drive.

Figure 1 : 4-Wire Stepper Motor
Figure 1 : 4-Wire Stepper Motor

6-Wire Stepper Motors
A 6-wire stepper motor is similar to a 4-wire configuration with the added feature of a common tapplaced between either end of each phase as shown in Figure 2. Stepper motors with these center taps are often referred to as unipolar motors. This wiring configuration is best suited for applications requiring high torque at relatively low speeds. Most National Instruments stepper motor interfaces do not support 6-wire stepper motors, although some motors do not require the center taps to be used and can be connected normally as a 4-wire motor.

Figure 2 : 6-Wire Stepper Motor (Left)  8-Wire Stepper Motor in Parallel (Right)
Figure 2 : 6-Wire Stepper Motor (Left) 8-Wire Stepper Motor in Parallel (Right)

8-Wire Stepper Motors
Some motors are also offered in 8-wire configurations allowing for multiple wiring configurations depending on whether the motor’s speed or torque is more important. An 8-wire stepper motor can be connected with the windings in either series or parallel. Figure 3 shows an 8-wire stepper motor with both windings of each phase connected in series. This configuration is very similar to the 6-wire configuration and similarly offers the most torque per amp at the expense of high speed performance.

Figure 3: 8-Wire Stepper Motor (Series Configuration)
Figure 3: 8-Wire Stepper Motor (Series Configuration)

It is also possible to connect an 8-wire stepper motor with the windings of each phase connected in parallel as shown in Figure 4. This configuration will enable better high speed operation while requiring more current to produce the rated torque. This connection type is sometimes known as parallel bipolar wiring.

Figure 4: 8-Wire Stepper Motor (Parallel Configuration)
Figure 4: 8-Wire Stepper Motor (Parallel Configuration)

Although every stepper motor operates in the same basic way, it is important to understand the difference between each wiring type and when each should be used.

So, it seems that even though this stepper motor comes normally as a four wire configuration, as the PCB is missing, I can configure it as I see fit in either a 4, 6, 8 (series) or 8 (parallel) wire setup, depending on how I connect the 8 “taps”, to the windings, up.

The only issue is now, of course, which tap corresponds to which winding? Testing for continuity, with a multimeter, will only tell me which coils are which – however, the middle and end taps of each coil will all appear be connected, due to d.c. current.

Looking at the PCB, with the stepper oriented so that the gear is at the top (as shown in the image M49SP-3K Stepper PCB), and numbering the eight solder points:

1- Top left

2 - Top right

...

7 - Bottom Left

8 - Bottom right

then the connections (for a four wire setup) appear to be as follows:

1 and 3 are the middle taps of phase 1

2 is the + of phase 1

4 is the - of phase 1

5 and 7 are the middle taps of phase 2

6 is the + of phase 2

8 is the - of phase 2

Datasheet

Mitsumi M49SP-3K datasheet

An interesting link on the Arduino forums: M49SP-3K to Arduino Connection

The Pololu DRV8825 web page has good advice for connecting the driver. The capacitor is required. While the motor is obviously designed for 24V it should work (at least for testing) with 12V. Be sure to set the current limit on your DRV8825 to 1 amp to protect your motor.

Note that the previous driver, the DRV8825 Stepper Motor Driver Carrier, High Current (md20a), has been replaced by the DRV8825 Stepper Motor Driver Carrier, High Current.

Sketch

From Simple Stepper Program

I wrote a very simple program to demonstrate stepper control using a Polulu A4988 stepper driver. It should also work with any stepper driver that just needs step and direction signals from an Arduino.

// testing a stepper motor with a Pololu A4988 driver board or equivalent
// on an Uno the onboard led will flash with each step
// this version uses delay() to manage timing

byte directionPin = 9;
byte stepPin = 8;
int numberOfSteps = 100;
byte ledPin = 13;
int pulseWidthMicros = 20;  // microseconds
int millisbetweenSteps = 25; // milliseconds

void setup() {
    Serial.begin(9600);
    Serial.println("Starting StepperTest");
    digitalWrite(ledPin, LOW);

    delay(2000);

    pinMode(directionPin, OUTPUT);
    pinMode(stepPin, OUTPUT);
    pinMode(ledPin, OUTPUT);

    digitalWrite(directionPin, HIGH);
    for(int n = 0; n < numberOfSteps; n++) {
        digitalWrite(stepPin, HIGH);
        delayMicroseconds(pulseWidthMicros); // this line is probably unnecessary
        digitalWrite(stepPin, LOW);

        delay(millisbetweenSteps);

        digitalWrite(ledPin, !digitalRead(ledPin));
    }

    delay(3000);

    digitalWrite(directionPin, LOW);
    for(int n = 0; n < numberOfSteps; n++) {
        digitalWrite(stepPin, HIGH);
//      delayMicroseconds(pulseWidthMicros); // probably not needed
        digitalWrite(stepPin, LOW);

        delay(millisbetweenSteps);

        digitalWrite(ledPin, !digitalRead(ledPin));
    }
}

void loop() {
}

 More recently there has been a request for a more complete example using buttons to control a stepper motor and I have now created a new version which also uses millis() rather than delay() for timing. Following is the code for this version

// testing a stepper motor with a Pololu A4988 driver board or equivalent

// this version uses millis() to manage timing rather than delay()
// and the movement is determined by a pair of momentary push switches
// press one and it turns CW, press the other and it turns CCW

byte directionPin = 9;
byte stepPin = 8;

byte buttonCWpin = 10;
byte buttonCCWpin = 11;

boolean buttonCWpressed = false;
boolean buttonCCWpressed = false;

byte ledPin = 13;

unsigned long curMillis;
unsigned long prevStepMillis = 0;
unsigned long millisBetweenSteps = 25; // milliseconds

void setup() {
    Serial.begin(9600);
    Serial.println("Starting Stepper Demo with millis()");

    pinMode(directionPin, OUTPUT);
    pinMode(stepPin, OUTPUT);
    pinMode(ledPin, OUTPUT);

    pinMode(buttonCWpin, INPUT_PULLUP);
    pinMode(buttonCCWpin, INPUT_PULLUP);
}

void loop() {
    curMillis = millis();
    readButtons();
    actOnButtons();
}

void readButtons() {
    buttonCCWpressed = false;
    buttonCWpressed = false;

    if (digitalRead(buttonCWpin) == LOW) {
        buttonCWpressed = true;
    }
    if (digitalRead(buttonCCWpin) == LOW) {
        buttonCCWpressed = true;
    }
}

void actOnButtons() {
    if (buttonCWpressed == true) {
        digitalWrite(directionPin, LOW);
        singleStep();
    }
    if (buttonCCWpressed == true) {
        digitalWrite(directionPin, HIGH);
        singleStep();
    }
}

void singleStep() {
    if (curMillis - prevStepMillis >= millisBetweenSteps) {
        prevStepMillis += millisBetweenSteps;
        digitalWrite(stepPin, HIGH);
        digitalWrite(stepPin, LOW);
    }
}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s