EveryCircuit
Contact
Reviews
Home
thebugger
modified 2 years ago

Live-Neutral Reversal Protection v2.0

3
26
323
03:21:22
Hey guys, I was working on a safe non-Isolated mains power supply (mostly for tube projects) and this is what I came up with. This time, the whole thing comes with a neutral/live reversal protection, and since this part of the circuit relies on a proper ground connection on the third pin in the outlet, I've added a ground detector circuit as well, which will indicate whether the ground pin is connected indeed to ground, or reversed with live. As rare as that can be, it is very dangerous with this circuit, as the relays will seek to reverse the live/neutral improperly. The first part of the circuit can be simulated with the upper switch. It simulates a live/neutral reversal in the outlet, which is the exact reason why non-Isolated power supplies are not used. Such a reversal may make the chassis of the whole device running at mains voltage. An accidental touch is an electrocution hazard. The second part of the circuit is a bit more interesting. The multi-stage transistor setup acts as an extremely high gain current amplifier. The 1pF capacitor is actually a parasitic connection between the amplifier and ground, which occurs naturally between any object and ground. If the power outlet is truly grounded, the LED will not be lit. Closing the lower switch simulates a faulty ground, which will be indicated by the LED. This means you need to check the power outlet connections before proceeding to work with the device, as it is 100% hot at the moment. P.S. Lower relay is not a part of the circuit, just needed to simulate ground reversal properly.
published 3 years ago
jason9
3 years ago
Hey I made this circuit and I would like to know what you think of it: http://everycircuit.com/circuit/6629918424956928
thebugger
3 years ago
Use this instead - https://www.lz2gl.com/data/power-inverter-3kw/eg8010_datasheet_en.pdf
thebugger
3 years ago
Class D amps become unstable when you apply negative feedback taken after the LC filter, as it adds a lot of phase shift on some frequencies. The device can easily turn into an oscillator this way. The general principle of your idea is good, and similar topologies are used in the example I gave above, but much more sophisticated feedbacks are used to keep voltage, current and temperature in check.
thebugger
3 years ago
The board in the datasheet is very cheap and requires only a handful of external components. Also, it gives you a choice to use a step up transformer instead of switching the MOSFETs at 200V. Most high voltage MOSFETs have a high Rds on, and in your example, they'll be hard switching at 13-14A/200V. Not that it's a problem, you just have to time your dead time switch shift very accurately to prevent shoot-through, which requires additional external components. Any shoot-through at these voltages and currents will burn out the MOSFETs.
jason9
3 years ago
I haven’t really looked much at that data sheet, but a quick glance seems to suggest it’s very complicated internally. That’s not to say there’s anything wrong with that, but simple things are nice. When I made my circuit, I made sure to pay special attention to the filtering to avoid oscillation and as far as the sim goes, it works. You can see the step response by replacing the 60Hz source with a 0 to 10V square wave source. The green does ring a fair bit, and the blue a little, but it doesn’t take too long to die down, and the green trace is inside the filter anyway so it doesn’t matter much what it does as long as the oscillations stay within the confines of the filter. Also I did just now realize a way to make a better filter which I’ll post soon and it allows the inverter to react much quicker and maintain the same or even a better step response in terms of ringing. Of course a pure LC filter would be plagued by endless resonance problems, but with some RC networks added in to provide resistance and damping to high frequency signals without touching the main 60Hz signal I can overcome the resonance issue while maintaining the desirable properties of an LC filter. Regarding shoot-through, that shouldn’t be a problem given how I’ve hooked up the transistors. With the topology I’m using it shouldn’t be possible for both sides to conduct at once except for a very short period of time due to residual charge carriers, but I calculated how much power that would dissipate and it was acceptable, although unfortunately I don’t remember what the number was. Ignoring the complexities of residual charge carriers and such, there should be a slight dead time which means the diodes will have to switch fast enough to catch the inductor’s back EMF but assuming they can do that there shouldn’t be any problems. In the worst case scenario I’ll just have to add a small capacitor between the red wire and ground to limit the voltage swing speed to give time for the diodes to react, but the inductor’s self-capacitance will probably be enough.
jason9
3 years ago
I did consider using a lower voltage and a transformer, but that would mean a far greater current and I already have a lot of current flowing through so I wasn’t so comfortable increasing it any further. Plus if I halve the voltage and double the current, then even if that halves the MOSFET resistance it’ll still overall double the power dissipation. So, if anything the right move to minimize power dissipation is to increase the voltage and use a step-down transformer, but of course 200V is already very high so it might not be too practical to increase it further.
jason9
3 years ago
Actually never mind about the better filter. I tested it without a load and it doesn’t work at all. It oscillated unless given a very low resistance load (~4.5Ω or less) and only worked so well because the load was 4.4Ω. The old filter still works though, but of course is much more sluggish (as is apparently necessary to avoid oscillation when unloaded).
thebugger
3 years ago
Just go with the board - in this case simpler is not better
thebugger
3 years ago
Also, don't underestimate shoot-through. Your power transistors can fuse instantly
jason9
3 years ago
Well, I guess it’s not so much the simplicity that I’m looking for (although it is nice) but that I just want to design this and have it work instead of being told to forget it and go with a mass-produced product.
jason9
3 years ago
As I mentioned above, shoot-through should be impossible with this topology. Since the gates are tied together either one of the transistors is on or neither one is. It’s impossible for both to be on at once. This leaves only residual carrier conductance, and I found a paper online detailing the behavior of IGBTs when switched off rapidly at high currents and using the provided time-current graph I measured how many extra coulombs flowed and then I multiplied that by 400V and 40kHz to get the power dissipation and it was a very reasonable amount. I forget how much but maybe 50W or something.
thebugger
3 years ago
Okay, build it and see it blow... I don't know what to say. A lot of stuff are not okay with the topology
sthe
3 years ago
Dr Police Station in
jason9
3 years ago
Well, I don’t have any components so I can’t build it unfortunately. Can you tell me what’s not ok with it? So far you’ve mentioned shoot-through and and feedback instability, but the sim disproves feedback instability and I don’t see how shoot through is possible except of course for residual carriers as I mentioned. Can you tell me how you think shoot through might happen and/or any other issues you see?
thebugger
3 years ago
Sorry for the last comment - it was a bit snappy on my end. Generally, feedback instability can be caused by almost anything in a given circuit. Even simple emitter followers have the inherent ability to oscillate at GHz frequencies if left uncompensated. As I mentioned, the LC filter creates a pole in the circuit. Any LC filter will have a fundamental resonant point, and also multiple parasitic resonant points. Taking a negative feedback from the LC tank's output (uncompensated), will promote it to resonate irregardless of dampening and loading. To truly suppress this resonant point, I would suggest integrating the output after the LC filter, with a filtered output taken from the switching node of the transistors. This integration should (in theory) increase the negative feedback at any other frequencies other than the intended switching frequency. I will show this with an example soon. As for the shoot-through, please don't underestimate this effect ever. Let me give you an example. Using an IRF740, it will have a turn off delay of 50ns. A switching frequency of 20kHz for instance, means a period of 50us. In this case, the IRF740 would stay fully conducting for 1/1000 of the whole period, at full Vds voltage. So far so good. At 0.55ohm and 400V drain to source voltage, you'd be trying to conduct 730A through the MOSFET. If you check the Irf740 datasheet, you can see that such conditions are not safe at any given duration. Such currents are enough to weld any transistor in a permanently closed or opened state. At this point, God may have mercy on your fuses. Also, if you choose to fully ignore this safe operation rating, you can view this as a huge (and unnecessary) power dissipation. At 400V/730A/0.55ohm/ 1/1000 duration, you'd be wasting 400Vx730A = 292kW. Even at 1/1000 of this rating (accounting for the period), that's still ≈300W dissipation per transistor. Such dissipation is not efficient, nor permittable according to the transistor datasheet.
jason9
3 years ago
Actually, I do integrate the output by means of a very low cut-off frequency single capacitor RC filter. When I mentioned the improved filter earlier, the main advantage was that it appeared to work without the integrating capacitor thereby vastly improving the response time, but it turned out to not be so (oscillates like you said unless heavily loaded). However, it still works better than the original if I keep the integrating capacitor. As long as the OP-amp (or equivalent circuit) doesn’t oscillate there should be no way for harmful oscillations to occur, and any parasitic oscillation will be well above the switching frequency. Also, regarding that turn-off time, it doesn’t necessarily maintain the same resistance during the turn off period, or even at any point. According to a graph I found in an online paper, during the turn off time it initially conducted exactly half of the current before turning off and that exponentially decayed to zero current even though the collector-emitter voltage jumped instantly to 400V, so it shouldn’t be possible to conduct more current than it did while on even if the voltage at the emitter changes drastically before it has a chance to fully switch off. You can look at the graph yourself on page 7 here: https://www.infineon.com/dgdl/Infineon-IGBT_Characteristics-AN-v01_00-EN.pdf?fileId=5546d462533600a40153559f8d921224
jason9
3 years ago
The LC filter has a cutoff (and therefore resonance) of approximately 3kHz and the RC integrator has a time constant of 3ms which gives a cutoff of ~300Hz so it should be pretty close to an ideal resonance.
jason9
3 years ago
*ideal integrator not resonance
thebugger
3 years ago
After-filter feedback triggers a resonance response due to phase shift, not the underdamped spike at the fundamental frequency. If you're going with it this way, try to design the RC filter to restore the phase shift of the LC filter, rather than amplitude correction.
jason9
3 years ago
Oscillation occurs when there is a frequency with a feedback loop gain greater than unity and a phase shift of 360° or some multiple. The RC network adds 90° phase shift which does bring it closer to 360°, but at the same time it’s a low-pass filter and sufficiently attenuates the signal at the frequency where it adds much phase shift so that while it may shift a total of 360° the overall gain is less than unity and it can’t oscillate. If I reconfigured the filter to add -90° it would be a high-pass filter which would be no good.
thebugger
3 years ago
Look, we've had this discussion before. Build it and see how it works. For me, the design needs much improving.
thebugger
3 years ago
By the way, try working it out with AGC instead of AC feedback. Usually, you won't need a perfect sinusoid, however AGC can help with peak limiting.
jason9
3 years ago
Well, I wish I could build it, but as I’ve said that’s not possible for me. Given that I’m limited to the realm of EC, AGC is difficult/impossible (I really wish @Igor would add analog multipliers). It would work well by eliminating any direct feedback while also keeping the amplitude constant and as such is a good idea, but I do also want to try using direct feedback just for the sake of doing it the hard way and showing that it can still work. Unfortunately, I don’t think there’s much more to be said as the only next step is to build it, which I can’t do.
thebugger
3 years ago
Exactly, find an AGC circuit online, and incorporate it into your design. An AC negative feedback can be taken from the switching node of the transistors and integrated even by a simple RC filter. In fact, knowing that your desired AC frequency is at 50Hz, you can use a notch filter to suppress any other frequencies that may bring a phase shift with them. Again, this is if you're using the switching node. AC feedback after the filter requires you to supress some high frequency components, and keeping a relatively stable phase shift, so it's not a good option to use a notch filter there.
jason9
3 years ago
It shouldn’t matter if the signal is taken after the filter because an integrator will already filter out any and all high-frequency components that may have unwanted phase shifts. At the frequencies where the integrator will pass the signal the LC filter is so deep into the passband that it effectively just becomes an inductor.
thebugger
3 years ago
If I can give a personal advise - start working on projects outside of EC. An ideal environment is far from reality. You're not thinking about switching noise, exciting parasitic resonance points in the LC filter. The shoot-through will also be a problem, trust me. Stuff like that, which you don't meet in EC
jason9
3 years ago
I wish I could, but I don’t have any resources to do so. And I made sure to put in plenty of damping in the filter in the higher frequencies specifically to absorb any unwanted excitations of resonances. But if shoot through is really that much of a problem for you, then maybe you’re right, but I can’t build it so I can’t know for sure.

EveryCircuit is an easy to use, highly interactive circuit simulator and schematic capture tool. Real-time circuit simulation, interactivity, and dynamic visualization make it a must have application for professionals and academia. EveryCircuit user community has collaboratively created the largest searchable library of circuit designs. EveryCircuit app runs online in popular browsers and on mobile phones and tablets, enabling you to capture design ideas and learn electronics on the go.

Copyright © 2025 by MuseMaze, Inc.     Terms of use     Privacy policy