Shop OBEX P1 Docs P2 Docs Learn Events
unknown reason for prop reseting — Parallax Forums

unknown reason for prop reseting

krazyideaskrazyideas Posts: 119
edited 2012-08-10 03:56 in Propeller 1
I have the prop driveing a driver switch which drives a relay that runs an AC circut.
My power comes through the 5 volt reg then the 3.3 volt reg

The relay draws 75 milliamps, the other componets I have no idea how much they draw.

Other componets that I'm running with the prop
-2X16 LCD
-4X4 keypad

The problem is sometimes when the relay is triggered the Prop resets.

What I have tried

-Put a batter in line with my power supply thinking to make the power more stable and constant even if the AC to the supply drops off for some strang reason
-Put Caps over every positive and negative draw point
-Put a massive Cap over the power supply
-Put a diode over the relay to catch the back emf when the relay is turned off

Any ideas???

Question
What are the things that will cause the prop to reset?
I know power drop will. Will a power spike?

Thanks Guys
«1

Comments

  • kwinnkwinn Posts: 8,697
    edited 2012-08-01 19:58
    A power spike will also cause it to reset. Do you have a diode across the relay coil ?
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2012-08-01 20:13
    The reset pin comes to mind.

    A 0.02uF cap from RSTn to VDD works for me. (Not VSS)

    Duane J
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2012-08-01 20:15
    The obvious cause would be the nasty spike from the relay coil but you have diode across it as you said. What voltage rail is the relay connected to and how are you driving it? One of the first things you can do is to disconnect the AC load and try it out just to see if it is local or a spike being fed back through the mains. Bear in mind too that we have no idea of whether you have this on a breadboard or a known good pcb. The crystal circuit is probably the most sensitive to interference as is the reset line to a lesser extent.
  • jmgjmg Posts: 15,183
    edited 2012-08-01 20:23
    krazyideas wrote: »
    The problem is sometimes when the relay is triggered the Prop resets.

    Sometimes it will switch at different phases of the Mains Cycles.
    Check it never happens with no AC connections, and try a Solid state relay instead.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-08-01 20:31
    A 0.02uF cap from RSTn to VDD works for me. (Not VSS)

    Once the cap is charged, what difference does it make? Both Vdd and Vss are AC ground.

    In either event, a stiffer external pullup should work just as well.

    -Phil
  • jmgjmg Posts: 15,183
    edited 2012-08-01 21:25
    Once the cap is charged, what difference does it make? Both Vdd and Vss are AC ground.
    In either event, a stiffer external pullup should work just as well.

    Not to a fast edge, coupled via small parasitic C/L but high dV/dT's - if that is the pathway, then a 20nf cap on reset will work nicely.
    I recall early AVR's were very touchy about spikes on their reset pins, until Atmel added a deliberate tens-of-ns filter.
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2012-08-01 21:31
    krazyideas,

    You didn't say how you were driving the relay... does the Propeller still reset even if there isn't a load on the AC line? In other words just the relay without any AC attached to the relay?

    It was mentioned that the timing of the relay might have to coincide with the zero-crossing of the AC. This would be typical if the relay was switching a large load. What can happen here, even though you have an isolation of the relay, you can still generate large amounts of RF energy capable of 'transmitting' to the Propeller, or for that matter another micro controller. By making the relay closure or opening during the zero cross of the AC, this RF energy can be minimized. 'Hardening' the reset line to the Propeller in the case of an RF transmission reset can be done by selecting a lower value resistor for the reset line and/or adding a capacitor as suggested.
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2012-08-01 21:32
    Hi Phil;
    Once the cap is charged, what difference does it make? Both Vdd and Vss are AC ground.
    In either event, a stiffer external pullup should work just as well.
    Yes, in theory that is true.
    However, many of the spikes from relay contacts arching on the AC side can have rise times considerably faster than 1nS. We measured some as short as 50pS, (that was the limit of our sampling scope). And the amplitudes can be hundreds of volts.

    I witnessed a demo done by a Dr. Honda of really fast pulses produced when some quarters were jingled in a felt bag 20 feet away. He showed the pulses on his 10pS detector were a couple of hundred volts. Just from the static charge caused by the felt.
    Very cool!!

    OK, the Prop should in theory not be able to see this. But what happens is the high energy pulse gets integrated and is enough to bump the RESn pin.

    These fast pulses disturb both the VDD and VSS rails even with lots of ceramic caps. With fast scopes the voltage can be seen to be as much as 10 volts. Ya, this sounds destructive of the chip but generally not as they are so short. Since the RESn pin is normally at 3.3V a cap connected to VDD will not be influenced by pulses on the VSS buss.

    I have found that using the cap in this way greatly improves the susceptibility from relay arch noise. I first did it on Z80s and other micros since. I have tested this on my plugboard Props and I have found this to be quite a bit better than going to VSS.
    Besides, the VDD pin is just next door.

    And, I find the smaller caps, 10nF to 22nF or so are better than the larger 100nF ones. Presumably the impedance is lower to these fast pulses.

    And yes, I agree, an extra 5K or 10K pull up really helps. I guess I just don't trust the internal 5K pullup.

    Duane J
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2012-08-01 21:49
    I'm going to have to agree that a cap to Vdd in this case might be a better solution, but not necessarily for reasons already mentioned. Assuming that you have a pullup to Vdd, then the pullup resistor is in parallel with the cap. This creates a unique situation where the capacitor is completely (or mostly) discharged and stable. This relationship makes the Reset pin appear to be a dead short between Vdd and the reset, which is exactly what you want. In the other scenario it would still work, but you don't have the 'shorted' parallel effect that a parallel resistor cap combination applies. ... just an opinion. <-- Don't believe this information (see below)
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-08-01 22:01
    Beau,

    I hate to disagree with your analysis, but a cap that's charged to Vdd via a pullup is just as stable as one that is completely discharged via the same pullup. In both cases, it takes the same amount of current-integrated-over-time to to drive the pin below the trip point.

    -Phil
    .
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2012-08-01 23:36
    Ok, Phil,

    I take back my previous claim... both circuits do the same thing. (see attached ... 5kV simulation) ... should not matter connecting capacitor between reset and Vdd or reset and Vss
    1024 x 819 - 45K
    5kV.jpg 44.9K
  • krazyideaskrazyideas Posts: 119
    edited 2012-08-01 23:44
    First Off thanks guys for all the input. This is why I will always be a prop fan, not only is the chip sweet but it's this foarm and you guys that really sell it for me.

    K well I don't actualy have anything on the Res pin at present. It is hooked up just like is shown on the education board, and it is on a bread board. I can't belive that didn't cross my mind. I guess when your staring so hard at a bird you don't see the moose cross the road right in front of you. I was begining to think I was somehow reseting it unwittingly in the software.
    Any way

    The prop triggers my little driver switch that bumps the voltage up to 5 volts and takes the current for driveing the relay. I will get part number off my driver switch next time I look at it for you guys.

    The prop will reset even if there is no AC load on the relay.

    The power to the prop, the driver switch, the relay, everything is all run through the 5 volt and 3.3 volt regulators

    As for some of the other comments that were a little deeper, just imagin a deer in the head lights look.

    I'm still very new at all this, and have already made lots of cool stuff. I can't wait till I understand more.

    I'll let you know if a pull up and a capp does the trick, I'm sure it will.

    Thanks again.

    Ps why do you guys always ask if it is on a bread board?? Are they unstable or something?
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2012-08-01 23:50
    Unlike a proper PCB, breadboards lack a ground plane or even just a good ground. You end up with inductance and the ground "tracking" acts like an antenna just begging to pick-up noise and jolt the poor Prop off it's perch. For this and other reasons too try running the ground for your relay and driver separately back to where it comes from rather than along with the Prop's ground. That should help for starters. BTW, a picture paints a thousand words.
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2012-08-02 05:34
    Hi Beau;
    Ok, Phil,
    I take back my previous claim... both circuits do the same thing. (see attached ... 5kV simulation) ... should not matter connecting capacitor between reset and Vdd or reset and Vss
    Well, that is only a simulation. Of course the 2 are Th
  • krazyideaskrazyideas Posts: 119
    edited 2012-08-02 12:34
    Ok well I put a 56 Ohms pull up resitior on the Res pin but it still did the same thing. Then I put the only cap I had on hand over it as well and it still reset. The cap had a 5A on one side and a 10J I think on the other side (I don't know how to read them)

    So as for what I have.

    All on a bread board. The prop set up as shown in the education kit, then off of pin 13 it goes into my driver switch a 74ACT244P which pulls the voltage up to 5. Then from the output from the driver stright into a relay that has a diode across the coil just outside of the relay. The relay is really close to the one digikey has listed as Z3108-ND and the relay output is AC or DC depending on what I want. With all the things that came up about AC I change the relay load to a DC test just until I get this working.

    Besides that I have an LCD screen hooked up and a 4x4 keypad and that is the kit and kaboodle.

    Any other thought's. Cuz this is the last bug on my project and is driveing me nuts
    Thanks
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-08-02 12:53
    56 ohms is way too stiff a resistor for nRST. If 1K doesn't work, the problem lies elsewhere. BTW, Peter's admonition is pure gold. Heed it:
    For this and other reasons too try running the ground for your relay and driver separately back to where it comes from rather than along with the Prop's ground.

    You never want ground currents from your external load running through your logic ground.

    You might also consider adding an RC snubber circuit across the relay contacts to prevent arcing and the resulting EMI.

    -Phil
  • jmgjmg Posts: 15,183
    edited 2012-08-02 14:14
    krazyideas wrote: »
    The prop will reset even if there is no AC load on the relay.

    but did you remove all the AC connections to the relay ?
    just removing the load, can still have the relay switching AC power.

    Try a solid state relay, as that removes contact issues - anyone running breadboard + relay contacts is what I'd call 'an optimist'.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-08-02 14:45
    SSRs have the additional benefit of switching on the AC zero crossings, which further reduces EMI.

    -Phil
  • krazyideaskrazyideas Posts: 119
    edited 2012-08-03 00:26
    I did as suggested and used a sperate ground wire for the relay and driver switch that goes as close the power supply as I can get and it helped consterably but it still reset once in 40 cycles of the relay.

    If I used a 5 volt regulator that solely supplyed the relay. While I had another 5 volt reg running the LCD screen and driver switch, then a 3.3 volt reg running the prop alone. And of corse keeping each of those ground for the regs as close to the supply as I can. (it definaly makes a difference where a ground hooks up. Before I moved my grounds it would reset 1 in every 8 cycles of the relay. Ya learn something niffty everyday)
    But do you think running those regs like that would help? or would it just be a waste of time? would the regs act like buffers that would stop any left over whatever is causing the problem?
  • krazyideaskrazyideas Posts: 119
    edited 2012-08-03 23:18
    Ok so I found a SSR and everything works great now. Thanks guys.

    But I would still really like to get this working with my contact relay.

    I now know what I fighting for sure though. It's nice to know your not looking at a reflection of your opponent but the real one.

    What is a RC snubber circuit? what's it do? and how would I hook it up?

    What is inductance?

    So am I right if I say that the two main grimlins that I am fighting are
    1- the spike
    2- the RF (which I don't really get) The RF is kinda like a electro magnectic pulse right?? It's energy that is being passed through the air to say the least and the prop picks it up via the Tracking lines of the bread board like was mentioned above.

    Could I solve the RF problem by moveing the relays a greater distance from the prop?
    Then at least I could fight one thing at a time.

    Thanks
  • krazyideaskrazyideas Posts: 119
    edited 2012-08-03 23:25
    Ok so I found a SSR and everything works great now. Thanks guys.

    But I would still really like to get this working with my contact relay.

    I now know what I fighting for sure though. It's nice to know your not looking at a reflection of your opponent but the real one.

    What is a RC snubber circuit? what's it do? and how would I hook it up?

    What is inductance?

    So am I right if I say that the two main grimlins that I am fighting are
    1- the spike
    2- the RF (which I don't really get) The RF is kinda like a electro magnectic pulse right?? It's energy that is being passed through the air to say the least and the prop picks it up via the Tracking lines of the bread board like was mentioned above.

    Could I solve the RF problem by moveing the relays a greater distance from the prop?
    Then at least I could fight one thing at a time.
  • jmgjmg Posts: 15,183
    edited 2012-08-04 00:45
    krazyideas wrote: »
    Ok so I found a SSR and everything works great now. Thanks guys.

    Good, How does it compare in price with your relay ?

    Another test you should do, is drive the SSR and also the relay coil, but have no contact connections at all.
    krazyideas wrote:
    Could I solve the RF problem by moveing the relays a greater distance from the prop?
    Then at least I could fight one thing at a time.

    It should help and be easy to try. Also dress the mains cables well clear of any Prop cables.

    What load is the relay driving ?
  • Mark_TMark_T Posts: 1,981
    edited 2012-08-04 01:13
    krazyideas wrote: »

    What is a RC snubber circuit? what's it do? and how would I hook it up?
    Its one approach to reducing/controlling switching an inductive load to prevent damaging spikes - the C forms a resonant circuit with the L and the R dampens the resonance to near crticallity - result is the otherwise damaging spike becomes a half-cycle or so of AC at a resonable voltage

    What is inductance?
    Indictances (symbol L) are basically coils of wire - this increases the magnetic field associated with any current and leads to significant energy storage. Inductors resist change in current and switching the current off in particular can generate large voltage spikes. The voltage across a pure inductor is proportional to the rate of change of current. The snubber circuit allows this current to charge the capacitor rather than suddenly be cut off. Often a diode is used instead of an RC snubber (snubbers have to be matched to the actual inductance, diodes carry the current whatever the value of the inductance)

    BTW the L is after the German physicist Lenz (I didn't know that till just now, wikipedia is handy sometimes!)
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2012-08-04 03:03
    RC snubbers are usually just a 100nF capacitor in series with 100 Ohms, this is placed across the contacts.

    The cap will have to be 600+ (DC)Volts rated for 220-240 mains, there are units that have both integrated in the same package.
  • krazyideaskrazyideas Posts: 119
    edited 2012-08-04 08:25
    The price of my contact relay was $1 whereas the SSR was $25

    What will driving both kinds of relays together do or test? I'll give it a try though

    Thanks for the input I'll let ya know how it turns out
  • jmgjmg Posts: 15,183
    edited 2012-08-04 16:22
    krazyideas wrote: »
    What will driving both kinds of relays together do or test? I'll give it a try though

    It isolates/confirms the issue as the relay contacts dV/dT.
    If you can drive SSR + only the coil (all contacts disconnected) with no failures, that leaves the contacts.
  • krazyideaskrazyideas Posts: 119
    edited 2012-08-07 17:11
    PROBLEM FINALY SOLVED

    So all this time I have been fighting a spike. The problem was that the spike was not the problem.

    I talked to my uncle and he said there are two things you have to worry about when turning off a coil. One is a spike, which I fixed by a diode across the relay terminals and a diode going from the power supply into my positive infeed into my regulator.

    The other was I think he called it RF. Energy being thrown out in the air anyway. So he suggested I sheild the relays.
    So I wraped the relays up in aluminum foil and ran a wire from the foil to ground as close to the power supply as I could get. Now the prop does not reset anymore. I went though 620 relay cycles, the load being 8 amps (AC) and no problems.

    A week and a half and I was fighting the wrong problem the whole time. LOL. Then the soultion as simple as aluminum foil. HAHA well live and learn.

    But I thought that someone else might be able to make use of above knowledge.
    Hope I save someone some time.

    Thanks
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2012-08-07 18:23
    Thanks for updating us, that doesn't happen very often :)

    Do you know that relays are used all the time on pcbs next to MCUs? Guess what? They're not shielded but they don't have a problem. You can wrap foil around your relay bur what you needed to get rid of is that "RF energy" that interferes or just EMI as it's referred to. Except for hobby circuits all electronic stuff that gets manufactured needs to be compliant to EMI regulations otherwise we would have planes falling out of the sky, pacemakers going wacky, etc.

    Snubber circuits were mentioned earlier and this will reduce the spark across the contacts when they open. At the moment you have an illegal transmitter operating every time your contacts open. Plus the sparking will wear out the relay contacts. Did you install a proper snubber with the correct value and type of capacitor?

    BTW, SSRs are cheap, I don't know which ones are $25. Here's a zero-cross switching 8A SSR that will never burn out "contacts" and will not transmit RF every time it breaks a circuit.
  • QuattroRS4QuattroRS4 Posts: 916
    edited 2012-08-07 20:42
    Saw mention of Zero Cross Over SSR's - Just be careful with Zero Cross Over SSR's switching inductive loads ... they can exacerbate your issue !!

    http://www.crydom.com/en/Tech/Newsletters/Solid%20Statements%20-%20SSRs%20switching%20types.pdf

    http://relays.te.com/appnotes/app_pdfs/13c3206.pdf

    Just said I'd throw in my two cents worth here ..

    Regards,
    John Twomey
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2012-08-07 21:30
    QuattroRS4 wrote: »
    Saw mention of Zero Cross Over SSR's - Just be careful with Zero Cross Over SSR's switching inductive loads ... they can exacerbate your issue !!
    Just said I'd throw in my two cents worth here ..
    Your two cents and my two cents can't even buy a cup of coffee so we will just have to make do with inductive sparks and RF energy to keep us on our toes :)

    BTW, yes
Sign In or Register to comment.