PDA

View Full Version : Mysterious Reset Revived!



JoelMurphy
- 15th May 2007, 01:54
Hello Helpful Friends,

A while back I posted a problem that I was having with my PIC application.
here's the thread if you want to catch up
http://www.picbasic.co.uk/forum/showthread.php?t=5750&highlight=mysterious

In a nutshell, I'm using the PIC16F88 to run a program that controls a large conveyor system, switching single phase 220 motors [1/2 horse]. There are other aspects to the system, including fans and small motors [110VAC pumps and gearmotors]. The resetting issue occurs because of blowback from relays I was naively using.
I determined that the resetting issue was caused by a BOR. When I disabled the BOR my reset problem stopped, however I still got hit rarely. So, I replaced the mechanical relays with solid state zero-crossing models. The basic link from the PIC to the appliance is:

PIC >> I/O Module [5VDC input, 110VAC output with ZeroCross] >> Solid State Relay [110VAC input, 220VAC output, with ZeroCross] >> Motor

Success! well... that's why I'm writing...

I have had one resetting with the Solid State relays in place. It happened when the relay was disabled...

The Questions:
Is there another circuit that i could attach to my cascade of doo dads? the relays and I/O mods all have snubbers built into them.
OR, can I run the PIC with the BOR disabled? I've read that i could be placing some of my volatile memory at risk, but how risky is it? in all the time i've run with the BOR disabled, there have been no problems with loosing variable values.

Is it just bad form to run the chip without the BOR?

My system is an art project that is going to be installed in a major museum in Europe this summer. It can't really operate with this ghostly issue, and my client is worried.... always a bad sign.

Thanks for your consideration with this,
Joel

skimask
- 15th May 2007, 04:46
The Questions:
Is there another circuit that i could attach to my cascade of doo dads? the relays and I/O mods all have snubbers built into them.
OR, can I run the PIC with the BOR disabled? I've read that i could be placing some of my volatile memory at risk, but how risky is it? in all the time i've run with the BOR disabled, there have been no problems with loosing variable values.
Is it just bad form to run the chip without the BOR?
Joel

Another circuit - maybe a long distance opto-isolator? Fiber-optic type?

BOR - I personally don't think it's bad form to run without the BOR enabled, especially if that's what works for you.
But...I think I'd make sure you've got some extra error checking code in there to cover for you if you do get into a marginal power situation and your values are uncertain...some sort of recovery routine that gets executed once in awhile, maybe saves values in eeprom, then double checks current values against the eeprom, if any of them don't match, restore the whole bunch, use either onchip of offchip type eeprom. An idea I suppose...good or bad? I dunno...

mister_e
- 15th May 2007, 04:49
if disabling the BOR solve the problem... i would monitor the whole hardware first to know WHY. Once you know why, this also solve any other potential problem.

Any extra I/O? use it to do a Hardware Reset once in a while :D

EDIT: any real schematic, pcboard and installation picture would be nice.

Pic_User
- 15th May 2007, 06:00
Hi Joel,

If the PIC is really reacting to a brownout, either the Vdd (+) is dropping too low in voltage (compared to Vss) or Vss (-) is rising too high in voltage (compared to Vdd.

The PIC sees the voltage across it’s supply pins at a level below what the PIC16F88 considers to be a brownout condition.

The capacitors that we always suggest to bridge these pins, are intended to hold the voltage on the pins even if the rest of the circuit dips. That’s why the capacitors should be very close to the chip.

The large capacitor is like a battery that holds it’s charge, even if the charge sags for a short time.

The lower value capacitor is to trap any fast moving “transients” that whip through the circuit, snapping the voltage at a rate so fast, that the large capacitor’s inductance makes it too slow to react. The small capacitor should be a fast acting low inductance, low ESR type. Not just any old type.

There are measures that can help problem circuits.

If we visualize that the slow dip in the circuit voltage also discharges the larger value capacitor, along with pulling the PIC voltage. It would make sense to guard against this discharge. See Filter 1 The resistor allows the capacitor to slowly drain while the voltage sags. However, if the resistor is too large in value the PIC may not like the power up sequence. The resist affects both directions.

There are other ways to increase the effectiveness of the filters. Filter 2 has an inductor. Inductors slow high speed changes in voltage.
Filter 3 has a little of each.

Filter 4
Diodes allow the voltage to charge the capacitor and prevent the circuit from pulling it back down during the slow glitch.
<img SRC="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=1630&d=1179204818">
These are really just some of the common ways to prevent voltage at the pins of a integrated circuit from being affected by power sags and transient glitches that bother all types of sensitive circuits.
Look for decoupling, bypass and blocking with Google.
See: http://www.designers-guide.org/Design/bypassing.pdf
There are a lot of other circuit problems that can plague a beginner. Mister_e is correct, please show us, some of the technical side, of your setup.:)

Acetronics2
- 15th May 2007, 08:50
Hi, Joel

No mystery at all in this cruel world.

"Mysteries" are only what our brain can't understand ... yes : understand

Alain

JohnH
- 15th May 2007, 12:05
Pic_User, thanks for the information and the PDF file. Good stuff!

--John

JoelMurphy
- 15th May 2007, 13:46
Thanks muchos.
i have a large cap across the rails, and a small one too, [.1uF]. i teach basic electronics and PIC programming at Parsons, and have been over and over the importance of placing capacitors as filters. now i guess it's time i did some learnin' too!
so, it looks like i'll be putting together some more sophisticated filters.
i don't own a scope, or anything really useful like that, so i'm not sure how well i can track down the actual noise in the circuit....

the project i'm working with now is a prototype of a much larger installation.
i will post a link to the latest images and video tonight.

again, thanks for the help, i'm going to read Ken's noise reduction notes on the train today.

back soon with pics,
joel

T.Jackson
- 15th May 2007, 15:08
<img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=1632&stc=1&d=1179237163" align="right">
I'd probably be inclined to use OPTO Couplers if I had a problem like this. In essence, an OPTO provides total electrical isolation between the control and switching circuit by using light to bias a zero gain internal transistor inside the OPTO. These devices are typically well insulated - not uncommon for a dielectric strength of 5KV or more!

Sample pictured far right shows everything you need to safely switch a relay using an OPTO. As a general rule of thumb - you need to bias the internal LED with about 10 x the current that you require its internal transistor to switch. But in the case of the sample shown, the work around is to use an additional external transistor to beef things up. If you follow the formula for calculating R1, then Q1 will be happy to switch about 0.001 x Q1's ßeta value. Q1's ßeta could range anywhere between 100 - 1000 depending on the type of transistor you implement. The circuit is quite orthodox.

You'll be very hard pressed getting an OPTO to respond to any noise or surrounding electrical interferences. OPTO's are cheap, come in a standard 6 pin DIL package, and most importantly they're easily implemented.
<br/>

JoelMurphy
- 16th May 2007, 00:26
hi,

i have some details of the conveyor system that i'm operating.
first the fun stuff:
go here for pictures and video http://solutions.joelmurphy.net
click on Phoebe Washburn to get there.
NOTE! the picture of the circuit is OLD. i've replaced the mechanical relays with I/O modules [5VDC in : 5A 28-280VAC out], fitted nicely with ZeroCross and RC snubber circuitry. here's the Mouser part number 655-OACM-5H.

The PIC16F88 outputs that activate the I/O modules go 'through' a Darlington IC [ULN2004A], which is outfitted with snubber diodes, and can handle more than enough amps per pair. some of the PIC outputs that i will connect to I/O modules in the future will run through a SIPO before they get to the Darlington.
Got me?

.pbp code is zipped at the bottom.

before y'all get started... i know it's a bit of a rats nest, and i think that might have something to do with my problem. i am an artist, not an EE.

also to clarify: the I/O modules output 110VAC to solid state relays [90-280VAC in, 5A 48-660VAC out] the 110VAC is pulled from the AC input to the PowerSupply. PowerSupply is at the bottom of the circuit photo for your visref.

i'm thinking about how to lace some WRITE/READ code into my program. the PIC16F88 has a whole bunch of EEPROM ;)

thanks for the help,
go easy, huh?

joel