Long duration mains timer, slow switching

Discussion in 'The Projects Forum' started by stevemcd, Mar 8, 2013.

  1. stevemcd

    Thread Starter New Member

    Mar 8, 2013
    16
    2
    The attached circuit is a run-on timer for a bathroom fan. It is mains powered and uses an LM311 comparator with a RC on the inverting input and an adjustable R divider on the non-inverting input to set an on timer for about 10 minutes after the fan switch is operated and then turned off. A 2n7000 FET is gated by the comparator output and drives a solid state mains relay. The circuit works, but switching off is somewhat slow, taking about 5 seconds to drive from full on to full off. I have added positive feed back (82R and 1k2) around the LM311, and 1uF across the inputs (recommendations from the datasheet), but it doesn't seem to help (note that the 1uF is not shown on the schematic).

    Can anyone suggest why the output switching is slow and any ideas to correct it?

    Thank you for any thoughts.
     
  2. tubeguy

    Well-Known Member

    Nov 3, 2012
    1,157
    197
    What are the specs for the Solid State Relay?
    Is the contact at P the SSR contact ?
     
  3. stevemcd

    Thread Starter New Member

    Mar 8, 2013
    16
    2
    The SSRelay is a 12vdc controlled, 380 VAC, 3A load spec. The contact set at P (phase) is the SSR contact (its a triac switch) and connects the AC phase to the Load (fan). The SSR is specced for inductive loads and capable of driving the load properly.
     
  4. stevemcd

    Thread Starter New Member

    Mar 8, 2013
    16
    2
    Just to clarify, the area I need most help with is making the output of the Comparator (or the Comp & FET) snap-action - a positive transition from on to off.
     
  5. tubeguy

    Well-Known Member

    Nov 3, 2012
    1,157
    197
    What I'm curious about is how the circuit powers up.
    With mains switch off, then RL1 is open.
    So it appears the only voltage getting to the circuit (to turn it on) would be some bleed-thru through the triac or motor.
    Am I missing something ?

    The Fan connects between P an N Correct ?
     
  6. stevemcd

    Thread Starter New Member

    Mar 8, 2013
    16
    2
    Hi, It's not very clear on the schematic, power is connected at the Phase and Neutral permanently, the "mains switch" is actually used as a low voltage switch and it doesn't turn power of and on - it simply connects C3 to charge.

    To clarify we use the terms phase to mean hot or active, neutral to mean cold and load to mean the switched side of the circuit between phase and the driven load. I think different regions may use different terms.

    The fan is connected between the "Load" output and Neutral and the relay connects and disconnects Phase to the Load.

    So, the circuit is powered, and C3 is discharged, MS1 & MS2 open. The switch is closed and C3 charges rapidly through R3 to near rail voltage. As C3 passes the reference voltage set at VR1 (for discussion, 6v) the output of U1 at pin 7 goes high, Q1 conducts and the relay R/1 operates, closing R1 and powering the fan. At some point my wife leaves the bathroom and turns off the switch, opening MS1 & MS2. C3 now discharges slowly through R4 and when the voltage on C3 crosses below the reference (6v), after about ten minutes, U1 output goes low, the FET stops conducting, the relay opens and the fan switches off until the next operation of the switch.

    It's the slow transistion to this final off state that is the challenge. I'd like U3 to transition from high to low rapidly, but the slowly falling signal input seems to be preventing that. All my reading suggests that added hysterisis (R7 & R8) should assist, but not as much as I hoped.
     
  7. tubeguy

    Well-Known Member

    Nov 3, 2012
    1,157
    197
    Ok. Yes terminology is different. I would read L as the mains hot.
    Have you ever operated the circuit without any hysteresis ?

    It seems the description is opposite of what would happen. If the - input is higher than the + input, (Cap charged),
    then the comparator output would be Low, and vice-versa.
    What do you think?
     
    Last edited: Mar 9, 2013
  8. tubeguy

    Well-Known Member

    Nov 3, 2012
    1,157
    197
    Looking at it more, try swapping the connections to the + an - inputs to the comparator.
    Also put a small value 0.1 uf disc cap across the 12 zener supply.
     
  9. stevemcd

    Thread Starter New Member

    Mar 8, 2013
    16
    2
    Thanks for your thoughts - pins 2 & 3 are incorrectly labelled on the schematic and the description incorrectly reflects that. The description is correct, the schematic should show pin 2 as the non-inverting and pin 3 as the inverting input. Will correct and re-post the schematic.

    So, no need to swap inputs as they are physically correct, thanks for identifying the error.

    Will drop a 0.1uF in the supply line across the zener and let you know results. I will also try removing the positive feedback (hysterisis) loop to see what happens. I'll do these separately and see which has an effect. All ideas worth a look!
     
  10. stevemcd

    Thread Starter New Member

    Mar 8, 2013
    16
    2
    Right - here's an update on where I have gotten to. I have removed the hysteresis and set the pull up resistor (pin 7 of the LM311) to 670k. In addition, I have reduced the discharge resistor across C3 to 470k. This has reduced the timing range, but that’s fine as I can still get the ten minutes I need. The discharge now cycles more quickly through the reference zone and gives quite a clean transition (about 0.5 seconds). That’s fine for a motor load, which can handle that well within its slow down anyway. In addition, I dropped in the suggested caps to clean up the supply. In the meantime some reading suggested filtering on the input lines but I could not find that making any difference so removed it. The input lines seem pretty clean anyway. Quoting the Art of Electronics "LM311 is particularly prone to this" (referring to the tendency to amplify its own noise and cause oscillation at the transition threshold).

    I’m still unsure why the hysteresis provoked the problem it was intended to cure, but it is working (on the bench). It will go in this weekend.

    For added protection I dropped a varistor across the mains at the board connection. If anyone is interested, I will put up the amended schematic, noting that it is scaled for 230v, 50 Hz mains not US supply.

    I think we’re done, and thanks for the useful advice and ideas.
     
  11. tubeguy

    Well-Known Member

    Nov 3, 2012
    1,157
    197
    Normally hysteresis is desirable for comparator circuits because it improves operation at the switching point.. If pins 2 and 3 were reversed, with the hysteresis connected to the - input, then it is actually negative feedback, not hysteresis. When using hysteresis the set point should connect to the - input, the signal should connect to the + input so the hysteresis pulls the signal a bit higher to 'help' the comparator switch over.

    Yes, please post the final circuit if you would.
     
    Last edited: Mar 12, 2013
  12. stevemcd

    Thread Starter New Member

    Mar 8, 2013
    16
    2
    Thanks again for all the input. Here is the amended schematic.
     
  13. stevemcd

    Thread Starter New Member

    Mar 8, 2013
    16
    2
    Hi, I put up the amended schematic yesterday but it didn't seem to load, so here it is again. Apologies if it turns up twice!

    Again, Thank you for the great advice.
     
  14. tubeguy

    Well-Known Member

    Nov 3, 2012
    1,157
    197
    Thanks for posting the updated schematic.

    It appears the hysteresis was originally connected to the -input/setpoint which would not work as intended (see post #110. As the schematic is drawn now, hysteresis would help if it was connected to the + input.

    Also, a 1n4000 series diode across the relay coil would be good (anode to V+)
    to protect the mosfet against switching spikes from the relay.
     
  15. stevemcd

    Thread Starter New Member

    Mar 8, 2013
    16
    2
    Hey thanks, Tubeguy.

    You're right, it was, now it's not. I put it back into the + (signal) input and gosh - it works as advertised, very fast transition.

    The diode is excellent advice for a coil relay. This one is a sealed solid state job with Triac output and is internally protected, so okay to leave it out for this. It switches off at zero current crossing.

    Ciao.

     
  16. tubeguy

    Well-Known Member

    Nov 3, 2012
    1,157
    197


    Yes you're right. I new it was a SS relay earlier then forgot.:D

    Glad it's working as desired.
     
Loading...