Pbasic program for Dual DC motor using the L293D H bridge
Julien
Posts: 3
Hello all,
I am new to the world of robotics and coding and have just purchased the professional developer kit. I have gone through the exercise. I do have a project that i am working on in which I would like to control two small DC motors independently using the BS2 and the L293D H bridge. I guess me first question is:
Is it possible to do this with just the L293D (motors will each run at less than .6mA) Am I better off making my own H bridge?
Also is there any sample BS2 code that will allow me to control direction of each motor independently. I do not need to control speed at this time.
Thus far I have read through some great information from this forum including the Column#23 of the Nuts and volts of basic stamps paper, which is excellent.
Also do any of you use the L293D in your projects? what are your thoughts on as a basic h bridge?
Thanks in advance
JJ
Post Edited By Moderator (Chris Savage (Parallax)) : 6/16/2007 6:36:26 PM GMT
I am new to the world of robotics and coding and have just purchased the professional developer kit. I have gone through the exercise. I do have a project that i am working on in which I would like to control two small DC motors independently using the BS2 and the L293D H bridge. I guess me first question is:
Is it possible to do this with just the L293D (motors will each run at less than .6mA) Am I better off making my own H bridge?
Also is there any sample BS2 code that will allow me to control direction of each motor independently. I do not need to control speed at this time.
Thus far I have read through some great information from this forum including the Column#23 of the Nuts and volts of basic stamps paper, which is excellent.
Also do any of you use the L293D in your projects? what are your thoughts on as a basic h bridge?
Thanks in advance
JJ
Post Edited By Moderator (Chris Savage (Parallax)) : 6/16/2007 6:36:26 PM GMT
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
D Faust
To answer your first question: yes. However I assume that you meant that your motors draw 600mA not the .6mA that you specified. The 293 has three inputs for each motor. One of these is an enable that I would probably hardwire to be on all the time unless it was necessary to have access to these for a "fail-safe" condition. The other two are the high and low leg of the bridge. A high on one input and a low on the other will cause the motor to turn one direction; reverse this and the motor reverses. Generally these inputs are driven with PWM signals which allow you to control the speed as well as direction.
There is no need for you to build your own H_Bridge unless you have some high current needs or want to control some weird, exotic motor.
Personally I gave up building my own motor drivers years ago. There are some great motor driver packages offered by Parallax, Pololu, Lynxmotion, Solutions Cubed and many others. Most or all of these provide codes for Stamp products. Currently I am using two Parallax HB-25 motor drivers to control a large robot powered by surplus wheel chair motors. The entire interface to my BS2 is one wire and a ground that allows me to control both motors with speed and direction. That leaves pins open for other motors,sensors,etc. The code is so simple that even a caveman can do it!
Hope this helps,
Danny22
I will look into the HB-25 motor controller as well.
It's my mother - I'll put her on the speaker phone...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Whit+
"We keep moving forward, opening new doors, and doing new things, because we're curious and curiosity keeps leading us down new paths." - Walt Disney