View Full Version : Help driving motors

04-19-2007, 01:03 AM
I am a Mechanical Engineering student who has recently undertaken an EE's problem. I am using a basic stamp II board of education to try and drive two applied motion step motors. I need to run one motor out a distance, run the other out and back in, and finally return the original motor to its starting point. I am able to run the motors in one direction using the example program:

' {$STAMP BS2}
' {$PBASIC 2.5}
counter VAR Word
DEBUG "Counterclockwise 10 o'clock", CR
FOR counter = 1 TO 2500
PULSOUT 14, 200
DEBUG "Clockwise 2 o'clock", CR
FOR counter = 1 TO 2500
PULSOUT 14, 200
DEBUG "All done."

But I can not get the motors to toggle and run in the opposite direction. I have tried using the HIGH/LOW command but have had no result. Could this be the result on not powering the BOE with the same supply as the motors. Any help with this would be great.

Post Edited By Moderator (Chris Savage (Parallax)) : 4/18/2007 9:23:25 PM GMT

Mike Green
04-19-2007, 01:24 AM
You will need to post information about how your stepper motors are driven and how they're connected.

Most stepper motor drivers have a step and a direction input. It looks like you have the step input of some kind of driver attached to pin 14. Somewhere there's a direction signal. You'll have to find it, find out how it's controlled, and use it to reverse the direction of the motor steps. Most likely, it's another logic signal like the step signal and could be connected to another Stamp pin, then changed with a HIGH <pin> and LOW <pin> statement.

04-19-2007, 02:37 AM
Thanks, I finally got it figured out but am still running into rpm problems. I need to increase the speed, but I believe I've reached the limit as the processing speed. Is there anything I can do to alter this or possible another type of stamp available. I am looking for about 10 rps, but am only getting about 1-2.

04-19-2007, 07:56 AM
If its faster processing speed you need try the BS2sx or BS2px.

At some point your stepper motor will run out of torque and will just sit and whine at at you.

Also, if you go to a motor with larger degrees/pulse, a given pulse stream will give you faster rpm.

There are also stand alone controllers which work independent of the Stamp processing speed. You send them a command for distance ,speed and direction and they do the whole job. See the Parallax site under motor controllers.


Tom Sisk