How to run 2 stepper motors in one bs2??? help please
arturoj
Posts: 4
Hi, I'm new in this programming thing, and I have a school project where I need to run 2 stepper motor but I just have one Homework board with the BS2.
I can controll 1 motor, and I'm using a Darlington buffer ULN2003A, and the external DC source, and it's working OK.
I thought that if I hooked 2 Darlingtons I could control both motors, one with each buffer, because I need them to do direfent command while they work at the same time. But it didn't work.
I supouse there are 2 reasons it's not working,
I'm not conecting correctly the motors, I am going to draw and take a picture of my wiring.
And, this one I'm sure I'm not doing it correctly, I don;t know how to tell the BS2 to send the command at the same time to two diferent motors, for example, while a Loop, I need that the other one turns a couple degrees to the left, and stay there for x seconds, and then again to the left or the right.
What I'm trying to build it's like a little "robot" that "paints streets, so I will will program how much time it must stay turning left, right o straight ahead, and the other motor, must make a marker, to up and down for certain periods of time, so it will "paint" the yellow line in the middle of the street, the one that goes straight all the way or like in short lines, where you can pass the other car.
I'll appreciate very much any help, advice, comments, and hints on which commands to use, so I'll investigate them and learn how to use them
Thank you
Arturo
I can controll 1 motor, and I'm using a Darlington buffer ULN2003A, and the external DC source, and it's working OK.
I thought that if I hooked 2 Darlingtons I could control both motors, one with each buffer, because I need them to do direfent command while they work at the same time. But it didn't work.
I supouse there are 2 reasons it's not working,
I'm not conecting correctly the motors, I am going to draw and take a picture of my wiring.
And, this one I'm sure I'm not doing it correctly, I don;t know how to tell the BS2 to send the command at the same time to two diferent motors, for example, while a Loop, I need that the other one turns a couple degrees to the left, and stay there for x seconds, and then again to the left or the right.
What I'm trying to build it's like a little "robot" that "paints streets, so I will will program how much time it must stay turning left, right o straight ahead, and the other motor, must make a marker, to up and down for certain periods of time, so it will "paint" the yellow line in the middle of the street, the one that goes straight all the way or like in short lines, where you can pass the other car.
I'll appreciate very much any help, advice, comments, and hints on which commands to use, so I'll investigate them and learn how to use them
Thank you
Arturo
Comments
Bs2. 2,5
Pulseout 15 ,2500
Pulseout 13, 2500
Pulseout 14, 2500
Pulseout 12, 2500
And well the for next x amount of times depending on how much I want it to turn. With that command it will turn one step.
The common wire is conected with the last port of the darlington buffer and the negative wire of the external power source.
I will conect it and take a picture and make the wiring diagram, it will be easier for me to explain myself.
Thanks for the tip, I'll read it right away.
I'm using an DC power source that gives 300mA, that maybe a problem, but I will get a new one in the afternoon.
I'll attach my schematics on how I'm connecting the entire circuit, and a picture.
On the first diagram it's how it is already conected and working with one motor, thats what I wrote to test it.
' {$STAMP BS2}
' {$PBASIC 2.5}
DEBUG "2500"
tape VAR Byte
FOR tape = 1 TO 50
DEBUG ? tape
PULSOUT 15, 2500
PULSOUT 13, 2500
PULSOUT 14, 2500
PULSOUT 12, 2500
NEXT
DEBUG "clockwise"
END
The second schematic is how I think I must connect the second motor, but I'm not sure where or how to feed the current to the second Darlington, and I supouse that where the number 1 is, I must connect it to the Vss like in the first Darlington
So I need to finish these connection, and have an idea on how to program both at the same time but doing diferent stuff.
I'll read what SRLM told me to research, and keeo trying.
Thanks
if it was continuous revolution servos you would use the boe bot program
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Parallax posesses power beyond belief.
Believe in it.
does that mean i should use a shift register since i would also like to know
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Parallax posesses power beyond belief.
Believe in it.
It's up to you. Try it, see how it works in your setup, and make a decision. That's part of the fun of robotics: experimenting for yourself. It's okay to make mistakes if you learn from them.
Does anyone know how i would be able to add a second motor to a professional development board, and are their any specific pins on the bs2p40 that i would have to connect it to?
Shaun