5 wire Stepper motor configuration

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
singhm29
 
Posts: 49
Joined: Thu Dec 02, 2010 2:19 am

5 wire Stepper motor configuration

Post by singhm29 »

So I have got a salvaged stepper motor from an old printer but am wondering if anyone could shed some more light onto how i figure out what wire does what. I have measured all the resistances between the wires and determined that the centertap is red2 so this will be connected to the +ve terminal of the power supply correct?

Resistance table
white red1 red2 red3 red4
white ------ 110 55 110 110
red1 110 ---- 55 110 110
red2 55 55 ---- 55 55
red3 110 110 55 ---- 110
red4 110 110 55 110 ---

The stepper motor itself is a Mitsumi m42sp-7p if that helps

Thanks!

User avatar
adafruit_support_bill
 
Posts: 88088
Joined: Sat Feb 07, 2009 10:11 am

Re: 5 wire Stepper motor configuration

Post by adafruit_support_bill »

The center tap goes to ground: http://www.ladyada.net/make/mshield/use.html

singhm29
 
Posts: 49
Joined: Thu Dec 02, 2010 2:19 am

Re: 5 wire Stepper motor configuration

Post by singhm29 »

I tried two techniques to figure out the combination that would work and failed with both!
http://www.ladyada.net/make/mshield/use.html
-this is the exact setup im using except my stepper has 5 wires. I connected the common tap to gnd which I beleive is the center spot on the block terminal correct? Or was this a stupid assumption? And then I connected these combinations thinking that by system of elimination I would end up with the correct setup I ran the test code which compiled fine and tried these combos.
(Coil 1 aka M3) (Coil2aka M4)
White red1 red3 red4
white red3 red1 red4
white red4 red1 red3
According to my grade twelve math skills thats the total combinations if order doesnt matter and repeats dont! All i got here was a jitter each time

The second method was to use a wall plug with 12.5V and 150mA rating and followed steps according to this
http://www.doc.ic.ac.uk/~ih/doc/stepper/others/
connecting the common to V+ and one permanately to gnd and then testing the rest one by one. Here It didnt even look like it moved at all.

Any ideas?

singhm29
 
Posts: 49
Joined: Thu Dec 02, 2010 2:19 am

Re: 5 wire Stepper motor configuration

Post by singhm29 »

So I think ive made some progress, I tested again connecting to a wall plug the common red2 to ground and then trying difference sequences of grounding to see if i could get movement in one direction. I managed to figure out that red1 then white then red3 then red4 moved me CW and the opposite gave me CCW. So I have two new questions now. One is that entire sequence moving me 7.5 degrees in total after all 4 of those are gnded or is each gnd moving me 7.5 degrees (assuming this salvaged motor moves 7.5 a step.Next how do I now know which wires belong to coil 1 and which belong to coil 2 when im connecting it up to the arduino motor sheild?

I have been using the supplied code for testing purposes

// Adafruit Motor shield library
// copyright Adafruit Industries LLC, 2009
// this code is public domain, enjoy!

#include <AFMotor.h>

// Connect a stepper motor with 48 steps per revolution (7.5 degree)
// to motor port #2 (M3 and M4)
AF_Stepper motor(48, 2);

void setup() {
Serial.begin(9600); // set up Serial library at 9600 bps
Serial.println("Stepper test!");

motor.setSpeed(10); // 10 rpm
}

void loop() {
Serial.println("Single coil steps");
motor.step(100, FORWARD, SINGLE);
motor.step(100, BACKWARD, SINGLE);

Serial.println("Double coil steps");
motor.step(100, FORWARD, DOUBLE);
motor.step(100, BACKWARD, DOUBLE);

Serial.println("Interleave coil steps");
motor.step(100, FORWARD, INTERLEAVE);
motor.step(100, BACKWARD, INTERLEAVE);

Serial.println("Micrsostep steps");
motor.step(100, FORWARD, MICROSTEP);
motor.step(100, BACKWARD, MICROSTEP);
}

User avatar
adafruit_support_bill
 
Posts: 88088
Joined: Sat Feb 07, 2009 10:11 am

Re: 5 wire Stepper motor configuration

Post by adafruit_support_bill »

The data sheet isn't very helpful. It doesn't show pinouts: http://www.mitsumi.co.jp/latest/Catalog ... sp_7_e.pdf
But you should be able to get it to work in one of the combinations you tried.

Do you know if yours is the 12v or 24v model? If your drive voltage is too low, it might be able to do single steps, but would just jitter if you tried to drive it at speed.
Also, have you verified that your motor shield is working properly? Have you driven other motors on M3-M4?

singhm29
 
Posts: 49
Joined: Thu Dec 02, 2010 2:19 am

Re: 5 wire Stepper motor configuration

Post by singhm29 »

I have no idea wether it is a 12v or 24v do you think the fact that i was sucessfully moving it in that grounding method indicates its 12v? Since according to the data sheet for the 24V model says the working voltage is DC 21.6~26.4V so the 12.5V I was feeding definitely would not have been enough. I have also not been able to test another stepper motor on that port but i have been running a servo off the board without difficulty..my application of the stepper isnt complicated I just want to be able to move it in 45 degree intervals so I think I can acheive this with single stepping.

motor.setSpeed(10); -i set the argument to this as one and it just seemed to jitter more slowly

Is their a difference with the order of how i connect to M3 and M4? like if i connect white and red1 to M3 would it be different if I did red1 first then white?
Also maybe since I have found that pattern that moves it CW already I can issue that manually through the motorsheilds ports, any idea on what the command would look like for that?

User avatar
adafruit_support_bill
 
Posts: 88088
Joined: Sat Feb 07, 2009 10:11 am

Re: 5 wire Stepper motor configuration

Post by adafruit_support_bill »

I have no idea wether it is a 12v or 24v do you think the fact that i was sucessfully moving it in that grounding method indicates its 12v?
12v is probably enough to step a 24v motor - albeit with very little torque. But based on your resistance measurements, it it probably the 12v model.
I have also not been able to test another stepper motor on that port but i have been running a servo off the board without difficulty
The servo part of the shield shares no circuitry with the stepper control. We should make sure that the stepper control is functional. If you can post some photos of the board we can have a look for any assembly problems.
Is their a difference with the order of how i connect to M3 and M4? like if i connect white and red1 to M3 would it be different if I did red1 first then white?
Typically, if you hook it up and it jitters like you describe, swapping a pair of leads will make it run.

singhm29
 
Posts: 49
Joined: Thu Dec 02, 2010 2:19 am

Re: 5 wire Stepper motor configuration

Post by singhm29 »

So I thought I was on to something and maybe just a wire or two were mixed up so i decided to try out all 24 combinations of the 4 wires and keeping the centertap connected to gnd. Nothing good same jittering it looked like it would step twice to the left and then back to the right.

Now im kind of wondering if I even grounded the centertap... the red wire going to the center of the motor block is ground correct? on the other motor block it explicity says its ground but on this one it doesnt
http://img819.imageshack.us/i/centertapandboard.jpg/
(PS why isnt it embedding the image in the post :@)

As for the soldering here are a few images
http://img522.imageshack.us/i/topviewofboardused.jpg/
thats the top view of the area im using

http://img202.imageshack.us/i/solderingofthatarea.jpg/
thats the bottom of that area

http://img577.imageshack.us/i/fullsoldering.jpg/
heres the full bottom

http://img41.imageshack.us/i/steppermotorandwires.jpg/
aand here the stepper motor wires just for kicks

So unless my assumption is wrong that the middle port of the motorblock is ground the only thing I can think of is that the motorsheild might not be working correctly since I was able to get the stepper motor to step by grounding each wire one by one while keeping the common tap at 12.5V. Thanks again for the quick replies!

User avatar
adafruit_support_bill
 
Posts: 88088
Joined: Sat Feb 07, 2009 10:11 am

Re: 5 wire Stepper motor configuration

Post by adafruit_support_bill »

The center screw on both terminal blocks is the ground.

It looks like you might have a couple cold solder joints, as well as some that could use some more solder. Use a clean, hot iron and make sure that the solder flows well onto the pin and the surrounding pad.
Check the soldering tutorials for more tips and examples of what joints should look like. http://www.ladyada.net/learn/soldering/thm.html

You should trim those resistor and capacitor leads closer to the board as well. When driving high current loads like a motor, a short can be catastrophic.

But I suspect that the main problem here is the bent pins on your headers. Some of those bent pins are the control signals for running stepper motors. Make sure all the header pins are straight and aligned with the corresponding female headers on the Arduino.

singhm29
 
Posts: 49
Joined: Thu Dec 02, 2010 2:19 am

Re: 5 wire Stepper motor configuration

Post by singhm29 »

OK that puts some of my doubts out of the way. I will definitely resolder some of the parts tommorow. See the thing with the bent pins is that I bent the pins that I knew I wouldnt use as I needed those pins for other things in my project. According to this thread http://forums.adafruit.com/viewtopic.php?f=31&t=13173 shows that pin 3 which i bent is for stepper motor 1 (Digital pin 3: DC Motor #2 / Stepper #1 (activation/speed control)) and pin 9 is for servo #2 (Digital 9 to servo #2) and the other two pins, 2 and 13, are not used by the motor sheild (Digital pin 2, and 13 are not used.). Would you say that doing this is still unacceptable? As I am using stepper 2 not stepper 1.

User avatar
adafruit_support_bill
 
Posts: 88088
Joined: Sat Feb 07, 2009 10:11 am

Re: 5 wire Stepper motor configuration

Post by adafruit_support_bill »

You are correct. Those pins are not used for stepper #2. But there is no need to bend them in order to use those pins for other purposes. I'd be concerned about the bent pins shorting against somethong else.
If there is nothing hooked up to M1-M2, then you can use those pins for anything you want. To be extra safe, you could remove the L293 chip on the M1-M2 side.

singhm29
 
Posts: 49
Joined: Thu Dec 02, 2010 2:19 am

Re: 5 wire Stepper motor configuration

Post by singhm29 »

Hey I am planning on testing today without the other L293 chip disconnected but I decided also to look into the L293 chip itself to get a bit more of an idea of what exactly it does. This raised a few questions in my mind...the stepper we are using is a 4 phase motor...is that still compatible with the motor sheild because from what this individual states a single L293D chip "So one L293D can, in theory, drive one bi-polar 2 phase stepper, if you supply the sequence." (http://www.seattlerobotics.org/Encoder/ ... ppers.html). Right now im running out of ideas and thinking of sending out an order to Jameco to grab these http://www.jameco.com/webapp/wcs/stores ... _171601_-1. It seems like a common cheap stepper that a few people have used with arduino. What do you think?

User avatar
adafruit_support_bill
 
Posts: 88088
Joined: Sat Feb 07, 2009 10:11 am

Re: 5 wire Stepper motor configuration

Post by adafruit_support_bill »

That motor looks like it should work fine with the shield.

singhm29
 
Posts: 49
Joined: Thu Dec 02, 2010 2:19 am

Re: 5 wire Stepper motor configuration

Post by singhm29 »

On another note ive found a few more pepople with similar problems and they mentioned something about adjusting the duty cycle...think that might be a possible problem? http://www.makingthings.com/forum/devices/163705799.

And how much voltage does the motorsheild provide the stepper motors with?

User avatar
adafruit_support_bill
 
Posts: 88088
Joined: Sat Feb 07, 2009 10:11 am

Re: 5 wire Stepper motor configuration

Post by adafruit_support_bill »

they mentioned something about adjusting the duty cycle...think that might be a possible problem?
I'm not familiar with the specific software they are talking about, but duty-cycle in the context of motors generally refers to PWM and the percentage of time that the output is energized. I don't have the code in front of me at the moment but I believe that for steppers, the AFMotor library is always at 100% duty cycle for each step. Operating at less than 100% is roughly equivalent to operating at a lower voltage.
And how much voltage does the motorsheild provide the stepper motors with?
The stepper motors will get whatever supply voltage you connect to the shield, minus about 1.2 volts.

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”