Go Down

### Topic: motor stepper (Read 1 time)previous topic - next topic

#### marie59

##### Mar 26, 2011, 04:19 pm
Hi

I am french and a dont speak english very well, so sory !!!

I buyed a "Arduino Wrobot Step Motor Shield" in ebay (http://cgi.ebay.fr/ws/eBayISAPI.dll?ViewItem&item=280526076404&ssPageName=STRK:MEWNX:IT)

but i have un probleme.
it is very very very slow ... 3 mn / 1 tour.

i think i do bad !!!

ina => arduino'pin digital 2
inb => pin digital 3
inc => pin digital 4
ind => pin digital 5
Gnd sur gnd
vcc  sur 5v

Code: [Select]
`#include <Stepper.h>// Nombre de pas #define STEPS 48Stepper stepper(STEPS, 2, 3, 4, 5);   void setup(){ stepper.setSpeed(30); }  void loop() { stepper.step(48); }`

Marie.

#### johnwasser

#1
##### Mar 26, 2011, 06:22 pm
Code: [Select]
`#define STEPS 48Stepper stepper(STEPS, 2, 3, 4, 5); `

Your stepper probably has more than 48 steps per revolution.  200 would be more common.
Not your fault.  The reference doesn't describe the functions well enough.

Check this example to see how the library is used:  http://arduino.cc/en/Tutorial/MotorKnob

It says:
Code: [Select]
`// change this to the number of steps on your motor#define STEPS 100// create an instance of the stepper class, specifying// the number of steps of the motor and the pins it's// attached toStepper stepper(STEPS, 8, 9, 10, 11);`

When you told the library that your motor had 48 steps per revolution and you wanted it to move at 30 revolutions per minute, that's 1440 steps per minute (24 steps per second).  If your motor is a 200-step motor your program will make it turn just short of 1/4 turn each time through loop() and it will take two seconds to get there.  Does it take just over 8 seconds to do one complete turn?

If it takes 8 seconds, change STEPS to 200
If it takes 4 seconds, change STEPS to 100

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

#### wildbill

#2
##### Mar 26, 2011, 06:41 pm
It looks like the same stepper motor as in this link: http://g33k.blogspot.com/2010/11/playing-with-stepper-motor-i-ordered-5.html and in the video there, the guy that put it together mentioned that the third of a revolution turn he demonstrates took 8000 pulses. I note that in Marie's link above the motor is described as having a reduction gear on it, so although it appears to be a 64 step motor, it's been geared down terrifically.

The upshot is that you'll need to tell the stepper class that it has a LOT more steps per revolution.

#### marie59

#3
##### Mar 26, 2011, 07:53 pm
Code: [Select]
`#include <Stepper.h>// Nombre de pas #define STEPS 200Stepper stepper(STEPS, 8, 9, 10, 11);void setup(){ }  void loop() { // Avance de 5 pas soit 1 tour stepper.step(200); }`

this does not work

it does not move the whole anymore

#### johnwasser

#4
##### Mar 27, 2011, 04:05 am
Why did you take out the line that sets the stepper speed?

Code: [Select]
`stepper.setSpeed(30); `

Does it work better if you put that line back in?
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

#### johnwasser

#5
##### Mar 27, 2011, 04:32 am
I finally found a specification that makes some degree of sense:  http://www.alibaba.com/product-gs/297990009/28BYJ48_W11_stepper_motor_driver_controller.html

That's for the 12v version but I think the number of steps is likely the same.

Steps:  64
Reduction ratio: 1:64

That come to 4096 steps per revolution of the output shaft.

They are saying something about the step frequency but I don't understand the terms.  It seem to imply that you can go at least 500 steps per second in one case and 700 in another case.  I suspect that is starting speed under load and no-load.   That's about 8 seconds per revolution or 7.5 RPM.  You may want to try a speed of 5 RPM until you get a feel for how fast you can drive it.
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Go Up

Please enter a valid email to subscribe