Relay on Mains - Page 1
Forum section: electronics / beginners

author: Phaedrus
author_rank: Frequent Contributor
timestamp: March 20, 2014, 08:38:08 pm
content: So I'm building a device that uses a triac to cut mains power to another device at a certain point in the AC waveform (using a 393 to measure both voltage and dv/dt (via a differentiator)). Isolation is a big concern, and I haven't done mains voltage sensing before, so I'd like some feedback to make sure I'm handling this right:Also, what are the pros and cons of triac vs. relay for an application like this? Current through the device under test would be up to 15A

author: T3sl4co1l
author_rank: Super Contributor
timestamp: March 20, 2014, 08:46:58 pm
content: Eww, that opto is toast.You can't "cut power" with a thyristor, only turn it on (and hope it turns off later in the cycle). You want the opto wired in parallel with the TRIAC (MT2 to G), not opposite it. Also, it has to be a phototriac type (e.g. MOC301x).The voltage sense is fine. That technique is called using a potential transformer; purpose-made devices usually have much better specs than a little power transformer, in order to get very tight tolerances on the measurement, but it'll still work.

author: IanB
author_rank: Super Contributor
timestamp: March 20, 2014, 08:47:48 pm
content: Forgive my lack of knowledge, but what's a 393?The simplest way to measure voltage and dV/dt would be to use a resistive divider and tap off a suitably scaled voltage for the sensor or A/D converter.Isolation depends on the details of the system. If you can put the whole system inside a sealed enclosure that the mains cable passes through, then you don't need electrical isolation. The enclosure will provide that for you. You could use a simple non-isolated power supply for the low voltage electronics contained within the same enclosure.If you need to get signals to/from the outside world, then I imagine an opto-coupler would be ideal, but then of course the external side of the signal path would need a separated and isolated power supply.(Note: if there was a picture attached to the original post I cannot see it. Perhaps blocked by local net filter here?)

author: Phaedrus
author_rank: Frequent Contributor
timestamp: March 20, 2014, 08:59:41 pm
content: @IanBLM393 is a dual channel voltage comparator. I did attach a schematic, guess you can't see it. I'll be using channel 1 to compare mains voltage (drawn through transformer and resistive divider) vs. output of an LM431 reference voltage, and using channel 2 to compare differential of mains voltage vs. GND. Both outputs will be latched and they should both switch just a few ms after the waveform peaks. The outputs will be ANDed. I use two measurements to protect against transients. Upon detecting mains peak, I want the circuit to cut mains voltage to the device under test, and send a trigger signal to an oscilloscope.@T3sl4co1lThanks for the feedback. Can you do a quick sketch of what you mean, regarding the triac and opto? Having trouble picturing it.

author: David_AVD
author_rank: Super Contributor
timestamp: March 20, 2014, 09:06:45 pm
content: Check out the data sheets and app notes for the MOC30xx series of TRIAC output optos. That will show how they interface with the TRIAC, supply and load.

author: Monkeh
author_rank: Super Contributor
timestamp: March 20, 2014, 09:06:57 pm
content: I suspect a datasheet speaks a thousand (or more) words:https://www.fairchildsemi.com/ds/MO/MOC3031M.pdf?

author: IanB
author_rank: Super Contributor
timestamp: March 20, 2014, 09:23:56 pm
content: Quote from: Phaedrus on March 20, 2014, 08:59:41 pmAh, LM393, I see. Just "393" wasn't very clear.QuoteAs others are mentioning, a TRIAC cannot interrupt or break the current the current in the circuit, it can only enable it. It is like a switch that can only turn on, but not turn off.

author: Phaedrus
author_rank: Frequent Contributor
timestamp: March 20, 2014, 09:34:37 pm
content: Reading around, it seems like both relays and triacs have serious drawbacks when it comes to quickly switching AC power, at least when it comes to my application. Although I'm confident when it comes to the low voltage analog stuff, I'm not sure what the best course of action is for switching the mains.

author: IanB
author_rank: Super Contributor
timestamp: March 20, 2014, 09:37:48 pm
content: Quote from: Phaedrus on March 20, 2014, 09:34:37 pmYou need to use the kind of devices used for variable frequency motor drive systems. To my knowledge possibilities include MOSFETs, gate turn-off thyristors (GTOs) or IGBTs.

author: Phaedrus
author_rank: Frequent Contributor
timestamp: March 20, 2014, 09:46:45 pm
content: That'd take a monster FET.Something like this, I think?http://www.fairchildsemi.com/ds/FD/FDPF2710T.pdfAnd it would have to be heatsinked. Not impossible for me to do, but damn.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: March 20, 2014, 10:34:15 pm
content: What are you doing that requires sub-10ms power control?

author: IanB
author_rank: Super Contributor
timestamp: March 20, 2014, 10:35:56 pm
content: At a guess it might be something to do with power factor correction on the input side of a switching power supply?

author: Phaedrus
author_rank: Frequent Contributor
timestamp: March 20, 2014, 10:45:22 pm
content: Quote from: T3sl4co1l on March 20, 2014, 10:34:15 pmI need to measure hold-up time for ATX power supplies. This is the time that the PSU maintains voltage in-spec after AC power is removed. However, the duration of this time varies depending on the point in the AC waveform at which power is lost. So the industry standard way to do it is to cut power at the positive peak of the AC waveform, for consistency and comparability between tests and between labs. Normally this is done by using an AC source with cycle-by-cycle modulation, like the Chroma 61500 series. An oscilloscope is used to monitor both the AC waveform and the PSU's +12VDC output, and measure the time between loss of AC power and loss of DC output.However, many companies can't or won't shell out $20k+ for an AC power source, and so can't perform this test in a reliable and consistent way.I want to make a sub-$100 solution that will, at the push of a button, perform the following functions:1. Detect when the AC waveform peaks (at 170V)2. Cut power to the device under test within 1ms of this happening3. Send a trigger signal to an oscilloscope4. Do all of this with minimal risk of fire or electrocutionAnd when power is not cut it needs to be able to carry up to 20A@120VAC to the device under test.

author: fcb
author_rank: Super Contributor
timestamp: March 20, 2014, 11:02:04 pm
content: If you rectify the mains, you could then use an IGBT to switch on/off your DUT. There would be no difference to the hold-up time as the front-end of your DUT is also a rectifier.Suitable IGBT: IRG4PC40UDPBF, drive it using a discrete circuit or the excellent IRS21867 or isolated FOD3182.

author: Phaedrus
author_rank: Frequent Contributor
timestamp: March 20, 2014, 11:09:26 pm
content: There'd be a couple volts loss due to the diode drop, but maybe not enough to effect it. That's an idea.

author: fcb
author_rank: Super Contributor
timestamp: March 20, 2014, 11:24:22 pm
content: Put a variac on the front end to compensate and/or get your voltage cock-on.

author: gxti
author_rank: Frequent Contributor
timestamp: March 21, 2014, 04:11:48 am
content: Don't forget that you have to rectify 15-20 amps worth. And it still seems like it could affect the test results, especially if it's still connected when you test efficiency or power factor. Active PFC inputs will behave quite differently and you can't completely rule out the possibility that a supply might be harmed or destroyed when fed DC.As a general principle, it seems like test gear should not feed DUTs something considerably different from normal operation. But maybe the tradeoff is worth it.

author: Phaedrus
author_rank: Frequent Contributor
timestamp: March 21, 2014, 04:24:34 am
content: I've decided that feeding the PSU DC is probably not going to be a fair test, certainly not directly comparable to other test setups. So an IGBT is out. I've looked at GTO Thyristors, but they look to start at $200 and go up from there. So yeah no.I think a relay will be the best way to do it. I think I've got this hooked up right--A3 is rectified mains dropped down to 10-20V or so. Imaybe able to drive the relay directly from the optocoupler, but in case I can't I drew it with an extra driver stage.Going to work on the analog circuitry now, unless I did something bonehead with that relay. I figure when I build it I'll do a prototype with dead bug HV and Veroboard analog just to try it out. At this low frequency the parasitics shouldn't matter much. If I get promising results I'll go to PCB.

author: Phaedrus
author_rank: Frequent Contributor
timestamp: March 21, 2014, 04:30:09 am
content: The resistive divider for the mains sensing will be in the range of several dozen k, is that high enough impedance to need a voltage follower before the LM393?

author: SL4P
author_rank: Super Contributor
timestamp: March 21, 2014, 05:31:21 am
content: I love schematics than run from right to left.Makes life so much more interesting.

author: edavid
author_rank: Super Contributor
timestamp: March 21, 2014, 05:45:10 am
content: Quote from: Phaedrus on March 21, 2014, 04:24:34 amYou can wrap an IGBT (or giant MOSFET) in a bridge rectifier to switch AC.I don't see how you'll be able to get consistent timing with a relay. It will arc when you open it, and who knows when it will extinguish.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: March 21, 2014, 07:15:23 am
content: Beware that the IGBT has to switch surge current into a supply capacitor; peak current will likely be limited by line impedance and could be 500A easily.

author: Kjelt
author_rank: Super Contributor
timestamp: March 21, 2014, 08:33:25 am
content: Two concerns here1) I might be mistaken but I think your requirement:Quote from: Phaedrus on March 20, 2014, 10:45:22 pmis not going to be realized with a relay which is mechanical and does NOT have a 100% reliable repeatable switch on/off time, nor takes <1ms to disengage.2) If you are going to switch 16 Amps with a relay you better create some snubber or MOV's around the contacts to counter arcing.

author: gxti
author_rank: Frequent Contributor
timestamp: March 21, 2014, 12:47:12 pm
content: Instead of trying to control the timing to within 1ms, perhaps simply measure the timing you got after the fact. Worst case it means you can keep trying until you get it right at the peak. Best case you can do some verification about how far off you can be without affecting the holdup test, and maybe don't need to compensate.

author: Phaedrus
author_rank: Frequent Contributor
timestamp: March 21, 2014, 04:18:22 pm
content: @gxtiMaybe, but it would be nice to get it working as originally intended. Not ready to give up yet.Couldn't I put an N-channel and P-channel mosfet in series? This should block in both directions.

author: commongrounder
author_rank: Frequent Contributor
timestamp: March 21, 2014, 04:35:06 pm
content: What about a Solid State Relay? The ones I've seen will switch on or off in less than a half-cycle. This would be repeatable, which should allow you to compensate for the timing, and do your hold-up calculation. Here is a typical unit rated at 25 amps:http://www.opto22.com/site/pr_details.aspx?cid=3&item=120A25

author: Phaedrus
author_rank: Frequent Contributor
timestamp: March 21, 2014, 04:59:06 pm
content: Ooooh. And isolation built in. I'll look into this one.

author: edavid
author_rank: Super Contributor
timestamp: March 21, 2014, 05:13:48 pm
content: Quote from: commongrounder on March 21, 2014, 04:35:06 pmTurn-off Time: ½ cycle maximumAnd it has a built-in snubber

author: Phaedrus
author_rank: Frequent Contributor
timestamp: March 21, 2014, 05:23:21 pm
content: Quote from: edavid on March 21, 2014, 05:13:48 pmWhat's wrong with a built-in snubber?

author: T3sl4co1l
author_rank: Super Contributor
timestamp: March 21, 2014, 07:10:34 pm
content: No need for complements, you can use a pair of N channel MOSFETs (or IGBTs), source-to-source (or emitter) from a single isolated gate driver. In the case of IGBTs, they must be co-pack (antiparallel diode) types.Peak current and turn-off surges (snubbing) still apply.Tim

author: edavid
author_rank: Super Contributor
timestamp: March 21, 2014, 07:43:05 pm
content: Quote from: Phaedrus on March 21, 2014, 05:23:21 pmIt makes the turn-off time more uncertain.

author: Phaedrus
author_rank: Frequent Contributor
timestamp: March 21, 2014, 08:20:38 pm
content: Hm.Main contenders at the moment are:SSRDual MOSFETDual IGBTI wonder if Dave might have any feedback?

author: edavid
author_rank: Super Contributor
timestamp: March 21, 2014, 08:27:18 pm
content: Quote from: Phaedrus on March 21, 2014, 08:20:38 pmYou don't need a dual MOSFET or dual IGBT, you can use a single part in a bridge (actually this can be simplified since you only have to switch one polarity, but it doesn't really matter).An SSR is out since you don't know what's inside and can't control the turnoff accurately enough.I don't see any advantage to IGBT over MOSFET for this application.Conclusion: use an FCH25N60N inside a bridge...

author: Phaedrus
author_rank: Frequent Contributor
timestamp: March 21, 2014, 08:33:31 pm
content: I want to avoid using a bridge, as A. it might interfere with the PFC circuitry on some of the more advanced supplies (though a simple boost would probably be fine), B. I'm not sure how this would effect the PSU's conductive EMI and how that might interfere with my circuit, and C. the voltage drop might throw off the results.Using two MOSFETs in series base-to-base seems like a much better solution than a MOSFET behind a bridge. There will still be a bit of voltage drop, but at least I'm still feeding the PSU AC, which will avoid any potential EMI and PFC issues.

author: edavid
author_rank: Super Contributor
timestamp: March 21, 2014, 11:29:32 pm
content: Quote from: Phaedrus on March 21, 2014, 08:33:31 pmYou misunderstand the bridge approach... the power supply sees AC and the switch sees DC.If you need to control the PSU input voltage, you're going to need a variac anyway.

author: IanB
author_rank: Super Contributor
timestamp: March 22, 2014, 12:25:17 am
content: See schematic:The switching element could be a MOSFET or an IGBT.

author: Phaedrus
author_rank: Frequent Contributor
timestamp: March 22, 2014, 01:02:20 am
content: OH. I feel like an idiot now. I thought you meant rectify the mains input to the PSU itself. Ok, yeah, that should work.

author: BravoV
author_rank: Super Contributor
timestamp: March 22, 2014, 01:02:31 am
content: Quote from: Phaedrus on March 20, 2014, 09:34:37 pmHow about this arrangements ? Both relays driving circuit can be easily build since its isolated and low volt DC, also the driving signals can be adjusted for both to fire at the desired interval (T-Off).The signals can be generated from a simple logic + 555 circuit or from microcontroller.