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




7 comments:

zedeneye1 said...

Hi, do u have a datasheet for the m42sp-4np ?
I have searched all over the internet.
If possible, tell me the voltage and current ratings. And also tell me maximum pulse per second.

User Abuser said...

Ussualy you can find somethign like this.

http://docs9.chomikuj.pl/775742687,PL,0,0,m42sp-4np.pdf

For what I know , it was driven with a 15V LM2940CT positive voltage.

After a small search, I found this.

http://projectus.freehost7.com/Stepper-motor-control/?the-specification-of-the-stepper-motor

Quoting...
"Stepper motors are electromechanical devices that convert a pattern of inputs and the rate-of-change of those inputs into precise rotational motion. The rotational angle and direction for each change (step) is determined by the construction of the motor as well as the step pattern input. The M42SP-4NP is a standard, four-phase unipolar stepper motor that is easily controlled when buffered with an appropriate high-current driver (ULN2003 or similar suggested).



Technical Specifications

I) Rated Voltage 12 vdc

II) Rated Current/Phase 259 mA

III) No. of Phase 4

IV) DC Coil Resistance 77 ohms / phase ±7%

V) Step Angle 7.5° / phase

VI) Excitation Method 2-2 phase (unipolar)

"

Mechanical Specifications



MITSUMI• Unipolar Stepper Motor (#M42SP-4NP)•

Regards

UB

Franz said...
This comment has been removed by the author.
Franz said...

Hi User Abuser,
I found something wrong in your article. Surely, there's a curly brace out of place.
Then, I think color referring to coils are not exact, may be.
I recycled a m42sp 4np motor from a scanner and my colors are these:

Red = Common
Yellow = Coil 1
Orange = Coil 2
Brown = Coil 3
Black = Coil 4

With this configuration, and the correction of your code, the gear spin. Using your conf I had to put wire of pin2 to hole 10 on arduino, and pin3 to hole 9.

Hope this help, and hope I do right because I don't study electonics but earth geology =)

thanks

paolo percds said...

Hi, i have made a similar project with M35SP-9 Mitsumi http://www.youtube.com/watch?v=oLaTRkZNtNE

Unknown said...

Thank you for this! This is the best tutorial I've seen. It got me up and running right away.

Unknown said...

hello guys does l293d shield can operate this motor?