Monday, April 22, 2013

Wiring Mitsumi stepper ( M42sp-4np) with arduino

The mitsumi M42sp-4np is a stepper motot available on various devices like scanners, fax, etc.

http://www.scribd.com/doc/24950646/Motor-m42sp-4np-Datasheet


Mine was found on a AVEc scanner, with a SCSI interface. Due to this aging interface and its impossibility to use it on other more modern systems, I decided to take it apart and salvage parts.

AFter some screws, two interesting things are available, the main board and the stepper motor in charge of moving the scanner itself.

The board itself can be used to recover some a voltage regulators, caps, coils, smd components, dip switches and the darlington driver, however is a Surface Mount chip, making it hard to use on Protoboards. In adition, a heatsink is available and some fancy bios. The Imaging chip and the SCSI chips have no documentation so is better to ignore their existence.

For the motor, a set of bands and gears are available, which can be immediately used for mu future 3D printer. Getting back to the motor, it isa unipolar stepper with a 2 2  phase excitation, meaning that both coils are needed to turn the motor, instead of more simple ones, where one coil at a time is required.

General information about steppers can be found here:
http://homepage.cs.uiowa.edu/~jones/step/circuits.html

Details about the pase excitations can be found on
http://www.societyofrobots.com/member_tutorials/node/28
and the used sequence  is presented here...


2-2 Phase Excitation
This mode requires more power, but it also offes more torque than 1-1 Excitation. 2 coils are charged at a time
Step number1a 1b 2a 2b
11001
21010
30110
40101
51001


Details about pinout are not available, however  this link helped me out to figure out the right pinout:
http://ssecganesh.blogspot.mx/2008/05/identifying-leads-of-unipolar-stepper.html

The stepper is a fire wire, and as such is not possible to use the multimeter to find out the coils, however is possible to find out applying voltage on its pins.

Extracting from the mentioned page

  • Five wire motors:Measure the resistance between all pairs of wires. One wire will read about one half the resistance to all other wires when compared to the resistance between other pairs. This wire is the common wire. No wires are joined in this case.

Now, proceed to identify individual coils in order of sequence.
  • Connect the common lead to the positive of your battery or power supply.
  • Connect any one of the other four leads to ground. This will be coil 4.
  • With coil4 still grounded, connect another lead to ground. If the shaft does not move, you have coil2. If the shaft rotates clockwise, you have coil3. If the shaft rotates counter-clockwise, you have coil1.
  • Repeat until you have identified all four coils.
Based on the mentioned tests, thepinout is the following
1 Black         Coil4             A12 Brown       Coil 2            A23 Orange      Coil 3            B14 Yellow      Coil 1            B25 RED           VCC


Finally, a ULN2003APG driver is used to connect the stepper to the arduino,  and feed it with 12 volts.
Used pins are pin 8,9,10,11
Video of the working motor is available here

The used code used to drive the motor is quite simple.


int motorPin1 = 8;
int motorPin2 = 9;
int motorPin3 = 10;
int motorPin4 = 11;
int delayTime = 10;

void setup() {
  Serial.begin(9600);
  pinMode(motorPin1, OUTPUT);//coil1
  pinMode(motorPin2, OUTPUT);//coil1
  pinMode(motorPin3, OUTPUT);//coil2
  pinMode(motorPin4, OUTPUT);//coil2
}

void loop(){
  for(int i = 0 ; i < 100; i++)
    phaseTestFwd();
  for(int i = 0 ; i < 100; i++)
    phaseTestBack();
}

}

//mitsumi servo
void phaseTestFwd() {
  Serial.println("1");
  digitalWrite(motorPin1, HIGH);//1
  digitalWrite(motorPin2, LOW);
  digitalWrite(motorPin3, LOW);
  digitalWrite(motorPin4, HIGH);//2
  delay(delayTime);

  Serial.println("2");
  digitalWrite(motorPin1, HIGH);//2
  digitalWrite(motorPin2, LOW);
  digitalWrite(motorPin3, HIGH);//1
  digitalWrite(motorPin4, LOW);
  delay(delayTime);

  Serial.println("3");
  digitalWrite(motorPin1, LOW);
  digitalWrite(motorPin2, HIGH);//1
  digitalWrite(motorPin3, HIGH);//2
  digitalWrite(motorPin4, LOW);
  delay(delayTime);

  Serial.println("4");
  digitalWrite(motorPin1, LOW);
  digitalWrite(motorPin2, HIGH);//2
  digitalWrite(motorPin3, LOW);
  digitalWrite(motorPin4, HIGH);//1
  delay(delayTime);


}
void phaseTestBack() {
  Serial.println("8");
  digitalWrite(motorPin1, LOW);
  digitalWrite(motorPin2, HIGH);//2
  digitalWrite(motorPin3, LOW);
  digitalWrite(motorPin4, HIGH);//1
  delay(delayTime);

  Serial.println("7");
  digitalWrite(motorPin1, LOW);
  digitalWrite(motorPin2, HIGH);//2
  digitalWrite(motorPin3, HIGH);
  digitalWrite(motorPin4, LOW);//1
  delay(delayTime);

  Serial.println("6");
  digitalWrite(motorPin1, HIGH);
  digitalWrite(motorPin2, LOW);//2
  digitalWrite(motorPin3, HIGH);
  digitalWrite(motorPin4, LOW);//1
  delay(delayTime);

  Serial.println("5");
  digitalWrite(motorPin1, HIGH);
  digitalWrite(motorPin2, LOW);//2
  digitalWrite(motorPin3, LOW);
  digitalWrite(motorPin4, HIGH);//1
  delay(delayTime);

}



Cheers

UB