I'm in the process of designing and building a mbed based robot. All sensors (anti collision, linefollowing, temp, light and sound) work fine.
Now my problem: Whenever I connect the mbed and two motors (using an h-bridge, tried L293 and L298) to the same powersource the mbed keeps resetting during startup. With one motor connected all works fine. In the past I build the asuro robot and the probot-128 both available at Conrad. These robots are AVR based and use the same motors as I do and also the same powersource (4 AAA 1.5V batteries). Voltage is limited using a 1N4007 diode with a forwarding voltagedropt of 0.8 volts. Both the Asuro an ProBot-128 work fine using two motors.
Why is the mbed so sensitive for current peaks (I assume that's the problem), and is there a solution?
lesson one, motor plus micro on the same power supply = bad news.
second, diagrams help debuging, people know whats connected to what..
take the four batteries, and power the mbed straight from them, its internal voltage regulators will cope with up to 9V. (technicaly more, but heat is an issue, stuff melts) I normally feed it 5 volt from a L7805, as I often need a 5 volt line, and use 12 or 7.5V lead acid (car) batteries. they can cook things so kinda worthwhile doing, L7805s cost ~£5 for 25 posted, mbeds are ~£50, go figure.
if your dropping the voltage to the mbed to about 5.2V, using 4 1.5V batteries, once they start discarging the voltage will drop, and the regulators cut out. if the motors draw a lot of current on a change, the voltage over the battery drops as there is a delay in response, this is sufficent to cause the mbed to reset. this potentialy generates a while one loop of reset, start motor, cut out reset.... the fact it works with one suggest this is a likely cause.
another thing, most rechargeable AA and AAA batteries are 1.2V, which gives, 4.8 V. the mbed may work partialy at less than 4.5V, but not very well, as the regulator can't cope with the low drop.
if thats confused you, welcome to the unsimple world of power supply. you will need to do reasearch.
What happens is that the currrent drop exceeds the amount available from your power supply (perhaps even shortly - during a startup spike) and that drops the power and the device resets. It comes back on - the motors draw power again - and the cycle repeats.
If you are pretty sure the power supply can power the motors (just connect them directly and measure the voltage) - and that your wire from power supply to motors are thick enough - then start by adding a (largeish) capacitor to buffer these startup peaks. Or having a decent capacitor on/near the CPU - with perhaps a diode in the + to the CPU after the motor feed - to stop the capacitor getting emptied by the motors.
A more common and robust solution though is to power the CPU from a different supply than the motors.
Dear Dirk-Willem. and Christopher,
I know that using a seperate powersupply is the safest way, but I'm designing a robot for my robotics class I teach. A design request is to keep it as simple as posible and as cheap as posible. The robot is just a small one. You can look at my first design using a 9V battery at http://www.youtube.com/watch?v=oKT9iGbhxLo .my new design is even smaller.
The new design is using one half of a Euroboard. It will have two or three levels. Main purpose of the robot is to teach students the c++-programming language in a practical way. In class the robot will have to follow a line, avoid obstacals and find a lightsource. I know that there are several commercial robot kits but its a lot more fun for students to build one themself using prototyping. With the mbed they can start designing and testing the sensors and after that assemble all to a complete robot.
The motor part is the one thing that I want to build for them to save time and because its the more difficult one (as I discovered).
I'm using 4 AAA 1.5 Volt batteries but designed the powersupply in a way that it also can take the 1.2 V rechargeables (just a simple jumper to shorten the 1N4007). This powersupply is more than sufficient for the motors, I tested it by running two motors for several minutes. In this way I can keep the total cost for the robot below 85 euro's.
I did inserted a 1000 uF capacitor directly to the Vin and GND from the mbed. and now it works fine. I didn't have time to fully test it but I'll keep you posted.
Thanks for your advice.
Please log in to post a reply.
mbed, the fastest way to prototype with ARM based microcontrollers.
^ back to top