1
\$\begingroup\$

I'm trying to power 2 DC Motors and 18 Micro Servo Motors with a microcontroller as a kind of Arduino-like board. Any help would be very appreciated! I'm looking for opinions on my current plan and improvements on it, particularly how I can power the servos.

All motors may stall and I'm unsure how to avoid the microcontroller browning out or the motor overheating.

I am hoping to use 6 AA batteries giving 10v to 6v (depending on remaining power and the type of battery used). However this may not be possible.

The 2 DC motors are 2A max, 5v.

The 18 Servos are Tower 9g, 5V and are aprox 500mA max.

2 DC Motors

I am planning to use PWM on the motor driver to allow me to run 5v DC motors directly from the power source. The microcontroller can read the input power and adjust the PWM on the DC motors accordingly to prevent running them past the specification. I am under the impression that this should be OK provided the PWM ratio is the correct equivalent. This prevents the need for a buck converter.

By using current sense resistors a stall condition in a DC motor can be detected and if it continues the motor can be powered down or the PWM reduced. A diode and capacitor can be used to provide power to the microcontroller until it has time to power down the DC motor.

Does this sound like it will work for the DC motors?

18 Servos

For the servos I'm very unsure what to do. 18 current sense resistors and ADC pins seems excessive and servos take a long time to stop after PWM stops (at least 20ms, likely far longer), so the same plan won't work.

Is it possible to simply current limit each servo's power with a resistor? I worry that the servos would then no longer be able to start (as this is similar to a stall condition). Perhaps a capacitor could be included after the resistor and short pauses be added to the servo movements to allow the capacitor to recharge to allow a kick-start from stopped?

Am I approaching this problem entirely wrong?

All opinions appreciated! Thank you.

\$\endgroup\$
  • 1
    \$\begingroup\$ Welcome to EE.SE! Please look at the FAQ on Asking so you can improve your question. Of note, you don't want to be asking for opinions on this site. Looking at your situation, AA batteries don't seem to be a good fit for your high-power application. Rechargable lithium-ion packs may be more suitable for power capability and reusability. \$\endgroup\$ – user2943160 Sep 5 '16 at 0:08
  • 1
    \$\begingroup\$ @user2943160 - actually rechargeable AA's do quite well at high drain currents and more natively match RC hobby servos anyway. Power and energy are not the same thing. \$\endgroup\$ – Chris Stratton Sep 5 '16 at 2:17
  • \$\begingroup\$ Run your MCU at 3.3v volts or even 3v and you'll have quite a bit of headroom. If you set things up with a large capacitor for the MCU that cannot backfeed the motors, you should have time to stop commanding them before the MCU drains it. It might be interesting to see what a polyfuse per servo would do but I wouldn't count on it without experimental evidence. \$\endgroup\$ – Chris Stratton Sep 5 '16 at 2:22
2
\$\begingroup\$

If you use standard AA batteries then their limit is about 2A, but you have 2 * 2A motors + 18 * 750mA (peak) servos for a possible maximum of 17.5 Amps. This isn't likely to work well. Rechargeable cells can be a bit better (eg. Eneloops are good for ~6A peak). They should be either soldered/welded together or put in a battery holder with flat contacts. Don't use a holder with coiled spring contacts, as these have high resistance.

You need some way to prevent the inevitable battery voltage sag from affecting the microcontroller. If you must power everything from the same battery then use separate regulators, with an isolating diode and large reservoir capacitor on the MCU side. This should allow for short battery voltage dips while the motors and servos are operating. The circuit would look something like this:-

schematic

simulate this circuit – Schematic created using CircuitLab

If you use a switching regulator to supply 5V to the motors and servos then battery current will be reduced, and the motors will run more efficiently because you can use higher PWM ratios. To keep peak current down try to avoid starting both motors at the same time, and move the servos alternately rather than together.

If your motors are rated for 2A max then they probably draw more at startup. Current limiting should work provided that it is done in true real time, ie. the motor must be switched off the instant current goes above the limit (within a few milliseconds). Limiting servo current probably won't work because the servo's control loop will be upset and it won't move properly (expect jittering and/or poor resolution).

\$\endgroup\$
  • \$\begingroup\$ Thank you. This is very helpful! Why does the capacitor go before the regulator and not after? How could I run the servos alternately? They're 50Hz so need at least 0.1s to stop after signals stop being sent. Would it make sense to attach even numbered servos to one MOSFET and odd numbered to another to power them down and alternated quickly (and to stop if at risk of brown-out)? Other batteries are a possibility, but if I ever want to make this into a commercial product it's inconvenient and annoying to spend an extra $15 on batteries and a charger for them. \$\endgroup\$ – Shanee Vanstone Sep 6 '16 at 11:48
  • \$\begingroup\$ Voltage on the capacitor drops as it discharges, but so long as it stays above the regulated output voltage the regulator can still work. If placed after the regulator there won't be enough input voltage for the regulator to work on, and the (now unregulated) output voltage will drop as the capacitor discharges. \$\endgroup\$ – Bruce Abbott Sep 6 '16 at 17:17
  • \$\begingroup\$ Your servos only draw one burst of current per signal pulse, and it goes for less than 20ms (so even at 50Hz there will be a gap between each burst). If you interleave servo pulses then the current bursts will also interleave and reduce the peak power supply current. HXT-900 (= Towerpro SG-90) current draw waveform bhabbott.net.nz/Servo.html \$\endgroup\$ – Bruce Abbott Sep 6 '16 at 17:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.