Here is my Self oscillating critical conduction flyback converter in LTSpice - Page 1
Forum section: electronics / projects

author: Konkedout
author_rank: Frequent Contributor
timestamp: December 31, 2024, 07:01:40 am
content: Some days ago, there was another post on this forum trying to make sense of this sort of converter. I designed a bunch of them during the 1980s and 1990s but that was hardware only. This might be my first reasonable simulation. The circuit design...particularly around the gate drive and drain snubber....is similar to what I used to build.In the real world I would probably have a PI filter in the output due to ESL and ESR in the output capacitors. None of that here.I did this all today; working reasonably well but I am sure there is room for tweak improvements. It is first pass reasonably good but not perfect. One point worthy of note is the extra resistor in the drain snubber. It is an RRCD snubber. This provides better damping for the drain waveform. This is worthwhile because the transformer also provides the gate drive and we do not want to get oscillation around the leakage inductance.I have two loads. The connected one ramps the load up to 7A in steps so that the converter enters current limit. The other load is grounded and is a step load for dynamic load response.I am not an expert on modeling. Older versions of LTSpice had a bunch of Infineon MOSFETs. I did not find a lot of choice in the voltage range and chose an Alpha Omega FET.Rather than say too much about it, I will post it. I encourage anyone interested to run it and ask questions.

author: Zero999
author_rank: Super Contributor
timestamp: December 31, 2024, 05:22:15 pm
content: I found that schematic very difficult to read. Why make the font for some of the idents and value so small? I've rearranged it. Hopefully you'll get more replies now it's easier to read and there's a picture, rather than just an .asc file.It looks similar to a switched mode power supply from an old mobile phone charge I opened awhile ago.What's with I2?

author: Konkedout
author_rank: Frequent Contributor
timestamp: December 31, 2024, 06:12:13 pm
content: Thanks for the response.I find that the default font size in LTSpice is too large so that the text runs over everything. I just make some of them smaller so as to alleviate this issue.WRT I2; as I mentioned I have two loads in there. I2 is a dynamic step load with which I was testing before I connected the step-increase load. With both ends of I2 grounded, it does not affect circuit operation.BTW just after posting I realized that D1 is rated for only 3A, and I am applying loads of up to 7A. Fortunately LTSpice simulations do not smoke or burn. :-)Also I realized that I neglected to include an input bypass capacitor.But I do not think that either one of these has a significant impact on the basic operation of the simulation.Other points: I am not quite satisfied with D7. I was looking for a 600V - 1000V 1A "ultrafast" diode but did not find any in LTSpice. D7 is a "UPSC600" HV Schottky diode from Microsemi. From its ratings I assume it may be a SiC schottky diode but I was unable to easily find a datasheet. But it seems to work OK in the simulation. We definitely do not want a standard recovery type diode at D7. I have smoked those in real life...

author: Zero999
author_rank: Super Contributor
timestamp: December 31, 2024, 06:51:02 pm
content: If the text gets in the way, then move the parts around to make space. It's fine to put the pulse and PWL statements away from the voltage/current sources, if there's a reference next to them. Note that LTSpice also has the option to use a different symbol for COM, an alternative reference point to 0 or ground.The old component models, along with new ones can be found here. If you want to post the schematic here, as one file, then paste the relevant model, as a SPICE directive, into the schematic.https://ltwiki.org/index.php?title=Components_Library_and_Circuits#An_LTspice_Standard_Library_ReplacementEDIT:I forgot to say that, rather than using scientific notation, space can be saved by using SI prefixes, say 10n, rather than 10e-3. I also find it easier to read, but it's personal preference. I semi-automated the process with your schematic by opening it in a text editor and searching/replacing all e-9 with n, e-6 with u etc.Note that SPICE is case insensitive, so M = *10-3, not *106. You can use Meg for *106, but I didn't bother with your schematic because it takes up more space.

author: Konkedout
author_rank: Frequent Contributor
timestamp: December 31, 2024, 08:53:14 pm
content: Thanks.I became fond of engineering notation (such as 3.3e-9) because (not so much with LTSpice) when I output a BOM into Excel, Excel will then take it as a number. In my opinion, that is already somewhat advantageous. I do not need to think twice about 3.3e-9 = 3.3 nF so that is not an issue.In my lab, I sort resistors and capacitors by value, so I can easily sort the BOM by value for the Rs and Cs. When I do that, it saves me a lot of going back and forth between bags of components as I build a board. That streamlines the board build process for me significantly.As for the design itself, I have been adjusting Q2 and C4. First I noticed a lot of D2 current when the FET turns on. That is not desirable; I think Q2 was not turning off fast enough. The converter seems to run without Q2 but I was not surprised to see that it did not current limit at 7A load. The converter also seems to work OK with a 2N4403 at Q2.Under transient conditions I see Peak D2 current of about 700 mA so I want to keep an adequately sized transistor at Q2. Right now I have a 2SAR512 (rated 2A) and that might be a good choice for Q2. It avoids the wasted gate drive I was getting with the D45 type there. (I actually had a few ancient GE made D45C5(??) in green silicone TO-220 with round wire leads.) Right now I have 2.2 nF at C4 and I may be able to reduce that further.I need to check out your advice on those other models. It seems that Rohm has put many of their parts into LTSpice but I am not so familiar with Rohm. I guess that is the reason why Rohm does that. I wish there were more parts in there from ON, Nexperia, Infineon, and DI.Oh.....I am not sure if that is the same page with models from Bordodynov that I was looking at earlier. There was a 20 MB file. But in 3 attempts I could never get past "unconfirmed download". But I do see a bunch of text format models also. Although I have had some success, I have never made general sense of how to import and use models in LTSpice. That is another discussion. But I will see what I can do with that stuff. I have bookmarked your link, so thanks a lot for that.

author: Konkedout
author_rank: Frequent Contributor
timestamp: January 01, 2025, 06:47:33 am
content: I have made a few tweaks to the design:I have changed the transistor type at Q2, reduced C4 and added R15 to improve the gate drive waveforms. C4 too large wastes power in the gate drive circuitry. And now the gate voltage dwells negative by a few volts during the main FET off time....it had not been doing that. The transistor at Q2 appeared to not be turning off fast enough and the new type there seems to have fixed that problem.D1 is now a 7 Amp type.I have reduced C1 and increased R1 to improve the load transient response.

author: Zero999
author_rank: Super Contributor
timestamp: January 01, 2025, 11:14:01 pm
content: Have you done any efficiency calculations?

author: Konkedout
author_rank: Frequent Contributor
timestamp: January 02, 2025, 03:12:24 am
content: No. Of course efficiency is always important these days. But I am not trying to promote this as a design methodology. Of course it would be easy enough to measure Pin and Pout of the simulation.It was a good way to make a power supply when I was doing it during 1980-1995 but it is less competitive now. I was designing power supplies similar to laptop power adapters. In those earlier days the controller ICs drew enough standby current so that you needed to dissipate considerable power in a startup resistor, once a range of input mains voltage was taken into account.More than anything this is an item of interest. You do not absolutely need a controller chip in order to make a flyback power supply that works well. WRT efficiency, the main problem may be at light load. Also they are much bigger than today's designs.More thoughts: This converter type has been termed "critical conduction", "boundary mode", and "ringing choke converter." The idea is that the inductor current goes from 0 to a peak when the switching transistor is shut off and the inductor discharges its energy into the output. When the current ramps down to zero, the inductor voltage resonantly "rings" back and triggers the next turn-on of the main switching transistor. Switching frequency varies inversely with load current. There is a graceful simplicity to the operation. Because the diode conduction is not "forced" off (as in continuous conduction mode) these converters can tolerate diode reverse recovery time (Trr) better than continuous conduction mode converters can.In addition to using it for offline flyback converters first using bipolar switching transistors and then MOSFETs, I have also used the technique for lower power boost and buck-boost converters. I have controlled it with a comparator (such as LM311 and LM393) and have used transistors such as MPSA06 for the main switch. Even if you never use it, it is interesting and worth understanding.

author: SXQ
author_rank: Newbie
timestamp: January 02, 2025, 08:28:47 am
content: I'm new to electronics. Could you explain this schematic in detail?

author: Konkedout
author_rank: Frequent Contributor
timestamp: January 02, 2025, 05:48:56 pm
content: Quote from: SXQ on January 02, 2025, 08:28:47 amI appreciate your interest. But...if you are new to electronics, this switching power converter is not the place to start. I would need to write a book here. Some circuits which appear to be more complicated will actually be simpler to explain.

author: EggertEnjoyer123
author_rank: Frequent Contributor
timestamp: January 03, 2025, 02:32:51 am
content: Quote from: SXQ on January 02, 2025, 08:28:47 amI'll give this a shot even though I don't do power electronics (so I might make a few mistakes).The first thing to understand is how a flyback converter works. In a flyback converter, a magnetic field is stored in the transformer by putting current through the primary. If M1 is off, then it will eventually turn on through R12, which will charge the gate capacitance of the FET. When the primary turns on, the secondary has no current thanks to L3 being reversed and D1 blocking any current from flowing. In a normal transformer, the secondary will try to push current such that it creates a magnetic field which cancels out the magnetic field created by the primary (thanks to Lenz's Law), and the magnetic field in the transformer is low. In a flyback, there is no current in the secondary because of the diode, so the magnetic field is allowed to build up. This also means that the flyback topology can't be used for high power because the transformer will eventually saturate (where no more magnetic field can be generated by putting more current through the transformer). Other topologies which allow current to flow in the secondary and primary at the same time can do higher power because the fields created by the primary and secondary tend to cancel out, and the amount of magnetic field in the transformer is low.The transformer basically acts as an inductor, and the amount of current goes up linearly, since the FET is applying a constant voltage across an inductor. Eventually, the amount of current going through R3 exceeds 0.7V (which would happen at about 2 amps), and Q1 turns on. Q1 and Q2 are a Szilaki pair, basically they act as a transistor with a huge beta. The gate capacitance is shorted to ground through D2 and turns M1 off. Previously, the top of L1 was at a higher voltage than the bottom of L1, which means D1_Anode is at a lower voltage than ground on the secondary side. However, when the FET turns off, the current will try to flow through M1 even though it can't anymore because the transistor is off. This means that the drain of M1 will go to a higher voltage than V1, which means that on the secondary side, D1_Anode is suddenly positive. The stored magnetic field is now allowed to collapse, and most of the energy goes into C2 through D1 (which is now positively biased).Because the drain of M1 could go to a very high voltage during turn-off (and destroy the transistor by exceeding the Vds), a snubber network formed by D7, R13, and C6 is used to absorb any high voltage transients. Any high voltage spikes gets dissipated by R13 and goes towards charging up C6. C6 is slowly discharged back to the supply through R14.L2 serves two purposes. It generates the supply for the optocoupler through D6 and C5 (a bit of the energy in the transformer is stolen to charge up C5 at the beginning), and it also serves as positive feedback for M1. When M1 is on, Gate_Wdg's voltage goes up, which pulls the voltage on the gate of the transistor up, causing the transistor to turn on fully. When M1 turns off, Gate_Wdg's voltage is now negative, causing D5 to turn on and take charge from the gate of M1, which causes it to turn off faster.The rest of the circuit is fairly straightforward (except for the compensation):D3 and D4 are gate protection for the FET. Most FETs will fail spectacularly if you put more than +/- 20V on the gate. The diodes clamp the allowed gate voltage to +16V and -5.6V (plus 1 diode drop from the other zener).U1 allows the gate of M1 to be shorted to ground through another method. When the transistor in U1 is on, current is allowed to flow into the BJT transistors which shuts off the gate of M1. U1 is triggered when the LED inside lights up. U1 is an optocoupler, which basically allows you to send electrical signals without any risk of shock. Without U1, someone who touches the secondary might get shocked because the circuit isn't isolated from the primary.R7 and R6 set the trigger voltage for the TL431. When the voltage exceeds 2.5V on the divider, the TL431 turns on and allows current to go through the LED, which shuts off M1.The only hard part is C1 and R1. Intuitively, this network reduces the voltage on the TL431 when it triggers, which brings the voltage on the reference pin of the TL431 back under the threshold, so it is some form of negative feedback (it is actually the compensation network and designing it is hard). For low frequencies the effect is smaller than for high frequencies because of the capacitor. Without going into too much detail, it limits the high frequency response of the TL431 which is important for stability.I suggest watching Diode Gone Wild:He has a lot of good videos about power supplies.

author: Konkedout
author_rank: Frequent Contributor
timestamp: January 03, 2025, 03:24:04 am
content: Quote from: EggertEnjoyer123 on January 03, 2025, 02:32:51 am++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++Thanks for your "shot." I think it is pretty good. I can quibble with a few things but I will mention only one: The TL431 is not "triggering" but rather is operating continuously (during steady operation) as an error amplifier and reference voltage. The TL431 has an internal reference voltage of 2.495V, and in this design it will regulate at about 2.495*(R6+R7)/R6. That comes out to about 12V.

author: mtwieg
author_rank: Frequent Contributor
timestamp: January 05, 2025, 04:44:21 pm
content: Thanks for sharing, overall it seems to work well as presented. Just a couple comments:1. The TL431 model is not realistic (has a voltage output instead of a more realistic OTA output). Not sure if this impacts results significantly though.2. The startup behavior is somewhat odd. Up until around t=15ms, it's operating in DCM instead of BCM, apparently the positive feedback for turning M1 on when I(L3) reaches zero doesn't work until some condition is met. And this seems strongly related to leakage inductance in the transformer. For example, if I set k=1 then it stays in DCM for ~50ms. With k=0.99, it stays in DCM for <10ms. It's likely that this positive feedback mechanism is also dependent on many other parasitic terms (like capacitance on M1, D1, D6, etc). In fact, I'm betting that if all the components in the circuit were ideal (no leakage inductance, and no capacitance on any semiconductors) then this circuit would never operate properly at all. Not a flaw in the design, but it means that these circuits are very "finessed".