![]() |
|
|
|
|
|
|
|
|
|
Simple Robotic Power Supplies |
|
|
|
Power Supplies for small robots aren't difficult
- but they aren't trivial either! |
|
<= The usual small robot supply. In the usual battery powered servo motored robot power supply, the current comes from the battery through a voltage regulator and into the processor and other electronics. The voltage drop across the regulator is the battery voltage minus whatever is needed by the electronics. Let's look at some examples. 6 new alkaline batteries = 9 volts (approximately) Processor and electronics need = 5 volts (usually) Regulator voltage drop = 4 volts. A 7805 type regulator needs about 2 - 2.5 volts across it to keep in regulation. It is worth it to think about the power dissipated by the regulator here too. If we are drawing 500ma, the regulator will dissipate 2 watts (0.5A * 4V). If we have a TO-220 package (the big one with a tab), it will dissipate about 2 to 4 watts without a heatsink at room temperature. When using a heatsink, TO-220 packaged parts can handle a lot more depending on the type of part and the heatsink chosen. So far, so good. That was easy! But let's look a little more closely. <= Don't batteries drop in voltage as they are used? Our 6 cell battery will discharge as we use it. The voltage goes down as it discharges. Normally devices are designed to get full useful life from the battery by assuming the cells discharge to 0.9 -1.0 volts each. That means our 9 volt battery is now 5.4 to 6 volts at end of life! Clearly the 7805 regulator will not give very good battery life in this application since it starts to go out of regulation when the battery has dropped to only 7 volts. What are we to do? Use a 12 volt battery? That would work but the power wasted in the regulator will be getting very high. A better solution is to use a "Low Dropout Regulator" also known as an LDO. The LDO works with a lower voltage across it before it stops regulating. A popular example is an LM2940-CT-5.0. It is an LDO that fits into the same socket as a 7805 but has can still regulate with less than 1 volt across it. Now our 6 volt output from the 9 volt battery is enough to still get 5 volts to the processor. <= Motors are noisy! Problem solved? Well, not quite. Motors draw current in spikes or pulses. This tends to cause noise on the battery lines and, if the servos share a regulator with the processor and other electronics, the motor noise can cause problems with the electronics. To get around this, many people connect the servo power directly to the batteries without using the regulator. This helps the electronics but can be a problem for the servos, which are typically rated at 6 volts maximum. A set of 6 fresh batteries with their 9 volt output might damage the servos. Some designers use 2 battery packs to solve this issue. A higher current low voltage pack for the motors and a higher voltage lower current battery for the electronics. This can be a very practical solution if the motors are other than hobby servo motors. It is usually too awkward for robots powered by hobby servos. <= Are 4 cells enough? One power supply commonly used is 4 cells for the battery and an LM2940 for the regulator. That battery is fine for powering the servos but the battery life for the processor is not what it should be. At end of life for the batteries they only put out about 4 volts. That input can't give 5 volts out from even an LDO regulator! What happens? The regulator limits the maximum voltage to the electronics to 5 volts when the battery is high enough. As the battery voltage drops, the regulator gives its best but the motor noise on the battery comes through and the output voltage drops. This gives a very poor 5 volt supply. Some processors can work in this environment so the manufacturers get away with it. This noisy power supply can cause other problems as well. Many common A/D converters reference their readings to the 5 volt supply. That means, even if your sensor can tolerate the noise and still give stable readings, the A/D will give noisy values! Our brownout disabled Co-Processor works fine with a noisy supply. Just remember, the A/D is referenced to the 5 volt supply, so you will get different readings from the same input voltage as the supply changes. <= We like 6 cells. In our Libby, we used a 6 cell battery pack and separate regulators for the electronics and the servos. That protects the servos, gives the electronics a clean 5 volt supply, and still gives the best battery life. A side benefit is that you can use a 9 Volt DC adapter for debugging your code since the servo regulator protects the servos from the high adapter voltage. Adapters are rated for their output voltage at their maximum rated current. The actual voltage can get very high when the adapter is lightly loaded. I just measured a 9 volt 500 ma adapter at 12 volts output while running a Libby board without servos. The output was 13.5 volts with no load! You can see why manufacturers normally warn you about running servos from DC adapters. Even with Libby you have to watch that the servo regulator doesn't overheat from the power dissipated in the regulator. We have a heat sink on the regulator but there are still limits. If the regulator overheats, it will shut down. Nothing will be damaged, just wait until it cools to try again. <= Schematic Diagram Here is our 2p40 based Controller Board's schematic (2 pp - PDF - 69 KB). Notice the power supply on sheet 2. <= Upgrade to an LDO? If you are upgrading a power supply to an LDO you have to make sure you have enough output capacitance. 7805 style regulators don't need capacitors on their output pins. 0.1uF bypass caps on the input and output are nice for noise reduction but they are not critical for stability. LM2940 regulators like most LDO type regulators need a minimum output capacitance. In the case of an LM2940, the value is 22 uF. You can increase it as much as you want but don't go below that value. 100uF to 1000uF are common values. The 0.1uF bypass caps close to the input and output pins are still good practice as well. If you know about capacitors in parallel, you might wonder how 100.1uF is any better than 100.0uF. The reason for the separate 0.1uF capacitors is their high frequency performance. Large caps don't work as well at high frequencies so the little caps actually improve the response. <= Rechargeable batteries. What if you want to use NiCd or NiMH rechargeable batteries? Nominally a NiCd or NiMH gives 1.2 volts during most of its discharge curve. The 6 cells now only give 7.2 volts. The good news is that their discharge curve is very flat and they are still discharged at about 1 volt per cell. If you designed for long battery life in the first place, you can use rechargeables in the same circuit. The charger can even be as simple as a single resistor from a lab supply. By the way, adding a fifth cell in series and converting to NiMH or NiCd cells can really help a 4 cell battery supply robot. The fully charged voltage is just over 6 volts so most servos should still be ok. <= Reset Issues and Brownout. Power supply problems show up in poor battery life or sometimes weird resetting or system behavior issues. An important part of any power supply is the reset circuit. That is what is supposed to start the processor(s) cleanly after the power is restored. Because our Libby power supply is so solid, we enabled the brownout protection circuit in our Co-Processor. This resets the Co-Processor whenever there is the slightest glitch in the supply voltage. It means we don't need a separate reset wire to the Co-Processor. When we tried to use the same Co-Processor in a 4 cell supply robot, we had the Co-Processor resetting constantly after the batteries started to discharge. The rest of the robot tolerated the supply noise but the supply noise and repeated brownout was constantly triggering Co-Processor resets. Since we want you to be able to use our Co-Processor with your robot, we now offer a separate Co-Processor. The only difference is that the brownout detection is disabled. It will still work with supplies that jump around. However, we recommend you add a separate reset connection to the system. See the schematic (1 pp - PDF - 47 KB) of our AppMod connector design. The Co-Processor reset is on that design is Stamp output P12. That line can be driven low then high at the start of the program and all will be well. Keep that line high during the program or you will reset the Co-Processor again. If your controller board has a reset circuit that can be shared - all the better. Reset is available on our Co-Processor board as well. Here is the schematic (2 pp - PDF - 23 KB). |
Blue Bell Design Inc. Post Office Box 446 Gwynedd Valley, PA 19437-0446 USA 215-643-7012 email us harry@bluebelldesign.com on the web www.bluebelldesign.com |