How to use step motor and controller


#1

Hi everyone,

is their an explanation/guide how to connect step motor and controller and controller with the arduino board and finally program it?
I’ve now experience with step motors and unsure where to start.

Have a good time.
Leo


#2

Hi Leo,

We will upload the use of the step motor soon. We made a new library of the step motor that may make the use of the motor easier.

Thank you for your support Leo…

Eric from Makeblock team.


#3

Just adding a “me too”–just a quick pointer or two would be superb. . (My kids have used up all the other motors and servos for various bots, and I’m left with only the steppers to work with; need to get those going.)


#4

Any word on when we can expect this??


#5

Come on, guys, how hard is this? Just spend a minute and say “Red wire to A+, Black wire to A-, Blue wire to B+” etc–I need a line of text from you, that’s it…


#6

Okay, pulled out the multimeter and made some guesses, and I’ve got the stepper motors rotating. Here’s what I did, reading from L to R along the connections on the back of the stepper motor controller:

DC- = connected to ground
DC+ = connected to arduino's Vin --that is, the unregulated, full-voltage power supply straight from the batteries (I'm using 12V)
B- = connected to stepper motor's Blue line
B+ = connected to stepper motor's Red line
A- = connected to stepper motor's Green line
A+ = connected to stepper motor's Black line
ENBL = connected to arduino's 5V line
+5V = also connected to arduino's 5V line
DIR = left this floating; should probably connect it to a digital pin, drive low to spin one way or high to spin the other
PUL = I sent a square wave to this, by hooking it to a digital pin and alternately driving it high and low rapidly

If you leave the DIP switches SW1…SW3 up, you’ll draw more current but the movements of the motor are more forceful; leave them down and you get the opposite. There’s a pretty chart on the top of the stepper controller to let you pick stuff in between; I just left SW1…SW3 up (off).

The hard part is SW5…SW7: you need to experiment with these and with the speed of your pulse. I found that if I left these switches up (off) and drove the motor with a slow square wave (~20milliseconds wavelength) I got choppy motion; I achieved the best, smooth speed by driving a fast square wave (~20 microseconds–so, every 10us toggle the PUL digital pin) and leaving SW5=OFF,SW6=ON,SW7=OFF.

I’m going to play with this a while; I’ll post a library for controlling the motor if I come up with something I like (and if anyone wants it).


#7

So sorry about the delay. Thanks lertulo so much. We’ve made the how to use stepper motor and controller user guide and uploaded them on download page.

Download them here:
http://makeblock.cc/wp-content/uploads/2012/11/42BYGHW609D4P1-Datasheet.pdf
http://makeblock.cc/wp-content/uploads/2012/11/Makeblock-2H-Microstep-Driver-User-Guide.pdf


#8

Thanks! I appreciate this also explaining SW4’s behavior, which was not mentioned on the chassis itself.

BTW, as an application note: these are capable of drawing 2A each; if you supply both of them from Vin on your Arduino’s board, you’ll be asking 4A to arc through the board from your power supply to the Vin pin. Not a good idea, unless you like the mystic blue smoke; draw your power directly from the supply instead…


#9

And just to finish off this thread: until Makeblock has a chance to publish an official stepper driver library, here’s a basic one that lets you run them like you would a basic motor. If you want more precise usage–say, turn N steps or turn to angle X, you’ll have to add that yourself.

To use the library:

#include <RS_StepperDriver.h>

RS_StepperDriver<2,3> MyMotor;  // ...for example, if pin D2 is wired to Direction, pin D3 is wired to Pulse

void setup()
{
   MyMotor.Setup();
}

void loop()
{
   MyMotor.Loop();

   if (whatever_i_want) {
      MyMotor.Run(255);   // full speed ahead!
   } else if (time_to_stop) {
      MyMotor.Stop();
   }
}

The class is templated with a lot of default configuration parameters provided; for example, by default it’s going to produce pulses between 280us and 2000us in wavelength, and will limit acceleration such that going from a stop to full-speed will take 3/4ths of a second. If you connect the ENBL line to a pin then you can specify that pin as part of the template, and use the MyMotor.Disable() method to set the motor to free-wheeling.


#10

Thanks for your support lertulo!!! That’s a great work!

We will upload our official stepper driver library soon. And a new stepper motor controller is in developing now. We will update it soon.

Thank you so much lertulo!!


#11

Where did they go? the link is bad


#12

There are here

http://wiki.makeblock.cc/index.php/Me_2H_Microstep_Driver

http://blog.makeblock.cc/wp-content/uploads/2012/11/Makeblock-2H-Microstep-Driver-User-Guide.pdf

http://www.makeblock.cc/42byg-stepper-motor/

The blog changes to http://blog.makeblock.cc/


#13

Does anyone have a working link to the Stepper datasheet? (42BYGHW609D4P1-Datasheet.pdf) The one above is dead :slight_smile:


#14