Pages: [1] 2   Go Down
Author Topic: Adafruit Motor Shield and two 6v motors  (Read 2781 times)
0 Members and 1 Guest are viewing this topic.
California
Offline Offline
Full Member
***
Karma: 0
Posts: 129
That's me, the boy with the broken halo.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm building a new robot using the chassis of a swap meet remote control car (Wikipedia says the motors want 6v).  The brains will be an Arduino Duemilanove and an Adafruit Motor Shield.  I've read the user manual for the Motor Shield, but still have a couple questions.  I've tentatively run the motors off 4.8 volts and it is enough juice to go forward and backward but not enough to turn.  I'm afraid to burn up the motors since I have no experience with 6v motors.

Stuff I've read and understand:
1) The Arduino and Motor Shield will run off one 9v battery.
2) The motors will work better with their own battery source and that battery source will never go through anything other than the motors.  I don't have to worry about that going through any electronics.

What I need help understanding:
1) Can I daisy chain 5, 1.2v rechargeable batteries for 6v and plug that into the external power terminals to run the motors?  Is there a better rechargeable 6v battery out there with enough MaH to last a day and then recharge at night?
2) There is a jumper to run the motors off the same 9v that runs the Arduino and Motor Shield.  Isn't 9v going to hurt a 6v motor?

Thank you for any and all help.
Logged

0
Offline Offline
Shannon Member
****
Karma: 200
Posts: 11718
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Isn't 9v going to hurt a 6v motor?

Its likely to shorten its life, but on the other hand it will run faster...   My question is what 9V battery do you think of using that capable of sending a few amps?  9V batteries are usually the little PP3's that have a small capacity and a smaller current-handling ability and are not really up to powering anything but really puny motors.

And I'd advise against putting the motors on the same batteries as the Arduino, its unlikely to work reliably and you might be sending inductive spikes onto the power line which could do damage.
Logged

[ I won't respond to messages, use the forum please ]

Phoenix, Arizona USA
Offline Offline
Faraday Member
**
Karma: 39
Posts: 5557
Where's the beer?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm building a new robot using the chassis of a swap meet remote control car (Wikipedia says the motors want 6v).  The brains will be an Arduino Duemilanove and an Adafruit Motor Shield.  I've read the user manual for the Motor Shield, but still have a couple questions.  I've tentatively run the motors off 4.8 volts and it is enough juice to go forward and backward but not enough to turn.  I'm afraid to burn up the motors since I have no experience with 6v motors.

I'm curious as to why you decided to use a motor shield instead of hacking the controller on board? Then again, hacking such controllers can be more trouble than they're worth...


Stuff I've read and understand:
1) The Arduino and Motor Shield will run off one 9v battery.
2) The motors will work better with their own battery source and that battery source will never go through anything other than the motors.  I don't have to worry about that going through any electronics.

Well, the current for the motors must flow thru the h-bridge on the motor driver shield - so it will be going thru some electronics. Right now you are assuming the motors are 6V motors - do you know this for certain? What kind of battery or batteries were used originally for the R/C car? Also - how much current do the motors pull when running vs. stalled? Can the motor driver shield (more specifically - the L293) handle the current?

What I need help understanding:
1) Can I daisy chain 5, 1.2v rechargeable batteries for 6v and plug that into the external power terminals to run the motors?  Is there a better rechargeable 6v battery out there with enough MaH to last a day and then recharge at night?

Lasting "all day" is probably going to be a tough requirement, but currently is completely unanswerable without knowing what the maximum current the motors pull. Also, what do you consider a "day"? 8 hours? 6 hours? How often will the motors be running? Only with this kind of information can you then make a determination of what kind of battery you will need to handle your situation. Also note that as battery weight goes up, your run time will change as well. But if you go with "maximum current pull" (that is, the motors "running" for however long at stall current), you can get close to an answer.

As far as a battery is concerned, I would go for one (or two in parallel)  7.2 VDC NiMH R/C battery packs. They are common, have fairly high mAH ratings, not too heavy, and are not really that expensive (until you get into the racing packs which have high mAH ratings, with very high current draw ratings as well).

2) There is a jumper to run the motors off the same 9v that runs the Arduino and Motor Shield.  Isn't 9v going to hurt a 6v motor?

It depends on how high of quality the motors on the car really are; if its a cheap bottom-dollar toy, chances are the bearings are sintered bronze impregnated with oil (aka "oilite bearings") - or worse, nylon. There's also the question of brushes (and commutator plate thickness), and gauge of wire used in the windings. Cheap motors will break down more quickly, and burn out. As a kid, I used to "overvolt" cheap DC motors all the time, but they wouldn't last very long. Never burned one up, but bearing failure was common.

Heavier duty motors with better parts (especially ball bearings) can take more abuse, but it will still shorten the life of those components some. Running a 6V motor from a 7.2 volt source, though, won't cause great harm - so you might want to go that route. Another possibility, if the current needs of the motors aren't too high, would be to using a 7806 regulator (add a heatsink, though) to supply current to the motors. Something to keep in mind is to inspect, clean, and relubricate the gearbox and/or the motors themselves if possible.

Note that a cheap 9V battery won't last long (even only driving the Arduino and/or motor shield, and not the motors) - you might want to power those with something else. Note that the 7.2 volt packs I mentioned before should have enough voltage to drive the Arduino and motor shield OK, because the on-board regulator of the Arduino (7805) needs at least 7 volts to work. Two in parallel should give you enough current for your needs (though without knowing the needs of the motors and other components, plus how you define a "day" of running, I can't say for certain), and the extra voltage on the motors shouldn't cause much of an issue, depending on how they are constructed.

Lastly - what you might do is look on the motors, note their model numbers, etc - and see if you can find the source for those motors, and if the company that makes them makes a same-sized drop-in replacement that runs at a higher voltage.

smiley
Logged

I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

California
Offline Offline
Full Member
***
Karma: 0
Posts: 129
That's me, the boy with the broken halo.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

MarkT:  
I really don't think a 9v battery will be optimal for the motors regardless of MaH.

cr0sh:
I decided to use a shield because it makes my life a lot easier and I still have enough pins left for the rest of my sensors.

The toy came with a, "TYCO R/C 6.0V Jet Turbo" rechargeable NiCd battery pack (rated at 700 MaH... wiki says it would charge for 8 hours and then run for 20 minutes.)  So I'm guessing the motors run close to 6v, if not a little under that.  I don't know what the current needs of the motors are, but the battery only had .7A so that has to be the max, right?  The L293D delivers .6A according to their data sheet which is .1A under the max the old battery delivered.  If that .1A is a problem I have read that you can piggyback L293Ds to double the current if you need to.  I'm not sure what that does as far as restricting heat dissipation though.  I'm guessing it's nothing good.  Another option is to replace the L293D with SN754410 motor driver ICs which is rated for 1A which will work for sure but it doesn't have the kick-back protection the L293D does (I have no idea what that means or why it is bad).

Sorry about the ambiguity of "all day."  I hope to run the robot 8 hours a day and recharge it over night for the next day.  The motors would probably be running about half that time.  So, its duty cycle would roughly be 1/6.  I'm hoping 6v at 2450MaH would do that?

I opened up the toy and the motors don't have any markings on them at all.  The main body and the bottom look kind of like aluminum and the top is a white plastic.  Not very helpful, but looks pretty cheap.  I don't think this was a high quality toy but I think it'll make a pretty nice robot platform.  It's light, has tank style steering on four wheels but it does have a funky little gear linking the two left and two right wheels.  I just need a little help figuring out how to handle these motors.

Thank you both for the help and suggestions.

Forgot to ask.  What's the advantage of the 7.2v NiMH battery pack over 6 AA 1.2 NiMH batteries run in series?  Would I just choose whichever has the better MaH?
« Last Edit: June 12, 2011, 10:11:26 pm by Schmidtn » Logged

Phoenix, Arizona USA
Offline Offline
Faraday Member
**
Karma: 39
Posts: 5557
Where's the beer?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I decided to use a shield because it makes my life a lot easier and I still have enough pins left for the rest of my sensors.

Fair enough...

The toy came with a, "TYCO R/C 6.0V Jet Turbo" rechargeable NiCd battery pack (rated at 700 MaH... wiki says it would charge for 8 hours and then run for 20 minutes.)  So I'm guessing the motors run close to 6v, if not a little under that.

Probably so.

I don't know what the current needs of the motors are, but the battery only had .7A so that has to be the max, right?

Not necessarily. So far, we have an idea (based on the wiki entry) that the car (as an R/C toy) will run for 20 minutes on a .700 Ah battery; 20 minutes is 1/3 of an hour, so it is likely necessarily pulling 3 times as many amps as the battery will supply - or 2.1 amps. If it was only pulling .7 amps, it would run (ideally - in reality, probably not) for 1 hour. If it was pulling only .35 amps, it would run for 2 hours. See how this works?

You can almost guarantee that most of that current consumption will be from the motors (little will go toward the receiver in the vehicle). Since there are two, that means the motors are each consuming about 1 amp each (and who knows how much they consume when stalled).

What you need to do, though - to know for certain - is to measure the current draw from the motors while being run from a 6 volt (or 7.2 volt - whichever you choose) battery, while in "free running" (that is, just driving the wheels with no load on them other than the gearbox), "loaded running" (normal weight of vehicle and other components you'll use), and "stalled" (super heavy load - wheels barely turning or stopped - caution, this can strip gears!). Note: Stalled current consumption is best done using the motor alone (no gearbox), with a pony brake or substitute (a pony brake is easy to build - get a piece of wood, drill a hole in the end the size of the shaft, then cut a notch from the end to the hole along the centerline of the hole. Install a screw through the cut such that when turned, you can tighten or loosen the pressure on the shaft). You could also try to grip the shaft while applying power, but some motors can be impossible to stop (they have very high torque) - and can give you friction burns (do not do this if the pinion gear on the motor is not removable - you will be injured).

The L293D delivers .6A according to their data sheet which is .1A under the max the old battery delivered.  If that .1A is a problem I have read that you can piggyback L293Ds to double the current if you need to.  I'm not sure what that does as far as restricting heat dissipation though.  I'm guessing it's nothing good.

Seeing as how these motors are likely going to exceed the capabilities of an L293, what I am going to write won't matter much. The L293 will not likely support these motors under running load, let alone stalled (but double check the current consumption of the motors with a meter first), which means that shield won't either. If the shield supports paralleling the L293s on board, you might be able to use two shields, but even then there may be overheating under a stalled or highly-loaded condition. Without knowing the actual current consumption (and only making an educated guess as I did above from the wiki info), I can't say for certain. So once again, measure it first.

You will probably have to go with using a better h-bridge (an L298 in bridged mode will allow you almost 4 amps - there are other chips and driver boards out there as well - check out pololu.com, for example - but get your measurements first before you purchase - no sense in buying something bigger than you need).

Another option is to replace the L293D with SN754410 motor driver ICs which is rated for 1A which will work for sure but it doesn't have the kick-back protection the L293D does (I have no idea what that means or why it is bad).

Kick-back protection are simply diodes wired such that they shunt the inductive kick of the collapsing field of a coil (such as inside a motor, relay, or solenoid) to ground. The voltage of such "kickback" can be much, much higher than that of the voltage driving the coil, which can easily damage (instantly, or quickly over time) the driving transistors of the h-bridge chip. Some h-bridges have these built in, some do not. I'd advise always adding your own, using high-voltage schmitt trigger (fast acting) diodes - even if the h-bridge has them internally. Note that the L298 may or may not have such diodes in place internally (I believe the 298D does).

Sorry about the ambiguity of "all day."  I hope to run the robot 8 hours a day and recharge it over night for the next day.  The motors would probably be running about half that time.  So, its duty cycle would roughly be 1/6.  I'm hoping 6v at 2450MaH would do that?

Well, if the motors are taking 2.1 amps, and the motors are only running for about 4 hours overall, you would need at least 8.4 aH (8400 mAh) of battery supply to meet your goal; that's discounting stall conditions, and in an ideal situation. The truth is, a battery is only rated in the mAh it will give for a particular current draw (see the battery's spec sheet for details). If you go above (or below) this number, the actual amount of time you can get will change (ie - above, it is de-rated, below, pro-rated). Things will also change depending on certain environmental factors (heat being the main one - and yes, batteries get hot and change this as well!). Its also likely you will need even more than the 8400 mAh above, especially if the motors are being worked hard (under extremely loaded or close to stall conditions). Then again, you might need less - if for instance you only use one motor more than the other (but on average, probably not).

-- had to break up the post - too many characters! --
Logged

I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

Phoenix, Arizona USA
Offline Offline
Faraday Member
**
Karma: 39
Posts: 5557
Where's the beer?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

-- continuation... --

I opened up the toy and the motors don't have any markings on them at all.  The main body and the bottom look kind of like aluminum and the top is a white plastic.  Not very helpful, but looks pretty cheap.

The only way to know for sure is to remove the motor completely from any housing, so that you are holding the "bare can". The motor can itself will be metal, with a metal front where the shaft emerges. The back plate will likely be plastic (if it is metal - that's much better - but unlikely) - either off-white or black (most likely - I suppose other colors are possible, but I have yet to see such). Any markings on the motor will either be on this plate, or on the body of the motor itself. Then again, there might be no markings at all.


I don't think this was a high quality toy but I think it'll make a pretty nice robot platform.  It's light, has tank style steering on four wheels but it does have a funky little gear linking the two left and two right wheels.  I just need a little help figuring out how to handle these motors.

Well - at least this much is nice: Steering control will be relatively easy, since it is a differential arrangement (then again, accurately tracking a specific radius with a differentially steered platform won't be easy to compute - which is how such a vehicle is meant to be driven).

The "funky little gear" - without seeing a picture of it, and if I understand what you wrote correctly - is likely meant as a "differential lock-up" to keep both sides of the vehicle moving at the same speed (so the vehicle will go straight), due to differences in motor speeds. Keep this item in place (otherwise, if going in a straight line is important to you, you'll need to use encoders on both motors to make such both are turning at the same rate).

Forgot to ask.  What's the advantage of the 7.2v NiMH battery pack over 6 AA 1.2 NiMH batteries run in series?  Would I just choose whichever has the better MaH?

You want a pack with the amp-hours needed, no matter which pack it is (based on the measurement of the current consumption of the motors at the voltage they are being driven by). The 7.2 volt NiMH packs are "preferred" mainly because they exist everywhere and they have a higher current capacity (because they are generally made with sub-C sized cells, rather than AA). There don't seem to be much in the way of sub-C cell 6 volt packs, from what I have seen (but then again, I haven't looked much). If you want to stick with 6 volts (which might be advisable if the motor looks really cheap), then see if you can get some custom 5-cell sub-C sized packs made (or if you can buy them). Ideally - find out what your current consumption will really be, then have a pack built to those specifications (note that you might need to have a custom charger built to charge such a pack in a reasonable amount of time, too).

Or - change your "specifications" - your robot may not be able to run for a total time of 4 hours. I own a Roomba 570, and the pack in it is made with sub-C cells, and we only get a run time on a brand new battery of about 1 hour or so, tops. Then it is back on the charger. Of course, this is on a much heavier robot driving multiple motors and such (wheels, brushes, vacuum, etc).
« Last Edit: June 13, 2011, 12:25:10 pm by cr0sh » Logged

I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

0
Offline Offline
Shannon Member
****
Karma: 200
Posts: 11718
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
The toy came with a, "TYCO R/C 6.0V Jet Turbo" rechargeable NiCd battery pack (rated at 700 MaH... wiki says it would charge for 8 hours and then run for 20 minutes.)  So I'm guessing the motors run close to 6v, if not a little under that.  I don't know what the current needs of the motors are, but the battery only had .7A so that has to be the max, right?

No, not right!

Battery _capacity_ is not the same as current.  In fact I reckon than motor takes about 2A or so, probably takes a lot more at start up (peaking at tens of amps for a few milliseconds).

If we assume the battery discharges uniformly over 20 minutes and has 700mAh (= 0.7Ah) capacity, then the current is 0.7Ah/0.33h = 2.1A
(0.33h is 20 minutes expressed in hours).  When motors start they are effectively a few feet of copper wire and draw much larger currents until up-to-speed.  At speed a "back-EMF" is generated which nearly balances the supply voltage.  Thus initial current values can be many times the steady-running value.  This is why you don't connect electronics to a motor supply!
Logged

[ I won't respond to messages, use the forum please ]

California
Offline Offline
Full Member
***
Karma: 0
Posts: 129
That's me, the boy with the broken halo.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks again for the help and education guys.  Sounds like 6v or 7.2v will both be good and I'll look for the best MaH I can.  I was hoping not to have to change the batteries during the 8 hour shift, but if I have to I will.  Sounds like the bottleneck is my H-Bridge.  I'll look online and at pololu.com for something better.  Also need to break out the Fluke again.
Logged

California
Offline Offline
Full Member
***
Karma: 0
Posts: 129
That's me, the boy with the broken halo.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well, I'm running my robot with the old 293 H bridges and 5 1.2v NiMH batteries and it works great... for about 20 seconds.  It's really weird, so I made a short video showing what it does.



What would cause that?  If I turn it off, then turn it back on it'll run fine for another 20-ish seconds and then do it again.  Really weird.  Is that the H-Bridge being underpowered?
Logged

California
Offline Offline
Full Member
***
Karma: 0
Posts: 129
That's me, the boy with the broken halo.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

SOLVED
Another set of 293s showed up today and I piggybacked them onto the two already on the Motor Shield. 

Runs like a champ now!  Must have been a problem with Amps... just weird that it would start off working and then quit like that.  I just closed off the living room and let it run for 5-ish minutes with no problems.

Thanks again for all the help getting this running and teaching me about motors, Vs and Amps.  Now I just need to play around with and learn to do obstacle avoidance.  Back to the books!  Super happy right now! smiley!
Logged

Phoenix, Arizona USA
Offline Offline
Faraday Member
**
Karma: 39
Posts: 5557
Where's the beer?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Must have been a problem with Amps... just weird that it would start off working and then quit like that.

Not weird at all - that's the thermal overload protection on the L293 kicking in. Piggybacking another L293 on helped to eliminate the issue because the current draw was being shared (however, while this is working now, I'm not sure how long it will work in the long run - the output drivers on the L293 are (I believe) bipolar NPN darlingtons, which don't typically take well to such paralleling (whereas with mosfets you're OK).

Did you measure the current needs of the motors? If you note in the "mounting instructions" in the L293 datasheet, it reads:

The Rthj-amp of the L293 can be reduced by soldering the GND pins to a suitable copper area of the printed
circuit board or to an external heatsink.


Which pins these are depend on the package (ref the datasheet for details). Basically, what the wording means is that if you can attach a heatsink (see the datasheet for an example of a clip-on heatsink) to these pins (or provide a large enough copper pour for them on the PCB - the size of which is specified in the datasheet - best size being 35mm on a side for maximum heat dissipation), you'll be able to run the chip to its specs (600 mA for the L293D, which the Adafruit shield uses).

Now - looking at the pics of the Adafruit Motorshield here:

http://www.adafruit.com/products/81

I see a couple of issues with the board:

1) The copper pour doesn't look large enough to me (difficult to say without a scale, though - I like it that SparkFun does this in their pics).
2) The copper pour is on the -bottom- of the motorshield, where the heat generated would be trapped, at best.

So - if you measure your running current (and loaded current), and find that it is below 600 mA (per motor), then all you may need to do is add one of those clip-on heatsinks to the top of the chip. Maybe add a tiny muffin fan too, if you want.

Or leave it as-is; I can't guarantee that the L293s will survive for a long time, but maybe they will be OK. Worst case, you fry it and have to implement another solution - happens to everyone sooner or later...

smiley
Logged

I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

California
Offline Offline
Full Member
***
Karma: 0
Posts: 129
That's me, the boy with the broken halo.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I did measure the current at 0.99A at stall.  On the Adafruit Motor Shield's "Use it" page is says piggybacking the ICs will double current to 1.2A so I went with that because it's over 1A and then I'd also still have the kick-back protection.  If it starts to shut itself down again I'll heat sink it.  I didn't realize the IC was shutting itself down, I just thought it wasn't giving enough current to the motors to move them which confused me because it was moving them 10 seconds ago before it quit on me.

As for the copper question on the board, here's a quick picture I snapped.

It looks like they made most of the top of the PCB a giant heat sink and ran as many traces as they could on the bottom layer.  This must be a different version of the shield than the one that's on the Motor Shield's page in their shop.
Logged

Phoenix, Arizona USA
Offline Offline
Faraday Member
**
Karma: 39
Posts: 5557
Where's the beer?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I did measure the current at 0.99A at stall.  On the Adafruit Motor Shield's "Use it" page is says piggybacking the ICs will double current to 1.2A so I went with that because it's over 1A and then I'd also still have the kick-back protection.  If it starts to shut itself down again I'll heat sink it.  I didn't realize the IC was shutting itself down, I just thought it wasn't giving enough current to the motors to move them which confused me because it was moving them 10 seconds ago before it quit on me.

If it works, then its probably the simplest solution - plus, it sounds like your current is still greater than what the 293 could support, so piggybacking was likely the only way, short of a different h-bridge, of course.

It looks like they made most of the top of the PCB a giant heat sink and ran as many traces as they could on the bottom layer.  This must be a different version of the shield than the one that's on the Motor Shield's page in their shop.

Yeah - that looks much better than the pic on their site - seems like a much larger area, and likely works fine, as long as nothing blocks it (not sure what would happen if you stacked another shield on top, for instance).

smiley
Logged

I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

California
Offline Offline
Full Member
***
Karma: 0
Posts: 129
That's me, the boy with the broken halo.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Whenever I'm concerned about heat from a shield, I just add an extra stack header to the layers.  Not sure how effective it is, but it makes me feel better about it.

Logged

Phoenix, Arizona USA
Offline Offline
Faraday Member
**
Karma: 39
Posts: 5557
Where's the beer?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Whenever I'm concerned about heat from a shield, I just add an extra stack header to the layers.  Not sure how effective it is, but it makes me feel better about it.

Hmm - not a bad idea; I'm sure that increases the airflow greatly...

smiley
Logged

I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

Pages: [1] 2   Go Up
Jump to: