Ok, I'll preface this by saying I'm HORRIBLE with analog stuff...
I have an R3 Uno, the sparkfun Motor shield driving a pair of the pololu 100:1 high current motors. I'm driving this all off 4 AA batteries (6V). I'm basically building a mini-sumo bot.
Anyhow, since this motor shield doesn't support Phased Anti-lock PWM, I'm dealing with the problem of setting the motor to 0 causes the bot to coast a bit. This is an issue in this application because when I detect the edge of the sumo ring, I need to stop and back up and turn, but because of the coast, I'm falling off the edge of the ring.
I tried making it that when I detect the edge, I immediately slam the motors into reverse, but this causes the Uno to reboot.
Is there something I can do to either:
make the robot stop dead without the coast or
keep the UNO from rebooting when I try to put the motors into reverse???
Do I need capacitors across the motor terminals (and does it HAVE to be right at the motor, or can the caps be at the motor shield terminal sides of the wires? Unfortunately it's going to be nearly impossible to get back at the motors to try to add capacitors to them at this point.. If it is capacitors that are needed, what size and type should I be looking at???
HELP please! Need to get this worked out before the mini-sumo competition at DragonCon this Saturday night!
So, here's where I think your problem lies:
When putting the motors in reverse, they draw so much current, that your battery voltage drops significantly. This results in the UNO loosing power and reseting.
And since you don't have breaks on your wheels, reverse breaking is really the only option I can think of right now.
A possible solution:
Try a (rather) large capacitor connected to the 5V and GND of the UNO. That will buffer the UNO's supply, while the battery voltage drops. You could put the cap on the battery, but I suspect you'll have better results with buffering the UNO's supply.
You could break the motors by shorting the terminals, but as far as I've seen, the L298 doesn't support that and adding that feature is more work than 1 cap.
I'm starting to realize that that motor shield is an utter POS... I'm going to try splitting the power so the Uno and the Motor shield are using separate battery packs. Hopefully I can figure out how/where to cut the traces on the board to do that....
With only 6V total from the 4AA's, it just seems like teh second the Motor shield needs extra power, it causes the spike which browns out the Uno, which really wants 7V anyhow.
You could always use a 9V-battery for your UNO. Just bend the Vin-pin from the shield aside or cut it off. That way you have 2 separate sources for powering the UNO (9V-battery connected to the UNO-board) and the shield (your 6V-battery pack connected to the shield board).
Pillager:
You could always use a 9V-battery for your UNO. Just bend the Vin-pin from the shield aside or cut it off. That way you have 2 separate sources for powering the UNO (9V-battery connected to the UNO-board) and the shield (your 6V-battery pack connected to the shield board).
Greetings
Tom
The motorshield I have has terminals for external power and a jumper to chose how to power your motors, via arduino or via the terminals. But I have the a similar problem, when I power the shield via an external battery the battery cuts power as I reverse both motors at the same time. Though I can reverse them one at a time without issue