Maker Pro
Maker Pro

One battery driving R/C motors and a PIC uController - how?

  • Thread starter Matthias Melcher
  • Start date
M

Matthias Melcher

I have built a servo controller around a PIC Microcontroller. The servos are
pwered by a 6V NiCad battery pack that also powers the PIC through an
LM1117 (neither 5V nor 3.3V work reliably).

Unfortunatly, as soon as I get some load on the servos, the PIC resets due
to the poer drop.

How can I make sure that the PIC will always get sufficient DC, so it won't
reset?

Adding a separate battery for the PIC is not an option (space constraints).

Any help is greatly appreciated.

Matt
 
F

Frithiof Andreas Jensen

Matthias Melcher said:
Unfortunatly, as soon as I get some load on the servos, the PIC resets due
to the poer drop.

Either Your wiring is wrong or your Servos are noisy, assuming that the
battery is actually capable of delivering the current!

1) The wiring must be separated into a Power and a Control network, the
power and return nets, for the micro and the servos meeting only at the
battery.

2) You may want to filter the servos with an RC network across the terminals
on each.

3) You may want to isolate the micro from the servos using
relays/optocouplers.

3) is if 1 & 2 does not work.
 
J

James Meyer

How can I make sure that the PIC will always get sufficient DC, so it won't
reset?
Add a switching DC-DC converter between the battery and the regulator to
raise the battery voltage so that the input to your LM1117 doesn't drop below a
value that it can regulate well at. The PIC doesn't require much current so a
switched capacitor voltage doubler like the ones from Maxim should do the job.

Jim
 
L

Luhan Monat

Matthias said:
I have built a servo controller around a PIC Microcontroller. The servos are
pwered by a 6V NiCad battery pack that also powers the PIC through an
LM1117 (neither 5V nor 3.3V work reliably).

Unfortunatly, as soon as I get some load on the servos, the PIC resets due
to the poer drop.

How can I make sure that the PIC will always get sufficient DC, so it won't
reset?

Adding a separate battery for the PIC is not an option (space constraints).

Any help is greatly appreciated.

Matt
This sould not normally happen. Try filtering the power to the PIC and
running it at 4Mhz. This should allow the PIC to keep running down to 2
volts.

If the voltage falls below 2 volts when the servos run, your battery is
defective.
 
You need to isolate the pic's power from the servo power. The servo
motor is a short when it is stationary and so it kills the power supply
long enough to reset the pic.Put a diode in series with the supply to
the regulator and a small cap (try 10uf) from the diode cathode to 0v.
 
M

Matthias Melcher

Thanks for all the help from the NG. So putting it all together, I got it
checked in the skope and working! Yeah!

So here's a summay:

Problems:
- regulating 6V down to 5V is a bad idea, because of voltage drop.
- running up to 24 servos simultanously on a walker robot puts huge strain
on the battery, each servo sucking up to 1Amp!
- noise!

Limitations:
- due to space and simplicity in the charging unit, it is not possible to
have a second battery

Solutions:
- the voltage regulator runs through a filter, then a low drop diaode, then
a cap, then the regulator, then two more caps
- Connect the regulator as close to the battery as possible, don't run the
lines by a few motors first (stop thinking digital! Wire is always a
resistor and a cpacitor!). Clean up the layout!
- Worst case, use a switching regulator that even pumps 3V up to 5V if need.
- a 300Ohm resistor on every servo data line in series keeps the noise from
the servos to the PIC low (not neede for digital servos)
- 3k pullup on the servo data line keeps the servos from jerking all at
onece when power is switched on
- I change the software to send pulses to the servos in groups of 4 with 2ms
delay from group to group, so that there is only on high load (leg) servo
per group. This spreads battery load over the 20ms cycle.
- with digital servos, the load on the battery is even greater. On the other
hand, they are happy with 3.2V pulses. So in that case, I use a 3.2V
regulator which runs more stable on 6V battery anyways.

Problem solved! Thanks for all the help!!

20uH +---+
Bat ---UUUU---|>|--o--|reg|--o---o--> pic
| +---+ | |
=== | === ===
470uF| | 10u| |.1uF
GND ---------------o----o----o---o--> GND
 
Top