Wow, 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