Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: Jon_Wayne on March 14, 2007, 10:06:45 PM

Title: Beginner here
Post by: Jon_Wayne on March 14, 2007, 10:06:45 PM
Hey hows it going, I'm new to the whole robot thing, and am very anxious to get started, Ive pretty much got the gist of everything i need to do, and with a few weeks of planning and shopping i pretty much know what i want to do. so i got the basic stamp 2 microcontroller along with the board of education, and from what i have read in the past few days, not to many people like it and will probably recommend i use something else. well, fact of the matter is, its what i got, Ive played with it and i like it, and from doing some shopping, i see it as one of the easiest/simplest mcu's to start with. maybe later on ill ask whats better. the only thing that i don't like about it is in the reference manual and the little beginners guide has no mention of how to hook up a motor controller. I'm getting 2 lynxmotion GHM-02 12v gearhead motors (www.robotshop.ca ) so i can rig up a differential drive, I'm also getting the lynxmotion 20v 1 amp dual h-bridge motor driver. I'm trying to figure everything out before it gets here so i can hit the ground running, but even the online manual for the motor driver doesn't go into detail about hooking it up other than with this other mcu. now i have some limited experience soldering and that experience has never consisted of soldering on those tiny boards. can i/will i have to hook it up onto the board of education's breadboard? (www.parallax.com to take a look at the board of education) also, if someone can fill me in on as to how to control the speed of a motor with the motor driver? i would like to have an understanding of the concept. is it all in the programming? i also understand that running a motor at slower speeds continuously can be bad for the motor. does anyone know of a solution to this problem? i don't want my first robot to be zipping around at 150 ft per second. the motors i ordered are geared 50:1 so hopefully i don't have so much of a problem. with some experimenting i can figure out a sweet spot.

also, I'm not sure if i should consider this a good idea, or just stupid:  i bought a really cheap 12v drill (sears.com 22 bucks) my intentions are to use the 12v battery (unsure of what kind it is, not Lith-ion thats for sure) as a power source for my 12v  motors. keep in mind i have no intention of using the drill motor as a means of propulsion. maybe for spare parts later on. anyways, let me know if you think that was stupid or not.

one more thing I'm not sure of: i definitely want to protect my motor driver and motors, and i have no intention of using my 12v battery to supply power to my microchips n shit, I'm happy using a 9v battery that fits in well with the parallax board of education(5v regulator on board). anyway, somewhere in the tutorial it says that switching regulators are better than regular voltage regulators because they are more efficient. (my thoughts are for using one for the motor driver/motors) but it also says that there is a 1-2v voltage drop across a switching regulator. this kind of confused me.  i guess my question is, if I'm using a 12v battery to supply two 12v motors, should i just cut my losses and go with the voltage regulator and accept the fact that its not going to be as efficient? i really had my heart set out to getting a switching regulator(i like efficiency), but if i don't need it, then i don't need it.
thanks for your time and support
Title: Re: Beginner here
Post by: trigger on March 14, 2007, 10:59:46 PM
Regarding your choice of mcu, don't sweat it.  Most people here recommend against it because it's expensive and because it codes in BASIC.  Well, you've already bought it and you said you (more or less) that you like BASIC, so more power to you.

I recommend getting "Robot Builder's Bonanza."  It covers a wide range of robotics topics, and it goes into depth on how to use the BASIC stamp mcu.  You'll find lots of stuff in there about interfacing with your stamp.  Check it out from the library for free, or buy it.  I've got the book and I don't use the stamp, but I like the book.

I'll defer to others regarding the motors; I don't use them.

That drill battery is gonna be hecka heavy.  If you haven't bought those 12V motors yet, why not buy some 6V motors?  They will allow you to use a lighter battery, and lighter robots are happy robots.  Ask any of the old timers here, and they'll tell you that their first robot was a failure because they made it too heavy.  That's not to say it can't be done, but it's something to be aware of.

You probably don't need a switching regulator for your motors.  But if you really want a fancy, fault-tolerant circuit, the switching regulator is the way to go (rather than a linear regulator).  And the linear regulator that comes with the stamp is fine--don't replace it unless you also want to muck around with replacing the caps in your power circuit.   Going with two power supplies is a good idea for your first circuit.  Or you can put a fat protection diode (e.g., 1N4004) in series with your unregulated voltage supply and your motors (and probably a rather large cap too).  Check around the web for more detailed circuits. 

Edit: (delete previous comment--information overload)
Title: Re: Beginner here
Post by: Jon_Wayne on March 14, 2007, 11:36:59 PM
thanks for the book advice, ill have to take a look at it. with respect to the fat protection diode: wouldnt that cause a voltage drop? or is that negligable? is there anyway to put it in parallel and it still be effective?  also, im using a seperate power supply for my mcu, so thats all taken care of. and my motor stall current is higher than the motor driver rating, but not by much and im gonna put in some fuses for that, and i may be naive for saying this but i dont expect the motors to stall, stall torque is 123 oz/in. which may be overkill. i also say this based on the wheels i will be using, but not at all based on an obstacle avoidance system that hasnt been thought about yet. thats why i am not to concerned about the weight of the battery. granted in a couple weeks i may be eating my words. i am basically designing the robot around the type of performance i want rather than putting some stuff together that works and then figuring it out when im done. i may find out the hard way that its not going to work out. but thats what learning is about right? learning from ones and others mistakes. thank you for your help
Title: Re: Beginner here
Post by: trigger on March 15, 2007, 09:57:10 AM
thanks for the book advice, ill have to take a look at it. with respect to the fat protection diode: wouldnt that cause a voltage drop? or is that negligable?

Definitely, and maybe.  Depending on your design, if your battery is rated higher than your motor voltage (this occurs more often with servos that have a 4.8v-6v range), then dropping the voltage may be desireable.  You may need two diodes to achieve the voltage drop you want. I know it's inefficient, but it's effective and provides reverse voltage protection for your sensitive circuits.

Quote
is there anyway to put it in parallel and it still be effective? 

No.

Quote
also, im using a seperate power supply for my mcu, so thats all taken care of. and my motor stall current is higher than the motor driver rating, but not by much and im gonna put in some fuses for that, and i may be naive for saying this but i dont expect the motors to stall, stall torque is 123 oz/in. which may be overkill. i also say this based on the wheels i will be using, but not at all based on an obstacle avoidance system that hasnt been thought about yet. thats why i am not to concerned about the weight of the battery. granted in a couple weeks i may be eating my words. i am basically designing the robot around the type of performance i want rather than putting some stuff together that works and then figuring it out when im done. i may find out the hard way that its not going to work out. but thats what learning is about right? learning from ones and others mistakes. thank you for your help
Definitely. Best of luck and have fun!
Title: Re: Beginner here
Post by: dunk on March 15, 2007, 12:16:23 PM
hey John,
so the basic stamp is a great starting platform, you just might outgrow it a bit more quickly than some.

so regarding your motor controlers current rating beng close to the stall current of your motors, check if your motor controler has an over current monitor. many motor controlers just switch off when the current gets too high which would be exactly what you want. alternitivley you could put sensors on your wheels (shaft encoders) and have the microcontroler switch off the motor if the wheel stops turning. your fuse idea will work as well but may get a bit frustrating changing fuses...

connecting your motor controlers to your microcontroler should become apparent as you start playing with them. without knowing the specs, i'd imagine there will be input pins on the motor controler for forwards/backwards etc and a PWM (Pulse Width Modulation) pin for speed. the PWM pin you will have to pulse on and off. if it's on 70% of the time and off 30% the output voltage to the motor will be 70% of maximum.
practice switching on and off LEDs with your microcontroler and you should be fine. see if you can vary the brightness of an LED with PWM output.

the additional efficiency to be gained from a switching regulator probably won't make too much difference. i'd stick with what you have for now and leave it for a future upgrade. (start simple...)

anyway, have fun with it,

dunk.
Title: Re: Beginner here
Post by: Jon_Wayne on March 15, 2007, 06:38:47 PM
thanks alot for your help, i understand the motor controller idea now, it makes sense. unfortunately my motor controller doesnt have an over current monitor. and with keeping with the "keep it simple" idea, i will use fuses for now and probably get encoders later, (good idea). which will probably be pretty useful for other things other than to protect the motor controller.