PDA

View Full Version : motors browning out PIC



mbw123
- 2nd November 2006, 01:44
I have a PIC16F628A connected to an H-bridge with two medium size motors connected to it. I have figured out that the PIC is being browned out by the motors. I understand I need capacitors somewhere on the circuit but I don't know where to put them or what size capacitors I should use. I know I could put them on the motors themselves and the PIC, but exactly where, I don't know. Any help is greatly appreciated!

-Mike

Charles Linquis
- 2nd November 2006, 02:05
I have had great success by feeding the PICs VCC (and MCLR) through a low voltage drop Schottky diode. On the PIC side of the diode, I use a 10uF tantalum and several .1uF ceramics.

This has worked well for me in critical military applications controlling hundreds of amps.

sayzer
- 2nd November 2006, 08:40
Hi Mike,

If you are using MCLR, can you not use it?
If it is a must, what is the resistor on MCLR, 4.7K, 10K?

Also, why not turn off BOD ?


Edit: I have a similar application with heavy DC motors, same PIC as yours. BOD_OFF, MCLR_OFF. No reset whatsoever.


----------------------------------------

Acetronics2
- 2nd November 2006, 10:06
I have a PIC16F628A connected to an H-bridge with two medium size motors connected to it. I have figured out that the PIC is being browned out by the motors. -Mike

Hi,Mike

THE stupid question ...

Can your supply withstand the two motors " no-rotation current draw " ???

Alain

mbw123
- 5th November 2006, 23:37
Sorry for the late response.

What is BOD?

I don't need the MCLR, so I can probably turn it off. Won't the power be drawn from the PIC and restart it anyway? I mean, if there is no power to the PIC when the motors turn on, will it restart? Or the motors will not draw all the current?

Thank you very much for the responses.

-Mike

Charles Linquis
- 6th November 2006, 01:22
That is why the approach I have suggested (Schottky diode and capacitor) works. The motors can pull the power supply to zero volts for a very short time, and the PIC keeps on running due to the energy stored in the capacitor.

I had an application where the power supply dropped to under 0.5V for 10 milliseconds. After I added the diode and the caps, the circuit worked perfectly.

sayzer
- 6th November 2006, 06:19
Hi Mike,

In that case, use these settings if you can and remove MCLR resistor;
and if you can, use internal OSC.



@ DEVICE PIC16F628A, INTRC_OSC
@ DEVICE PIC16F628A, MCLR_OFF
@ DEVICE PIC16F628A, WDT_OFF
@ DEVICE PIC16F628A, PROTECT_OFF
@ DEVICE PIC16F628A, BOD_OFF
@ DEVICE PIC16F628A, CPD_OFF



and, as Charles said, use a cap.


----------------------

mbw123
- 15th November 2006, 01:05
Thanks guy's. I turned off BOD and MCLR like sayzer suggested. It is better but there are still errors. I bought the Schottky diode and the caps like charles suggested, but when I wired it up it didn't work. I measured the 10uF cap with my multimeter and it started at the correct voltage, but before long it went down to zero. How does this work if the capacitor goes to zero and the PIC gets no power? Thank you for the help.

-Mike

Archangel
- 15th November 2006, 03:52
Thanks guy's. I turned off BOD and MCLR like sayzer suggested. It is better but there are still errors. I bought the Schottky diode and the caps like charles suggested, but when I wired it up it didn't work. I measured the 10uF cap with my multimeter and it started at the correct voltage, but before long it went down to zero. How does this work if the capacitor goes to zero and the PIC gets no power? Thank you for the help.

-Mike
Hi Mike,
Put the diode in series with the power to the PIC, The capacitor hooks to the Power pin and to ground, on the diodes cathode side. The diode prevents the capacitor from discharging back into the motors, you may need a larger capacitor than 10uF. The only danger I see is if the capacitor is too large PIC might not boot due to too slow of power up. If this still fails, think good thoughts about using rechargable batteries instead of the Cap.
JS

Charles Linquis
- 16th November 2006, 02:06
No, you can use a capacitor as large as you want. There will be NO problem during start up.
There is one drawback to this method, however - The Schottky diode will have a voltage drop of about 0.5V. This means that the PIC will see a power supply voltage of 0.5V less than the actual power supply.

Archangel
- 16th November 2006, 19:48
No, you can use a capacitor as large as you want. There will be NO problem during start up.

Thanks Charles,
I wasn't sure about that one :-), in that case use a BIG one, or use a seperate PS for the PIC, Oh one more thing, take your PIC power and ground directly from the batteries, or power supply, not from the motors power bus.

mbw123
- 16th November 2006, 23:40
Thanks again guys, you are very helpful. One last question. I bought the Schottky diode as suggested and it has a "cathode band" on it. Which direction should I put the diode in, the cathode band side facing the PIC or facing the power?

I'll be sure to follow all of your advice.

-Mike

Charles Linquis
- 17th November 2006, 01:52
Cathode toward the PIC.

mbw123
- 17th November 2006, 02:50
Thank you everyone. I got it working!!

-Mike