Herbert The 4WD Arduino Robot

First Hurdle

Hi Guys,

I’ve just run into my first hurdle! Let’s see…I’ll take a deep breath and try to explain what is going on, lolzors…

 

I built the AdaFruit motor shield yesterday. For you Arduino fans out there it’s a little board that plops right on the Arduino and has two H bridges and a latch IC and can control all 4 of the DC motors at one time. So, I found time to wire it up and test this afternoon and it’s giving me problems. I’m guessing it’s something to do with current, but I’m not sure because Herbert was running fine for short periods of time just using transistor circuits and a 9 volt battery…

Here is some sample code I have been trying:

#include <AFMotor.h>


AF_DCMotor motor1(1, MOTOR12_64KHZ); // create motor #1, 64KHz pwm

AF_DCMotor motor2(2, MOTOR12_64KHZ); // create motor #2, 64KHz pwm
AF_DCMotor motor3(3, MOTOR12_1KHZ);
AF_DCMotor motor4(4, MOTOR12_1KHZ);

void setup() {

motor1.setSpeed(250); // set the speed to 200/255
motor2.setSpeed(250);
//motor3.setSpeed(250);
//motor4.setSpeed(250);
}

void loop() {

delay(2000);

motor1.run(FORWARD); // turn it on going forward
motor2.run(FORWARD);
//motor3.run(FORWARD);
//motor4.run(FORWARD);
delay(4000);

motor1.run(RELEASE); //Stop
motor2.run(RELEASE);
//motor3.run(RELEASE);
//motor4.run(RELEASE);
delay(2000);

motor1.run(BACKWARD); // the other way
motor2.run(BACKWARD);
//motor3.run(BACKWARD);
//motor4.run(BACKWARD);
delay(4000);

motor1.run(RELEASE); // stopped
motor2.run(RELEASE);
//motor3.run(RELEASE);
//motor4.run(RELEASE);
delay(2000);
}

 

I can’t run all 4 motors at once, they don’t move at all…I can run two at a time but they are weak, very weak. I tried D Cells in series (9volts), AA in series (12 volts), a 6 volt lantern battery…weak weak weak…motors 1 and 2 run okay forward but in reverse they are like malaria victims or something, heh. Motors 3 and 4 can only run at 1 KHZ so they are like chronic fatigue patients…nooooo umph!

 

In the videos above I powered all 4 motors from 1 9 volt battery and everything was fine…oh, by the way…all batteries I tried were brand new and I put new batteries in the Minty Boost for the Arduino and I even tried powering the Arduino from the computer’s USB just to rule out some weird, weak signal from the motor board…

A big, big HMMMMMMMMMMMMMMM! Any ideas?

 

Annie :slight_smile:

Overloaded driver? Not the

Overloaded driver? Not the correct power source?

Anyways, here are the specs for the motors. (at least that’s what the guys at Seeed studio tell me for their 4WD platform)-

Green Motor

• Gear Ratio 1:120
• No-load speed(3V):100RPM
• No-load speed(6V):200RPM
• No-load current(3V):60mA
• No-load current(6V):71mA
• Stall current(3V):260mA
• Stall current(6V):470mA
• Torgue (3V): 1.2Kgcm
• Torque (6V): 1.92Kgcm
• Size: 55mm x 48.3mm x 23mm
• Weight:45g

Yellow Motor:

• Working Voltage:12V
• DC Motor: 10300 RPM
• Gear Ratio:1:48
• rpm@6V: 200 rpm
• rpm@12V: 400 rpm
• 0.55 Kgf.cm torque (6V)
• 0.95 kgf.cm torque (12v)
• No-load current = 71 mA,
• Stall current = 680 mA
• Weight:32g

 

Try to set the speed at 255
Try to set the speed at 255 (max) to emulate a direct connection to the battery. See if that improves things.

Adafruit Motor Shield

Hi Annie,

Are you running the motors off the Arduino Power supply or off the Adafruit Shield’s External Power terminal block?

Mark

Hi Mark, I’m running the

Hi Mark,

 

I’m running the batteries are connected to the ext pwr block…maybe I have bad soldering somewhere?

 

Annie

Hi Robot X, I was trying at

Hi Robot X,

 

I was trying at 250…but I’ll pump it up to 255 and see what happens! Also, I’ll just try one motor at a time to see if they all work okay on their own…then I’ll know something is up somewhere else…:slight_smile:

 

Annie

Hi Dent, Thanks for the

Hi Dent,

 

Thanks for the info…! :slight_smile: I had actually found it and posted above your post yesterday…but I realllllly appreciate all the info possible!

 

Annie :slight_smile:

Well Guys, I’m at a loss to

Well Guys,

 

I’m at a loss to understand what is going on with the motor shield. I’ve checked my wiring, checked all of the different batteries that I’ve tried just to test it( see above) and this morning I commented out the code so I only tested 1 motor at a time. It is acting weird and gutless…on the Adafruit tutorial it mentioned puttinga .1 uf cap across the motor to guard against noise in the circuit, that didn’t help.

Is it possible that the H bridges in the motor shield aren’t powerful enough for my motors? On the Adafruit website it says:

 

“Note that the H-bridge chip is not really meant for driving loads over 0.6A or that peak over 1.2A so this is for small motors. Check the datasheet for information about the motor to verify its OK.”

 

I don’t really understand all the data above (in this post) about the motors…all the current ratings frighten and confuse me, I’m just a cave girl… :slight_smile:

 

Bottom line: I’m going to buy some nimh rechargeables tomorrow…then I can rule out the batteries once and for all! In the mean time I am going to put my breadboard Darlington transistor circuits back onto Herbert so I can at least drive the motors forward while I work on the code for the ping sensor eyes…the motors work great (for short periods of time) with a 9 volt battery through the Darlingtons.

 

Question: Has anyone ever heard of a BA6886N motor driver chip? I have one and I was wondering if I should make my own motor controller board with 4 of those…just a thought!

 

Annie :slight_smile:

Jumper?

Just a thought because I often overlook the obvious when doing a debug. When you wired your shield for external power did you remove the jumper?

Have not heard of your motor driver chip. I have used the L293D and The SN754410 chips. I should have posted earlier about the chip sockets. You could have borrowed the L293D chips on your shield.

 

Hi Gary,Yeah…I took off

Hi Gary,

Yeah…I took off the jumper before even starting the whole thing :frowning:

 

I was just going through the component section of Let’s Make Robots and they link to a dual motor driver that may work for me (I’d need to buy 2 of course) if the motor shield doesn’t work out…

 

TB6612FNG Dual Motor Driver Carrier

 

Sorry about the font size, lol…

 

Annie

 

Transistor saturation voltage loss and switching frequency

One possible culprit is the BJT transistors in the devices. I don’t know what Darlington had been used initially, but a datasheet for a TIP102 shows a 2 volt loss across the transistor when saturated, the Vce-sat spec. An L293D datasheet shows a possible 1.8 volt loss across the upper sourcing transistor, as well as a possible 1.8 volt loss across the lower sinking transistor for a total of 3.6 volts possibly unavailable for the motor, from the supply voltage. So initially, the motors were running on 9 volts - 2 volts or 7 volts, and with the L293D they are trying to run on 5.4 volts. Note also that the ST datasheet mentions a maximum switching frequency of 5 kHz. It might be rounding or cutting the output even further if trying to PWM too fast. Other manufacturers L293D devices will probably have similar limits. I believe the SN754410 can be switched much higher, but still has the BJT saturation losses.

If using the TB6612FNG device, the losses would be minimized as it appears to use FET transistors rather than BJT. The TB6612FNG datasheet shows a 0.5 ohm on resistance, which would amount to a loss of only 0.3 volts at 600 mA of current used.

The other driver, BA6886N datasheet appears to be a BJT device with higher possible losses (up to 3.3 volts)

Ok, just re-read your description, and am not that sure that transistors are the culprit, as voltage levels were changed without much change in drive results. So maybe it is the type of batteries, may be that everything will work better with NiMh rechargeables that can deliver more current (for all 4 motors at once) Could be a combo, the motors drawing down the batteries and the driver taking more volts away. Also was thinking of the MintyBoost, it will try to actively maintain a higher voltage level, where a battery will passively reduce voltage at higher current draws. Interesting situation to think through.

**Oh shoot, sorry! didnt see! **

Oh shoot, sorry! didnt see!

Another approach for driving

Another approach for driving larger motors is to use relays instead of an IC based H-bridge. Then you can switch power to the motors directly from the batteries.

An example designed and sold by DAGU is here, but you could make one yourself if desired.

Motor Test

Hi Annie,

Just wired (4) motors to the AdaFruit Motor Driver, plugged it into my Duemilanove. I pasted your code in a new program and connected (4) AAA size NiMH rechargeable to the Motor board. All (4) motors ran and the program worked perfectly. I did not have the same motors as you but everything worked as expected. I feel either you have a solder error or the motors draw more current than the L293D chips will pass.

While your motors ran did the chip get hot??

Did you check whether the gearboxes turned freely?

Even with the Yellow motors the stall current is 680mA x 2 = 1360mA = 1.36 amps thru each chip. This exceeds the chips rating of 1.2 amps but that would only happen at full power while stalled.

Maybe you would need a L298 based motor driver but it just don’t seem like it.

Hi Gary

Hi Gary,

Sorry for the long delay in replying, my computer took a dive and I"Ve been doing computer repair for the last week. Back up and running now! Thanks so much for testing you motor shield with my setup! I really appreciate it. Now, I did check my motor shield under a mag. glass and couldn’t see any problems…doesn’t mean there aren’t cold solder joints or something, but I sure can’t see 'em…

My chip doesn’t get hot when the motors are running…oh and just to rule out battery issues, I bought a bunch of nimh rechargeable C batteries…12 volts, I still had the same problem. So, the next step is to try some wimpy hobby motors I have and see if they work with the shield. If they do, then I’ll know that the shield just can’t handle the motors on my chassis…which is no biggie, I will find a use for it working on something else, heh…

I will update later today, I put my transistors back in to run the motors so I could start learning the ping sensor…I just have to edit some video and it will be up!

Thanks again for all your help!

 

Annie :slight_smile:

Regarding your collision
Regarding your collision avoidance testing, did you try using something with a large flat surface like a book or the flat of your hand? Herbert’s slow response to the obstacles might be due to the relatively thin and curved surface of the Christmas paper tube.

this is pretty cool, if you

this is pretty cool, if you need and coding help just pm me; also you should check into Liquidware’s lithium backpack for arduino, it screws right into the arduino and can be charged via any micro-usb connection(phone chargers) and it also charges when you connect the usb cable to the arduino, i have it and it is pretty sweet.

 

remember, a better power supply does not fix bad circuitry(i found out this the hard way)