I figured I would be driving my circuit with two 18650 cells, so I decided to count on a 6V minimum input voltage and promote a 50% duty cycle as nominal. With a 6V input and 120V output, this works out to a 1:20 turns ratio.
The primary goal of sizing components in all DC-DC switchers is to keep your circuit in "continuous conduction mode" or CCM. CCM means that at all points in the cycle, current is either ramping up or ramping down. CCM makes it possible to keep your output relatively stable and also avoid situations where you potentially super saturate your inductor which will lead to energy losses.
In order to size the output current requirements, I first needed some info on exactly what kind of load I was dealing with.
This post was originally written with an incorrect electrical model of my EL panel in mind. For the remainder of this discussion, all of my calculations are done for a resistive load of 56k.
So it looks like my load is 56k or .25W. I figured I'd round this up to 1W just to be safe.
So, sizing the inductor is kind of odd because you have ramp up coming from one coil and ramp down passing through another. To make things easier, we can just pretend that the transformer is actually an inductor. This is made especially easy because current is never passing through the primary and secondary winding at the same time. Looking at the primary and secondary current strictly from the perspective of how they contribute to the magnetic flux, we can do this:
Or, talking about the averages:
Calling our current the "Magnetization Current". Let's draw out this current as it ramps up and down:
So we have to size our inductor such that the peak of isn't too large and so that it never drops to zero. Remember from before that our current in the primary winding (and therefore all of during the first part of the cycle) ramps up to:
While the switch is turned on. When the switch is turned off, it will then ramp down through the secondary winding. Assuming we're staying in CCM, the switch should turn on again before this secondary current drops to zero. Thinking of a worst case, let's consider that the current just barely hits the zero mark before restarting (like in my graph above). Under these conditions, the average of will be half of the peak. We can do this:
We need to make sure the transformer is at least large enough to make the above true:
In the case of my 1W power draw at 120V output, I'll have a 8.3mA secondary current which works out to:
In order to size my transformer, I first need to figure out how (and at what frequency) I'm driving it.
Driving the Transformer
Driving the transformer in a flyback circuit is kind of a difficult business. As mentioned before, the output voltage can fluctuate as load fluctuates, so it's important to adjust the input duty cycle appropriately to keep the output voltage relatively constant. Additionally, a flyback converter is not a first-order system which means that adjusting the duty cycle will not immediately adjust the output voltage. There is a small delay there. Because of this, you can have some nasty oscillations in your output as your circuit keeps overshooting its target.
Rather than working my ass off to make a proper feedback system, I opted to use a pre made solution: the LT1425. It's actually a pretty cool part. It pulls some black magic to determine when the transformer flux is close to zero and only turns on the switch when this is the case. In theory, this should prevent the output voltage from rising should the load resistance increase.
Now this probably wasn't the best choice in drivers mostly because it's designed specifically for systems with isolated secondary windings, and that's a lot what you're paying for. I grounded my secondary winding, so that feature is thrown out the window.
This part, if configured correctly, should keep my output voltage relatively steady. It regulates the voltage by altering the duty cycle and operates at a switching frequency of 285kHz.
Knowing this, I can properly size my inductor:
So as long as my primary winding inductance is greater than I'll be okay.
Now, keep in mind that the math I do on this blog is not necessarily the same math that I did during my initial design phase. For some reason, when I was sizing my components for my initial design, I was counting on a 100kHz switching frequency reaching my target voltage at a 75% duty cycle. This yields a required primary inductance of around 170H. This answer isn't wrong, it just gives me a much larger transformer than is really necessary. If I built this again, I would use a much smaller transformer to lower the size of the finished product. So from here on out just humor me...
Let Me See that Ripple
Seeing how a flyback converter only delivers charge to the load during part of every cycle, you can imagine how the output voltage wouldn't be exactly steady. To prevent large ripples in the output voltage, you can add a capacitor in parallel with the load. As charge is delivered (while the primary winding switch is off), the capacitor voltage rises exponentially. When the switch is turned on again, the diode prevents charge from leaving the capacitor from the transformer side and it discharges exponentially through the load.
As you know from the formula:
A current source/load will cause the voltage to ramp up/down. Increasing the size of will cause that ramp to be slower. Because the charge/discharge times are fixed by the switching frequency and duty cycle, the slower the voltage ramps up, the less dramatic the voltage ripple.
We can size how large this ripple is by considering the case where the capacitor is discharging. We know that our output current is 8.3mA from before, and we know that the discharge time will be based on the duty cycle and switching frequency. This allows us to size our capacitor using this formula:
So if you decide what your maximum voltage ripple ()should be, you can decide on what your minimum capacitance should be. Let's say maximum ripple that we can accept is 1V.
Because the currents are so small and the frequency is so high, you can get away with a pretty small capacitor. Unfortunately, this capacitor needs to be rated for 120+ volts.
This is only true for resistive loads. For capacitive loads (like EL materials), check out this post.