DC Motor driver help
HI, i'm trying to work on a school project that will use
a gps , 2 srf10 sensor,· a compass,·lcd/keypad and a robot base.
I ordered a BS2Pe for this project. (I think I made the right choice because of code space)
right now my problem is trying some sample code to get my robot base working.
I'm using a base from Zagros Robotics· at https://www.zagrosrobotics.com/Index.asp
which has 2 DC motors controlled by
it basically uses 2 PWM for input and 2 analog output to control the direction.
i'm a newbie to the bs2 and·I love it.·(...I got frustrated trying to use a Pic). does anyone have a sample of how to drive this robot base?
all the help is appreciated..
(This is the first my first posting of many to follow until i'm done with this project in early august) HELP!
Walter
a gps , 2 srf10 sensor,· a compass,·lcd/keypad and a robot base.
I ordered a BS2Pe for this project. (I think I made the right choice because of code space)
right now my problem is trying some sample code to get my robot base working.
I'm using a base from Zagros Robotics· at https://www.zagrosrobotics.com/Index.asp
which has 2 DC motors controlled by
it basically uses 2 PWM for input and 2 analog output to control the direction.
i'm a newbie to the bs2 and·I love it.·(...I got frustrated trying to use a Pic). does anyone have a sample of how to drive this robot base?
all the help is appreciated..
(This is the first my first posting of many to follow until i'm done with this project in early august) HELP!
Walter
Comments
·· One more thing that might make your life a little easier with this is by adding our PWMPAL, or any PWM co-processor to control the PWM inputs of your motor controller.· You can find the PWMPAL on our website.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
Regards,
Michael G. Jessat
I'll use I2C to control lcd/keypad, compass, and sensors.
2 for the rs232 for the gps, and 4 to control the robot. which is 8/12 I/Os.
but if I can't figure this out in the next few days/weeks, I'll have to buy it...(but I spent too much money in this project so far)
thanks
Walter
thank you guys
Walter
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Post Edited (Jon Williams (Parallax)) : 6/21/2005 3:11:06 PM GMT
I did some reading on the PWMPal documentation and it looks pretty good and I have decided to use it.
I looked at the sample code, but I'm still a little confused about how to make the dc motors operate in my robot base.
how do I make it reverse? or turn right or left?
Thanks
walter
I believe the motor driver you're intending to use has direction control for each motor.· With the motor stopped, you set the direction to move and then ramp up its speed by increasing the PWM duty cycle (from off to the speed you desire) to make that motor move.
Perhaps this simple table will help you start to visualize the robot's behavior vis-a-vis motor activity (F = forward, R = reverse, S = Stop):
LMotor·· RMotor··· Behavior
··
···
· S······· S·······Stop
· F········F·······Forward
··F······· S·······Pivot-turn, to right
· F······· R·······Spin,·clockwise
··S······· F·······Pivot-turn, to left
· R······· F·······Spin, counter-clockwise
· R········R·······Reverse
Remember, instant switching of the direction bits on your motor driver while the motors are running will probably kill it (the motor driver).· In your shoes I would work on a subroutine that lets me tell the motors what speed and direction I want and then let them ramp up or down to those target values.· Accelerating and decelerating are going to be important aspects of your robot and I trust you'll want to focus on that part first.· After you can get your robot to behave -- motion-wise -- the way you want, then you can take on the navigation aspect.
Your project is complex, so save yourself a lot of grief and just work on one part of it at a time.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
I'll do some reading on the subject.
and where can I find that "Robotics" text ?
Thanks
Walter
· You can find the Robotics v2.2 text here.
Kevin
Walter
1) how are the wirings supposed to be done? I see a sample, but what about the direction pin?
2) I looked at the sample code for the PWMPAL, but still can't figure out how to controll the direction of the motor.
Thanks
Walter
·· The example schematic provided in the PWMPAL docs is for turning the motor on/off and controlling it's speed with the PWMPAL.· To control direction you would need an H-Bridge.· One MOSFET won't do it.· You will need 4.· You can easily find example circuit by typing "H-Bridge" on Google under Image Search...I just checked.· Dozens come up.· Most H-Bridges accept a pulse-width modulated input to control speed.· The direction pin comes into play on some H-Bridge configurations.· You will see if you check the results of that search.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com