That pretty much echos my understanding of this problem thus far! My simulation likes to draw peaks of like 200A on the primary and I had to use 100uF ideal capacitors since I found 1uF wasn't enough . 50uF is probably more reasonable though! I didn't consider electrolytic I feared they would just explode under those conditions, or many small ones would take up a hell a lot of space. What about film polypropylene capacitors?
You uh, might want to check the startup conditions, and also the control methods (guessing none at all right now?) there.
Here is a good example of how to do it right:
https://www.seventransistorlabs.com/Images/Flashlight2Sch.pnghttps://www.seventransistorlabs.com/Images/Flashlight2_Schematic.pngThis is only a boost circuit, but the same control scheme applies perfectly well to buck, forward, etc.
The key is the control circuit monitors the inductor current. Anything can happen to the circuit around it: supply and load voltages can be anything, doesn't matter, as long as the inductor current is known, the output power will be limited and the switch current will remain safe. (Obviously for a boost, the output voltage can't be much below the input, but that is an exception beyond our control. Everything else, we have total control.)
This happens to be a battery-powered flashlight, so the inductor current can be sensed at the low side, through the battery. If high side sensing is needed, a current shunt resistor and current-sense amplifier can be used, or a Hall effect sensor (which is also isolated, so can sense secondary side current as well).
The control is fully discrete, so implements everything that you should expect to see in a controller's block diagram. Top left (IC2A and such) is the ramp oscillator; IC2B is the PWM modulator (compares a PWM setpoint voltage, to the ramp, thus generating PWM output); IC1 is the gate driver (here just a logic buffer, no need for anything fancy); and IC3B is the current error amplifier. INSP is the current setpoint, and IC3B controls PWM such that the feedback signal IBATT is balanced with INSP. As INSP voltage goes up, IBATT voltage falls, i.e., inductor current goes up. C11, C15 and R20 set the rate at which the error amp responds, so that it can be tuned to a stable response over all source and load conditions.
What good is current? We want voltage!
Well, even if you wanted regulated current, you wouldn't quite have it yet, because this controls input current, not output. In the boost converter, the output current is less, by the duty cycle (give or take). So you'd have to multiply by that to know it, which... can be done, that's not too awful to build a circuit to solve. But we can measure it even easier, and that's simply what ILED is doing. Since this is powering LEDs, a constant-current output is desirable: this gives a fixed brightness regardless of battery voltage, until the battery is so low that it simply can't provide enough power at all.
For a constant-voltage output, simply wire ILED to a voltage divider on the output: then IC3A adjusts the current setpoint to compensate for changes in load voltage. The output capacitors (C3, 4, 7,
deliver load current in the short term, and after some time constant (set by C10, C13, R19, values chosen again for stability) the converter takes up the load.
This is better than simply wiring IC3A to IC2B (i.e., voltage feedback to PWM), because if the voltage is very low, it will demand 100% PWM (i.e., IC3A's output saturates to +V). But a boost converter doesn't deliver any voltage until it switches off at least once... it'll just latch on, and burn itself to pieces.
Okay fine, so just limit it so it doesn't go to 100% PWM -- divide it down so it only goes to, say, 70 or 80 or 80% PWM. Then it keeps switching, so the output will keep rising while "full throttle" is being delivered. Ah, but how much throttle is it really doing? How do we know if it's drawing 1A or 10? We have no clue. The inductor current is a free variable, it just does whatever it does.
Instead if we have an inner loop controlling inductor current, then it simply goes to whatever we set it to. If IC3A saturates, it demands, well, whatever 3-4V corresponds to at INSP. (The resistor divider R16-R22 translates this to a smaller (negative) voltage at IBATT, and R1-R2 convert this voltage to a current. So, about 7A it seems. Hmm, that's quite a lot for a 18650, I might've been rather optimistic with these original component values...)
Note that IC3B is allowed to command fully 0% to 100% PWM. There's nothing wrong with leaving the transistor on for an extended period of time -- it's controlled by inductor current, so the only thing that can happen is the inductor current just isn't rising, and, well, the switch can handle the current it's designed for, so it's not going to smoke or anything. Anyway, this could only happen if the supply voltage were quite low, which can't happen, so it would only stay on for, eh, a few cycle or something like that. Long enough to ramp up the current to the setpoint.
(This is also acceptable behavior on a boost or forward converter with current sensing in series with the transistor: while the transistor is on, inductor current is known. This control method (average current mode control) isn't so suitable with such a connection however (the current is not known while the transistor is off!), something to keep in mind.)
Obviously, for a full-wave forward converter, you'll have alternating switches, which needs a different PWM modulator; and you'll have a secondary side inductor, for which a Hall effect sensor is probably a good idea (isolated current sensing).
A TL494 can be used as a mostly-all-in-one block. It even has two error amps, though, they're wired in parallel rather than cascade, so I suggest disabling one, and using an external error amp to regulate voltage.
Which, again due to isolation, should be located on the secondary side. A typical solution, then, would use a TL494 on the primary side, to regulate secondary current (sensed with a Hall effect sensor). Its setpoint is driven by an optoisolator, which is driven by a TL431 or similar voltage regulator IC. (The TL431 is typically drawn as an adjustable zener, but it's actually a three-terminal op-amp, with a conspicuously large, yet suspiciously stable, input offset voltage. Thus, you use it just like an error amp, with compensation RC across it, and that closes your voltage loop.)
This can all be drawn out in the simulator as well, indeed you can put in the above schematics, and use stock models, and you should be able to get it working. Then you can replace certain parts (say the voltage reference, or current setpoint) with VPULSE sources, and observe the step response for example.
I figured that by using a full bridge on the primary, I could increase the turns and decrease the current, that would help a good bit. But I'm concerned about saturation if the pulse period isn't perfectly symmetrical. I'd be also afraid of something causing the control of the fets to latch up and conduct DC I suppose the other approach is to use a split primary with lo-side FETs either end but then leakage inductance is going to cause massive overshoots too.
Well, just don't do that...
In the full bridge, you can still use a coupling cap if you like. It can even be rated lower voltage, since it's not expected to have full supply across it. (Ah, which makes type 2 ceramics actually rather attractive, as they have maximum capacitance near zero voltage. Who needs derating?!) Not so much in push-pull, where matched pulse widths are required, and some mitigation is had by reducing the transformer inductance a bit (by increasing the air gap) and limiting the maximum duty cycle (per switch) to somewhat less than 50%.
(This allows some dead time, during which the transformer's built-up flux imbalance, manifest as unbalanced primary current flow (inductance is the ratio between flux and current, H == V.s / A), is able to speed up or slow down the voltage transition from one transistor to the other (commutation). Thus, lower primary inductance increases the current flow for a given imbalance, forcing the waveform to be faster or slower on one side or the other. You don't want to lower the inductance too much, as that increases reactive energy storage: energy drawn from, and returned to, the supply, without performing useful work (output power).)
Tim