Mains switching research break out - Page 1
Forum section: electronics / projects

author: oschonrock
author_rank: Regular Contributor
timestamp: August 02, 2020, 09:57:45 pm
content: Input appreciated please.There are lots of really dodgy "switch your XXX mains appliance from your YYY uC" circuits and schematics out there. Many of them dangerous. A lot of videos do this stuff on breadboardI am trying to design a "breakout module" that does this "properly" and safely. It may/will ultimately need to come in a proper physical case, properly isolated, protected & appropriately fused etc so that people can do these things without killing themselves or the equipment.The concept has 2 parts:1. The HV switching part2. a slave uC which you can talk to via I2C, analog, or whateverI am focused on part 1 here.Attached is an early sketch of the basic switching architecture. Text annotations are the questions I would like input on.... Also see more verbose description of goals/intentions and circuit operation below.Many thanksEDIT:--------My original circuit description and outline of intention/goals were not adequate and caused some confusion below. So here is a fuller description:I am not making a simple SSR, nor am I making an AC motor drive. Variable speed AC drives (VSDs) have a full rectification stage first then a DC bus with huge caps and then an H-Bridge type switch topology. The advantage of that is that they can make AC of any frequency, and this is required to properly control the speed of AC induction motors. My circuit can't do that, but it can operate in the following three "switching modes":1. ON / OFF multi cycle period (typically 1-2 seconds, less and, depending on load size, you get into trouble with standards in some regions,( eg EN61000-3-3, AKA "the flicker standard"). The uP can (optionally) do the careful timing to ensure it switches the MOSFETs off during zero cross and hence causes less harmonics. This mode does the job of an SSR - if this is all I wanted I should use an SSR - and is quite trivial.2. What is often referred to as chopping / dimming / phase angle switching etc. Means turning the devices on / off once per 50/60Hz half-cycle. This can be done on the leading edge, ie wait after zero cross before switching on, or on the trailing edge, ie turn the devices off early before the half cycle completes. The former (ie leading edge) is what triac based dimmers do, but they can't do trailing edge which has advantages in many circumstances.3. PWM of the sine wave at frequencies of multiple kilohertz. This is different to the AC variable speed motor drive because it is not switching DC to make AC of any frequency. It is switching the AC sine wave. That means we can "smoothly vary the effective amplitude" of the sine wave, but we cannot change its frequency. -- Note that while the attached circuit sketch can do this in theory, in practice, a proper isolated MOSFET gate driver is needed for this mode, as discussed below.So proper induction motor control is beyond the scope of this "research break out board". It's purpose is to introduce hobbyists / students to the various kinds of AC switching you can do. It should be able to demonstrate the above 3 modes, and how different kinds of loads respond to them. The purpose is to educate and provide information on strengths weaknesses, from a "ready made box" which can do all 3 modes and be SAFE. Someone below mentioned current/voltage monitoring and that would be a great addition. Non-trivial due to the isolation requirements, but I might need to go there.Some notes on intended circuit operation:Unlike in a VSD H-bridge, the 2 MOSFETs will always "switch on at the same time".Actually that is not quite correct. more precisely, in the "upper half cycle" (when Vline > Vneutral the lower MOSFET on my schematic (Q2) will be in "body diode bypass", ie whatever you send to its gate is irrelevant. In that upper half cycle the "triggering which is important is on Q1. In the lower half cycle, the roles are reversed. --EDIT2: The above paragraph is wrong (I learned something), the body diode is not used like that. Both MOSFETS are really on together in that circuit, because MOSFETS can conduct current in REVERSE (ie from source to drain) when they are on. The Ron of a MOSFET will usually result in a lower forward voltage at a particular current than the body diode, so if it's switched on, almost all the current will flow through the main channel, not the body diode, and that's good => lower power dissipation.The optocoupler & +12V supply referenced to joined sources and that pull down resistor mean that the controller/uP doesn't have to care which half cycle it is in. It would just look at the zero cross info from U1 and decide when to trigger U2 - upper or lower half cycle, don't care.Discussion below introduces a proper isolated MOSFET driver which fundamentally works in a similar way but drives the devices more efficiently and therefore able to achieve Mode3 = PWM > 1kHz.It is also possible that IGBTs would be a better choice of switching device, particularly for mode 3. Any input on this appreciated. -- EDIT2 discussed below: No. IGBTs are not good for this, because they can't conduct in reverse, and hence need a separate anti-parallel diode (there is such a thing as a RC-IGBT, reverse conducting, but this is not a mature technology).

author: coppercone2
author_rank: Super Contributor
timestamp: August 02, 2020, 10:03:23 pm
content: you want safe triggering put industrial levels of protection on the opto input, they are a diode after all

author: oschonrock
author_rank: Regular Contributor
timestamp: August 02, 2020, 10:05:30 pm
content: Quote from: coppercone2 on August 02, 2020, 10:03:23 pmThanks. What do you suggest? TVS etc?

author: coppercone2
author_rank: Super Contributor
timestamp: August 02, 2020, 10:09:01 pm
content: esd diode on the logic side (off board connection since its a module)on the mains side I don't really know. Maybe a MOV, fuse, etc

author: oschonrock
author_rank: Regular Contributor
timestamp: August 02, 2020, 10:14:12 pm
content: Quote from: coppercone2 on August 02, 2020, 10:09:01 pmMakes sense. Thank you. Will add.

author: OM222O
author_rank: Frequent Contributor
timestamp: August 02, 2020, 10:56:48 pm
content: what on earth are you trying to achieveDon't use fets and simple opto coupler. You should look into using opto triac and triacs for the actual switch. This class AB amplifier you made has some significant drawbacks and most likely overheat the fets (not to mention zero crossing distortion etc) you also forgot protection features like movs, X and Y class rated caps depending on phases / netrual, common mode choke / ferrites for noise.Look into construction of surge protectors or any reputable mains PSU, you'll find all of those features.

author: oschonrock
author_rank: Regular Contributor
timestamp: August 03, 2020, 12:19:32 am
content: Quote from: OM222O on August 02, 2020, 10:56:48 pmPerhaps I should have been more explicit. The object is go beyond triacs, which don't work with many modern lamps types to start with, and create evil harmonics (leading edge on, zero cross off).I was clearly concerned about the commutation (class AB as you called it), hence the question on that. The idea for that architecture is not from me ;-)But if it's seriously flawed please be specific. What's the alternative? Separate and retrigger?The other most common/sane architecture (other than full blown industrial AC drive style DC Bus and re-chop) is MOSFET wrapped in a in a bridge rectifier, which has the same challenges ( I believe) with lots more parts that don't add anything..Thanks for your thoughts and the ideas on protection protection features particularly. I had not yet added any, as trying to validate architecture first ("early sketch..."), but those are all certainly valid suggestions.

author: BrianHG
author_rank: Super Contributor
timestamp: August 03, 2020, 12:34:05 am
content: If you want to completely get rid of switching harmonics like you claim, your 2 choices are mechanical relays or 2 photovoltaic optocouplers, each one powering the gate of each mosfet completely eliminating their loss of power during the AC transition and both mosfets' gates would always be on under both phases. You are basically engineering an AC/DC opto-mosfet relay switch.Your other choice is to use 2 gate transformers with 2 separate outputs each driven with a good current square wave high frequency AC signal with full wave bridge output rectification plus pull-down resistor to energize the gate when you want it on, then cut the waveform when you want it off.There also exist isolated gate drivers with isolated gate power supply for this purpose, but they may be costly and not normally stocking type ICs.Last note, Triac AC switches can be made to not interfere with LED lamps, you just need a snubberless tolerant triac and remove the snubber circuitry. There should no longer be enough current flowing through your AC switch to make an LED lamp shine dim or flicker when the switch is turned off.If the 2 mosfet design is a must, I would use the photovoltaic optocouplers and get rid of that full wave bridge rectifier and loading circuit which wont always power both gates completely when on. Just make sure the photovoltaic output voltage is high enough to completely turn of the gate of the selected mosfets. Maybe use logic level mosfets to ensure this happens. Perform proper measurements at a complete temperature range check, otherwise, under certain circumstances, you may not be completely turning on the mosfets.Example:https://www.arrow.com/en/products/tlp3906-tple/toshibaThis one's output is a good solid 5v @ 12ma @125 degrees Celsius. Panasonic also has one with similar specs.These are too slow for PWM and slicing strategies. You need to use a gate transformer or a second optocoupler or re-thing your posted schematic to achieve that properly. Even if your current design would be considered a safe functional circuit, that 4.7k pulldown on the gate would be too slow for PWM strategies while slicing would work, turning off the mosfets would be so gradual and slow, expect them to get really hot. They need to turn off fast, like 100 ohm pulldown at least somewhat equivalent to the turn off speed of a proper mosfet gate driver.If you want a fast turn off instead of a 1-10 megaohm load on your gate to source to turn off the mosfet, you will need a second transistor/mosfet output optocoupler to discharge your gate quickly when it is time to turn off the mosfet.Otherwise, just use a high voltage/high current photo-fet AC/DC relay IC/component which has this all inside already.

author: oschonrock
author_rank: Regular Contributor
timestamp: August 03, 2020, 01:08:41 am
content: Quote from: BrianHG on August 03, 2020, 12:34:05 amThe 2 Mosfet design is not a must and I did not "make any claim to completely get rid of harmonics". Zero harmonics are not possible if you chop up a sine wave.Triacs draw currents with high harmonic content. This is a very old problem. The LED issues have just been added recently.How mechanical relays are a solution I don't get. We want "half on" as well as off and on...and all points in between.The idea of the sketch I posted is to allow the mosfets to commutate (with small cross over interruption at very low currents, unless v/i phase angle is large then this could be a real problem) while the optocoupler is high. Just Ron and a body diode in series, plus the commutation losses. But if < 100% power is desired then the uC would turn the optocoupler off at x% of T/2 after the zero cross trigger. Basically this is what "trailing edge dimmers" do, so it's not new.Unfortunately I don't understand your comment on gate transformers, it sounded like it could be interesting. Any sketch/link/part number?

author: Monkeh
author_rank: Super Contributor
timestamp: August 03, 2020, 01:13:59 am
content: Quote from: oschonrock on August 03, 2020, 01:08:41 amUp to this point you've never suggested you wanted a dimmer instead of a switch.

author: temperance
author_rank: Super Contributor
timestamp: August 03, 2020, 01:29:05 am
content: Quote from: oschonrock on August 02, 2020, 09:57:45 pm-Perhaps the best place to start:-EN/IEC 60950-1-EN/IEC 61000-4-5-EN/IEC 61000-4-4For something you want to sell you don't want to settle for anything less.Solutions for what you try achieve do exist and are called solid state relays. You will find some with MOSFET's made by Panasonic, IXYS, Omron,... But those are only used in well defined environments.To give you an idea about what you might encounter in a not so well defines environment: a simple refrigerator can create an over voltage with enough energy under the right conditions to kill any MOSFET if it's not properly protected.

author: oschonrock
author_rank: Regular Contributor
timestamp: August 03, 2020, 01:37:16 am
content: Quote from: temperance on August 03, 2020, 01:29:05 amThanks. I am well familiar with SSRs. I used to work for Omron a long time ago ;-)They can't turn off half half-way through the cycle to my understanding, so they cannot "duty cycle/ dim etc" , so this is a totally different application.

author: oschonrock
author_rank: Regular Contributor
timestamp: August 03, 2020, 01:38:40 am
content: Quote from: Monkeh on August 03, 2020, 01:13:59 amI am sorry. Not explicit enough. I thought the "zero cross trigger" would be a give away. If I just wanted to turn stuff on/off I would use an SSR.

author: Ian.M
author_rank: Super Contributor
timestamp: August 03, 2020, 01:43:57 am
content: Errrr Guys . . . . . . .Meanwell IRM-02-12Sis a 12V power supply, not a bridge rectifier.Now we've cleared up that confusion, there are three things I don't like about it.1. No suppression of back-EMF spikes from inductive loads. Unless you use avalanche rated MOSFETs you *NEED* a beefy bidirectional TVS diode across the pair of MOSFETs. It may also benefit from a RC snubber to control dV/dt below the TVS breakover voltage.2. Heavy load on the opto + limited CTRR at elevated temperature makes it too easy to get insufficient gate drive if your drive to the opto LED is weak. Unless you can guarantee sharp 10mA drive pulses, it would be a good idea to run the opto with a higher load resistor and add a Schmidt trigger input gate driver between it and the MOSFETs.3. That simple ZC opto circuit is going to give a rather mushy ZC pulse. You may wish to consider using one of the many snap-action active ZC detector circuits, possibly separate ones for rising and falling zero crossing Their optoisolator phototransistors can always be paralleled if you don't want to discriminate between the crossing directions.Adding load current monitoring could also be rather useful. It also opens up the possibility of protecting the MOSFETs by detecting over-current and rapidly driving the gates off, then locking out the drive till the next ZC pulse. Some additional inductance in series with the load may be required to give the over-current trip time to react.

author: oschonrock
author_rank: Regular Contributor
timestamp: August 03, 2020, 01:44:37 am
content: Quote from: BrianHG on August 03, 2020, 12:34:05 amActually these devices are new to me. You mean this yes?https://www.vishay.com/docs/83469/vom1271.pdfNot cheap, and not sooo available (yet?), but they look fab! I can ditch the whole annoying isolated 12V SMPS! Not sure of the limitations yet, ie I suspect that they top out at a certain size MOSFET? Too much energy required to switch efficiently - gate capacitance?Thank you. That might really move it forward.

author: BrianHG
author_rank: Super Contributor
timestamp: August 03, 2020, 01:45:31 am
content: Quote from: oschonrock on August 03, 2020, 01:08:41 amYou know, any low voltage, IE 15 vin 15v out transformer. Put AC 15v in and get AC 15v out, galvanically isolated.Some people find or have custom transformers made. Some use telecom transformers or network transformers. It might make you like easier just to use an isolated DC-DC converter, 5v in, 15v out.You can have one designed with 1 primary and 2 secondary, to be used in conjunction to power a true high speed optocoupled mosfet gate driver which drives the gate high and low, like a logic gate output. Such a device is designed for high speed switching, but you would also need 2 of them for each gate.This is what a 2 channel HV isolation driver looks like. Though, you would be wiring the output a little differently and the input side would need inverted inputs.https://www.mouser.com/ProductDetail/Texas-Instruments/UCC21220ADR?qs=qSfuJ%252Bfl%2Fd5KgCu6IE%2FAWg%3D%3DWith 40ns delay and 5ns switching, you may now officially PWM cleanly into the 100KHz region, maybe 1MHz.But, the HV side needs a continuous clean +/-15v isolated DC-DC power supply to create the +/- gate voltages centered from the mosfet's central 'source'. Something like this:https://www.mouser.com/ProductDetail/Cincon/EC1SA05N?qs=%2Fha2pyFaduhjhDCN%2Fb9F8eSzvtBCYVIMWKpaSLbxmGc%3DOtherwise you would need 2 of your power supplies, one for each gate.Now, I need not say that you need to know what you are doing at every junction and how things function at high AC mains voltages, otherwise, such a project could end in electrical shock or fire.

author: oschonrock
author_rank: Regular Contributor
timestamp: August 03, 2020, 01:50:14 am
content: Quote from: Ian.M on August 03, 2020, 01:43:57 amOh, is that where the rectifier came from. Thanks for clearing that up, and sorry to cause confusing. Note to self: Give more verbose description of circuit.Quote from: Ian.M on August 03, 2020, 01:43:57 amThese are all super useful. Thanks and I agree. I don't quite understand point number 3. Will look into that. Or do you have a useful link?Do you have experience with those photovoltaics? like that VOM1271 in above post? Looks almost too good to be true? How can that have enough energy to switch properly? Even with the 12V SMPS in there you make some valid point about snappy efficient switching...so these photowhatsits...??

author: BrianHG
author_rank: Super Contributor
timestamp: August 03, 2020, 01:52:02 am
content: Quote from: oschonrock on August 03, 2020, 01:44:37 amThose are great for ON-OFF switching and chopping, but useless for multi-KHz high speed PWM. For high speed PWM throughout the sine wave, you need the item I listed in 1 post above.They are only $1.67 each (for 10) here: (~1$ or less in significant quantity)https://www.ttiinc.com/content/ttiinc/en/apps/part-detail.html?mfrShortname=VOP&partsNumber=VOM1271T&autoRedirect=true&minQty=2000At that price, plus you don't need that 12v power supply, you save money by using 2 of these, 1 for each gate. Remember, they guarantee a minimum of 7.8v for your gate voltage, so, choose your mosfet wisely, or run 2 in series.Remember, with these optos, you want to drive the LED with 30-50ma each, that's 60-100ma total for both. This means coming out of your UC, I would add a transistor or strong small mosfet (one of those cheap 1.2amp sot23 logic level mosfets) with 2 separate series resistors on the drains to drive each opto.

author: oschonrock
author_rank: Regular Contributor
timestamp: August 03, 2020, 02:04:40 am
content: Yeah, the gate transformers what I thought, and had seen that before, don't fancy it.But this:Quote from: BrianHG on August 03, 2020, 01:45:31 amThat looks like a "proper" solution. These are the sorts of drivers that will give this much more flexibility in terms of switching strategies.That little power supply is quite fine. It would be annoying to gave to use it in addition to the 230VAC SMPS I have there already, but if I "require" 5V on the "safe right-hand side" of the schematics and use that - by relying on the 1000V insolation which that little block provides...then that's a gain. ..?

author: BrianHG
author_rank: Super Contributor
timestamp: August 03, 2020, 02:10:03 am
content: Quote from: oschonrock on August 03, 2020, 02:04:40 amYou can find 240v side supplies which have a center-tap +/-15v output.That TI chip drives the gate both high and low with a good 4amp surge making a true high frequency switching solution possible and 15v means the cheap bottom end mosfets will be completely turned on and off. Since you arent driving the output 2-n channels shorting a DC output high and low, you only need a series resistor of something like 20ohm between each TI chip output and each gate of each mosfet.The TI chip is only rated 3KVrms for 1 minute only between logic side and the isolated sides.That little supply is rated 1kv minimum continuous. I think that the TI chip is also only 1kv continuous.

author: oschonrock
author_rank: Regular Contributor
timestamp: August 03, 2020, 02:14:20 am
content: Quote from: BrianHG on August 03, 2020, 01:52:02 amYeah that makes total sense. 2 good options there.1. photovoltaics for chopping (lose the SMPS), or2. +/-15V isolated supply powered from low side with a HF MOSFET driver (not much more expensive either) to add PWM capability as wellBoth are better than what I have. Thank you.

author: oschonrock
author_rank: Regular Contributor
timestamp: August 03, 2020, 02:28:55 am
content: Quote from: BrianHG on August 03, 2020, 02:10:03 amPhew...Too many parts.... Link? I agree that might be better. More robust and fewer bridges across the isolation.Quote from: BrianHG on August 03, 2020, 02:10:03 amYeah this is what we want. Also means I can easily produce multiple versions of this thing with different MOSFET ratings. 100W -> 2.5kW @ 240VAC. That driver will laugh at all those.Quote from: BrianHG on August 03, 2020, 02:10:03 amYou mean I don't need shoot though prevention...? Or you mean high-side bootstrap?Can ditch the optocoupler too...obviouslyThe uC now needs to provide 2 coordinated signals, but has total control for all switching / chopping / PWM strategies?Thank you. This has been very helpful.

author: oschonrock
author_rank: Regular Contributor
timestamp: August 03, 2020, 02:43:20 am
content: Quote from: oschonrock on August 03, 2020, 02:28:55 amThis works. Bit overkill at 340mA and expensive @ £8-9 each.https://uk.farnell.com/recom-power/rac10-15dk-277/power-supply-ac-dc-2-o-p-10w/dp/2822844If anyone has better options let me know.

author: BrianHG
author_rank: Super Contributor
timestamp: August 03, 2020, 03:03:28 am
content: According to your circuit, your making an AC PWM on/off switch, not a variable output DC PWM supply.A variable DC PWM output supply has a topology where when you turn on the low side and high side mosfet simultaneously, you short the V+ rail to your GND. You are not making this, so in the TI datasheet, the example circuit on page 1 with the added diodes and resistors to tame the turn on and turn off speed do not apply to your design as both mosfets are either on, or off at the same time. All you need is a series resistor from each output to each gate.I made a little mistake, you only need 1 cheaper single DC-DC 15v isolated converter and a single mosfet driver as your mosfet sources are connected together. You only need to go from 0v to 15v from the 'source' on both.In this case, here you go, faster & cheaper & 3.75kv isolation: (remember, best to have a series resistor on the output pin driving the gates as you shouldn't drive them with an absolute 4 amp 8ns fall time pulse.)https://www.digikey.com/product-detail/en/silicon-labs/SI8261AAC-C-ISR/336-4490-1-ND/8540659Plus here is the cheapest isolated 3kv DC-DC converter:(Digikey Datasheet typo, this guy is only 1.5kv rated.)https://www.digikey.com/product-detail/en/cui-inc/PDSE1-S5-S15-S/102-6294-ND/10229829I have better faith in this one rated at 3kv isolation:(This one is authentic 3kv isolation for only a few cents more)https://www.digikey.com/product-detail/en/cui-inc/PEME1-S5-S15-S/102-6340-ND/10229875(You may need a parallel 15.2-16v zener diode on the output of these DC-DC converter as they have a minimum load of 7ma, otherwise the voltage may creep above the spec 15v.)

author: BrianHG
author_rank: Super Contributor
timestamp: August 03, 2020, 03:34:41 am
content: 4 amp output version of the silicon labs gate driver IC:https://www.digikey.com/product-detail/en/silicon-labs/SI8261BBC-C-ISR/336-5208-1-ND/9175803Only ~13 cents more.BTW, my above change means you only need 1 photovoltaic optoisolator as well, or 2 in series to get 15v output gate drive.

author: wizard69
author_rank: Super Contributor
timestamp: August 03, 2020, 03:43:58 am
content: Quote from: oschonrock on August 03, 2020, 12:19:32 amI know it is old fashion but why not use a relay? Use an opto isolator to turn in on that can drive the coil directly.QuoteI'm not here to call it flawed but do question if it make sense in this use case. If I understand your goals, the idea is to sell this to people that might have any sort of use you can imagine. So why not make it as simple and rugged as is possible? Frankly an ideal device would take a 5 VDC signal at what ever current the opto requires and that is it.QuoteI look at something like this and frankly don't see a Sane reason to use any sort of solid state switch to drive the output. This mainly because you have no idea what the load will be.

author: BrianHG
author_rank: Super Contributor
timestamp: August 03, 2020, 03:48:25 am
content: https://www.digikey.com/product-detail/en/recom-power/RAC03-15SK/945-3443-ND/10131802Still not as cheap as the dc-dc converter.

author: oschonrock
author_rank: Regular Contributor
timestamp: August 03, 2020, 09:44:52 am
content: Quote from: BrianHG on August 03, 2020, 03:03:28 amYes, that's the intention. ie, I am not making an AC motor drive. They have a full rectification stage first then a DC bus with huge caps and then an H-Bridge type switch topology. The advantage of that is that they can make AC of any frequency, hence "variable speed drive". My circuit can't do that. All it can do is operate in three modes (I know you have understood this, but I am catching up on what was clearly an inadequate circuit description in original post which caused confusion):1. ON / OFF multi cycle period (say 1-2 seconds), the uP can (optionally) do the careful timing to ensure it switches the MOSFETs off during zero cross and hence causes less harmonics ... doing the job of an SSR - if this is all I wanted I should use an SSR - this is the relatively trivial part2. What is often referred to as chopping / dimming / phase angle switching etc. Means turning the devices on / off once per 50/60Hz half-cycle. This can be done on the leading edge, ie wait after zero cross before switching on, or on the trailing edge, ie turn the devices off early before the half cycle completes. The former (ie leading edge) is what triac based dimmers do, but they can't do trailing edge which has advantages in many circumstances.3. PWM of the sine wave at frequencies of multiple kilohertz. This is different to the AC variable speed motor drive because it is not switching DC to make AC of any frequency, it is switching the AC sine wave. That means we can "vary the effective amplitude" of the sine wave, but we cannot change it's frequency.So proper induction motor control is beyond the scope of this "research break out board". It's purpose is to introduce hobbyists / students to the various kinds of AC switching you can do. It should be able to demonstrate the above 3 modes. The purpose is to educate and provide information on strengths weaknesses, from a "ready made box" which can do all 3 modes and be safe. Someone above mentioned current/voltage monitoring and that would be a great addition. Non-trivial due to the isolation requirements, but I might need to go there.(I might edit original post to put this description there)So yes, the 2 MOSFETs will always "switch on at the same time". Actually that is not quite correct. In the "upper half cycle" (when Vline > Vneutral the lower MOSFET on my schematic (Q2) will be in "body diode bypass", ie whatever you send to its gate is irrelevant. In that upper half cycle the "triggering which is important is on Q1. In the lower half cycle, the roles are reversed.Now my original circuit with the optocoupler & +12V supply referenced to joined sources and that pull down resistor meant that the uP didn't have to care which half cycle it was in. It would just look at the zero cross info from U1 and decide when to trigger U2 - upper or lower half cycle, don't care.Your suggestion for a proper MOSFET driver is very good, just what I was looking for, and will be needed to achieve Mode3 = PWM > 1kHz. However we are now talking about separate +/-15V gate triggers... (maybe not...see below)Quote from: BrianHG on August 03, 2020, 03:03:28 amLet me paraphrase for clarity. I initially understood your requirement for a +/-15V supply like this: Output stages of a driver like the UCC21220 are "functionally isolated from each other". ie they have VDDA/OUTA/VSSA and quite separately VDDB/OUTB/VSSB. in this case the sources are linked and therefore we would therefore join VSSB and VSSA together. I had originally thought: "Ah but we need to trigger one with +15V and one with -15V", but I am now realising (the same as you did?), that because they are both N-Channel devices and the gate we care about (ie the one which needs triggering, and not the one in body diode conduction) will always need a "positive trigger relative to the common sources".Have I understood this correctly and am I correct in thinking that feeding what will be "an effectively -15V pulse" to the "non-active device in body diode conduction" will not bother that device at all...? It's "off", and turning it off some more, is still off. Do you have a part number for an equivalent single driver? Is it "normal" to use an isolated driver like this, on 2 MOSFETs, one of which has reverse Vds on it? I suspect it's not very common - except in high power trailing edge dimmers perhaps. Does it matter?So then yes. single driver and single +15V auxiliary, isolated SMPS. Much easier - and actually kind of rather similar to what I had orginally, but with a proper driver which includes the job of the U2 optocoupler and drives the gates much more competently, allowing "HF" switching, and hence PWM.Thanks for the links to the SMPSs - easier now as you say. Some great options there.Sorry for the long post. More words = more clarity...?

author: oschonrock
author_rank: Regular Contributor
timestamp: August 03, 2020, 10:02:55 am
content: Quote from: wizard69 on August 03, 2020, 03:43:58 amI am sorry, I now realise that my original post had insufficient detail of what the purpose of this circuit was and how it is intended to operate. I have now put a fuller description of those things in the OP.I am also not yet clear "whether I want to sell this". It is an area of research which interests me, and on which I see many videos/blogs which do many things wrong or are even outright dangerous. So if ultimately people find it interesting and want to "buy something", sure, maybe... but it's not yet a goal as such. In fact, as you correctly point out, I don't know what the load will be and the whole point is to demonstrate how different loads respond to the different modes of operation (see updated description in OP). So whatever the final design, it will not be "optimised for the load", so it will necessarily fall short of a custom design for a particular type of load in either cost or performance or both.

author: BrianHG
author_rank: Super Contributor
timestamp: August 03, 2020, 01:27:48 pm
content: Quote from: oschonrock on August 03, 2020, 09:44:52 amNo, it is important that both mosfets are on. Relying on a body diode means a 1v to 1.5v drop in high current applications.Say 2.5kw switch. 1.5v drop x 10 amp means 15 watts of heat generated on an off mosfet while using it's body diode to conduct current. Having a rugged mosfet turned on in this case means when using something like a 'STB40N60M2' at 88mOhm on means a 0.88v drop at 10 amps generating only 8 watts of heat. Also, with high frequency load transients, that mosfet body diode may switch on and off adding a degree of signal noise while having the mosfet off relying on that internal diode, with the mosfet on, it acts like a fixed resistor conducting current swing transients in both directions, IE, no 1v crossover glitch.

author: BrianHG
author_rank: Super Contributor
timestamp: August 03, 2020, 01:37:50 pm
content: Quote from: oschonrock on August 03, 2020, 09:44:52 amNo I was mistaken. Since both mosfet 'sources' are wired together, and they are both N-channel mosfets, the only valid gate voltage between both gates and sources is 0v for off, 15v for on. You only need one isolated single 15v supply & a single isolated gate driver hence my additional posts with the new silicon labs IC and single supplies, both DC-DC and 240v AC-DC. (My innitial comment was for an isolated gate drive each going their own way. Use for a completely different application)See top left diagram on page 5, 'Bidirectional MOSFET Driver Application' of the Vishay VOM1271 Photodiode Output Optocouplers.

author: oschonrock
author_rank: Regular Contributor
timestamp: August 03, 2020, 02:24:57 pm
content: Quote from: BrianHG on August 03, 2020, 01:37:50 pmYes. That is the exact topology I sketched in my original circuit isn't it?I found it confusing to:a) realise that the MOSFET will conduct "in reverse" if you just keep its gate positive with respect to source (a BJT would never do that obviously, and this also answers the MOSFET vs IGBT question for this application. IGBT would require external diode at minimum) - so yes, not body diode, but just "ON" for the one which is "in reverse" (and the other one obviously)b) the way those circuits are physically drawn on the page screws with my head.Something about the floating supply and having centre between the sources "grounded" with respect to that floating supply, if you understand what I mean...So all sorted then. They will just both be "on" for the whole time while we give the driver a high (I just didn't realise that was possible and was therefore relying on the body diode in my thinking)Last problem: I can't find a single channel isolated driver which I can actually buy. TI's page for example has just 6 parts if you select MOSFET, isolated and 1 channel.https://www.ti.com/power-management/gate-drivers/products.html#o7=Isolated%20gate%20drivers&p1250=MOSFET&p480=1and none of those are available in the UK, it appears.I could just use that 2 channel half bridge one for the prototype. ...?https://uk.farnell.com/texas-instruments/ucc21220d/dual-gate-driver-half-bridge-soic/dp/2843000

author: BrianHG
author_rank: Super Contributor
timestamp: August 03, 2020, 04:15:35 pm
content: These arent as fast, but they are cheaper and available and you can still do over 25KHz PWM with them. Plus they are optical coupling instead of capacitive. This means 500ns delay from in to out, but they still have a good +/- 2.5amp drive with a 35ns rise and fall output and they are less than half the price of the TI parts.VOD3120ADFarnel has stock.

author: oschonrock
author_rank: Regular Contributor
timestamp: August 03, 2020, 05:43:55 pm
content: Quote from: BrianHG on August 03, 2020, 04:15:35 pmNice one thanks. DIP....sigh. Nice for prototype though.25kHz PWM is totally excessive. We are not "modulating DC with a sine wave", for which you need maybe 15kHz to do it nicely. But we are just "dimming" an already existing sine wave for which you need, maybe, generously, 100x fundamental ie 5kHz. That's switching every 1.8degrees of phase! More than enough. Only advantage in going higher would be to get above audio and 20kHz would be totally sufficient for that.How are you working out what PWM switching frequency we can get out of a MOSFET given a specific driver? It's been 30yrs since I have done those calcs. Ultimately down to thermal power dissipation during switching time based on the available charge from the driver? Experience + dark art or something more quantitative?

author: BrianHG
author_rank: Super Contributor
timestamp: August 03, 2020, 05:55:36 pm
content: Quote from: oschonrock on August 03, 2020, 05:43:55 pmThere are others here far better suited to help you there. All my designs to date have over 10x headroom on switching the mosfets, so I mostly rely on simple on-resistance and current calculation.That virshay driver can do 100KHz if you look at the specs, but my head-room practice made me quote you the 25KHz figure. If you ever made anything down at 15KHz, I would never buy it because my ears would go nuts from coil-whine. Many old TVs drove me nuts & I already had a scan-doubled 31Khz large screen TV back in the early 90's when they were in they were over 15K$ (ouch to my pocketbook, but I had peace and silence). Though I can no longer hear 25KHz, I remember as a kid I could hear all the ultrasonic alarms in the shopping malls and it drove me nuts as my parents couldn't hear a thing. I have no interest in affecting children's hearing, so 25Khz is the absolute bottom I would allow in any of my designs.

author: oschonrock
author_rank: Regular Contributor
timestamp: August 03, 2020, 06:02:27 pm
content: Quote from: BrianHG on August 03, 2020, 05:55:36 pmI was starting with what is necessary to drive the load smoothly and without too many harmonics that don't get filtered by the inductors. So the industrial approach (which is my background). Small VSDs are generally 15kHz tops, that's why I picked that figure and since the amplitude is already modulated we wouldn't need even that. That's where my estimates came from. Humans didn't come into my thinking except for an afterthought. In a factory a bit of extra VSD whine just adds to ambiance!Wow, you have some super good ears there. BUT, since you've been so super helpful, I promise if this ever turns into a product, it shall have nothing less than 25kHz switching frequency for the Mode3 PWM.

author: BrianHG
author_rank: Super Contributor
timestamp: August 03, 2020, 06:14:42 pm
content: LOL, Future Electronics has the SMD version VOD3120AB available at 0.76$ each, or 0.58£.

author: hli
author_rank: Frequent Contributor
timestamp: August 04, 2020, 01:49:57 pm
content: If one needs a EU-style plug, Olimex has you covered:https://www.olimex.com/Products/Duino/Shields/PWR-SWITCH/

author: oschonrock
author_rank: Regular Contributor
timestamp: August 04, 2020, 01:58:32 pm
content: Quote from: hli on August 04, 2020, 01:49:57 pmThat's a cool thing, and very well priced. Not much detail about "what mode of switching it supports" (see more verbose explanation of the "3 modes" in OP at top).If I were to guess, it's probably mode1, ie that thing is an SSR in a cool box? And it can switch on zero cross only?but yeah, I was mentally playing with how to make it physically convenient and safe. Various boxes with plugs did occur to me.So thank you.

author: oschonrock
author_rank: Regular Contributor
timestamp: August 11, 2020, 05:57:14 pm
content: Quote from: BrianHG on August 03, 2020, 06:14:42 pmThe prototype is working. I made a 2 channel version and that turned out to be a good thing...see below. Here is a pic...I have connected it up to a pic18 and have it doing basic switching, leading edge and trailing edge dimming (ie modes 1 + 2, explained in OP above). Very good and very smooth. Currently working on mode3.I had one major hickup in that the VOD3120 has a 12V UVLO and I used a floating 12V SMPS (because the 15V was out of stock). That didn't work, so I am currently letting my bench supply float up and being very careful. This is about to change anyway, see below..Few improvements:1. Changing it to switch the phase and not the neutral. This was a silly mistake and makes no difference if we are using fully isolated supply and driver anyway. ---2. I realised that for switching significantly inductive loads (which was a major objective, see top) I need a free wheeling solution, and it's non trivial. Unlike in an H-Bridge where the body diodes naturally help you to create freewheeling paths, this back to back MOSFET topology doesn't help at all - it just blocks it all, so major spikes would ensue. I have only switched resistive loads so far for this reason, because I suspect that I would just blow up the MOSFETs or stress out the MOVs. Proposed design for solution below.So for inductive load freewheeling, I have decided to try a second back-to-back MOSFET pair (directly across the load) and trigger it (carefully!) when the main pair is off. revised schematic is below.Because I have 2 MOSFET pairs in my prototype I can just rewire this to the above, and use 2x mini 5V->15V isolated DC-DC convertershttps://uk.farnell.com/recom-power/roe-0515s/dc-dc-converter-15v-0-066a/dp/2846315to generate the now 2 floating supplies we need. These, together, are actually cheaper and significantly smaller than the single 1W PCB mount SMPS in the picture below.Looking around for cases and started ordering some samples. I am going for "lab use" here. So a robust, standards based and serviceable enclosure / termination. Suggestions very welcome. I am currently leaning towards one of these cases (my estimated power dissipation is ~10W at full 10A / 240 VAC load):https://uk.farnell.com/hammond/1455nhd1201bk/enclosure-wall-mount-aluminium/dp/2904319And these male and female IEC connectors for supply and load:https://uk.farnell.com/bulgin/px0580-pc/iec-c14-inlet-pcb-10a-250v-flange/dp/313853https://uk.farnell.com/bulgin/px0675-pc/outlet-iec-pcb/dp/151748I thought these IEC connectors are tough enough and standard enough to work anywhere and on the load side people can cheaply buy a converter for their country:https://www.amazon.co.uk/Power-cable-IEC-plug-socket/dp/B005FWRHNQ, if they want a regular outlet.The idea is to bolt the 4 MOSFETS to the floor of the case using the provided half-nut slots. Power inlet & outlet in the end plates and indicators,controls and low voltage interfaces (possibly canbus or similar), in the top panel. Does anyone know a safe way to provide HV probe points from outside the case, in case the user wants to hook up their oscilloscope..?Any suggestions for better enclosures/solutions very welcome, this is the part I struggled with the most. There is work to do on EMC filtering too.