Let's Make Robots!

Homebrew Servo Controller Issues

Hi,

I've been developing my own serial servo controller for the hexapod I'm working on, using a Microchip PIC16F74.  It accepts serial input and controls up to 20 servos. The servos are connected in ports A, B and D.  Power for the PIC is from a 9v battery via a 7805 regulator.  The servos have a separate power supply from a 6v battery pack.

The problem I'm having is that the PIC seems to brown-out when the servos are running.  Powering from the 9v battery I get random behaviour, powering directly using the Microchip PICKIT2 programmer isn't possible as the programmer turns itself off complaining about a power issue.

I can't see why the PIC is having power issues when all it's supplying is the pulse?  Running anything over Port A seems to work fine, in a few cases I have the PICKIT programmer fail with just a single servo connected to the board on Port B.

Below is the simplified schematic of the board; I removed the TTL-Serial chip etc... Can anyone offer any thoughts as to why I'm getting this behaviour.  Thanks.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Depending on the servo, the pulse input may draw excessive current or have noise on it. Try adding a 220 ohm resistor in series with the pulse signal on the servos and see if the brown out keeps happenning. If you are driving 20 servos, you probably have more than one pulse active at a time.

How many servos are you actually running, and where do they get their power from ? A 9V battery can only supply ~40mA before the voltage starts to drop.

Thanks, adding the resistors seems to have made all the difference.  Quite a royal PITA to retrofit the SMD resistors, but worth it.

I'll try the resistor.  I'm powering the servos from a dedicated 6v battery. I'm pulsing the servos one at a time at the moment, no fancy timing or control . I'm driving 12 servos.

I always put a small ceramic capacitor between VDD and VSS  on all the chips in my circuits to both filter noise and to supply peak current to the chip. I hope this helps.

Thanks. I've got the 22uf electrolytic on the inside of the 7805 to try and handle that.  Are you thinking it might be worth having something else?

The problem with electrolytic capacitors is that they are not very good at supplying peak current.

My experience it always to put one across the supply of each chip and preferably as close as possible to the powersupply pin on the chip.

It's always a good idea to add .1uF caps on the power supply as close to each IC as you can.

Thanks for the input.  I removed what I felt was superfluous information from the schematic, probably shouldn't have done that.  MCLR is connected to Vdd via a 1n4001 diode and 100k resistor for ICSP programming.

I will try connecting the Vdd and Vss pairs together.

Thanks,

I've noticed that you've got a Vdd, Vss and your !MCLR line disconnected. It's better to have your Vdd lines tied together, and the same goes for Vss.

Depending on your !MCLR config settings, the free floating !MCLR pin could be the source of your device's erratic behaviour. What's your config word set to?

My config word is _HS_OSC & _WDT_OFF. I'm using a 20mhz crystal.  I'm programming in SourceBoost BoostBasic. While I can do rundimentary assembly the logic for this is a bit beyond my scope. I'm a high-level OO programmer (Java and C# primarily).