Modeling a transformer in SPICE - Page 1
Forum section: electronics / projects

author: aiq25
author_rank: Regular Contributor
timestamp: April 10, 2019, 05:28:15 am
content: Hello. I'm working on a project where I am using a power transformer and I would like to simulate this circuit in SPICE. I'm having a hard time coming up with the correct way to model this transformer. So far I have been using an ideal transformer to model but I would like to add the effect of the primary, secondary and leakage inductance's to the circuit.What I think I can do is use couple of coupled inductors with a coupling coefficient to model the transformer but I'm having a hard time coming up this this coupling factor. I have the test data from the transformers from the supplier, I have the following information: primary coil inductance and DCR, secondary leakage inductance and DCR. Is there a way I can measure calculate the coupling factor (k) based on this information?I looked at Wikipedia and found this model of a non-ideal transformer:https://upload.wikimedia.org/wikipedia/commons/0/05/TREQCCTHeyland.jpgI'm not sure how to measure the mutal inductance M. I'm guessing I can use Eq 2.7 on the right hand side of this page I can get k, I would really appreciate some help on how to measure this:https://en.wikipedia.org/wiki/Leakage_inductance#cite_ref-14

author: T3sl4co1l
author_rank: Super Contributor
timestamp: April 10, 2019, 06:05:51 am
content: Use eq 2.7, 1 - k^2 = Lsc / Loc. Since you have secondary referred leakage, use secondary referred magnetizing inductance (Loc) as well. Use coupled inductors, or Fig 3 or 4 (don't need to use separate leakage inductors if k ~= 1; then you put in the total as Lsc).Is this just a two-winding transformer?If you have more windings, then in general you need a triangular matrix* of k's for each set of windings, subject to certain limitations (the coupling between any two windings in a set of three, can't be less than the product of the other two coefficients).*The matrix is symmetrical (k12 = k21, etc.) so we're only concerned about one triangle. At least, that's the usual case, as nonreciprocal transformers are very rare.To illustrate that more clearly, suppose you create a transformer by wiring two independent transformers together. The coupling from primary 1 to secondary 1 (= primary 2) is k12, and the coupling from primary 2 to secondary 2 is k23. The coupling from primary 1 to secondary 2 is k13 = k12*k23, obviously enough**. You can't artificially have k13 less than this, but you can have more (say there were additional windings linking p1 to s2, but not to s1/p2).**Unless it's not the straight product in k but a little finagling to get there, I'm not sure. In the k ~= 1 limit it should be (in which case k13 ~= 2 - k12 - k23 as well). Easy enough to prove what it actually is, anyway.The full 2nd order transformer model also includes the DC resistance of the windings, the AC resistance of the core loss, the self-capacitance of each winding, and the isolation capacitance between windings. With this, you have a complete (if still approximate***) model of the efficiency, bandwidth and impedance of the transformer.***This is the 2nd stage in an infinite series of circuits approximating a real component -- this is necessary because the actual EM fields within the transformer propagate at the speed of light, so can't be represented by mere lumped RLC elements. Except when they don't, which is relevant to skin effect in the wire and core, where the propagation velocity is very much slower than the speed of light. For these, the DCR and ACR components are modified (into RL networks). For the inter-turn and inter-winding fields, LC networks are used.It's rarely worth modeling a transformer beyond 2nd order LC, plus say 3rd or 4th order losses. The reason is, you're mostly modeling the high frequency cutoff range, which is chock full of peaks and valleys, that are inconsistent between parts (depends on the exact number of turns per layer, etc.), and difficult or impossible to make use of in a practical circuit (the impedances, as well as the frequencies, are all over the place). So I just want to emphasize that, by taking it a step further with a couple resistors and capacitors, gets you to the all-around most useful wideband transformer model.Tim

author: iMo
author_rank: Super Contributor
timestamp: April 10, 2019, 06:21:29 pm
content: There is the Bordodynov library with transformer models, afaik.

author: aiq25
author_rank: Regular Contributor
timestamp: April 11, 2019, 01:58:31 am
content: Quote from: T3sl4co1l on April 10, 2019, 06:05:51 amThanks, I will try to come up with something.The transformer is has two primary winding, one secondary winding. It's for a push-pull converter design. I don't need a 2nd order approximation, what I'm more interested in is the flyback voltage from the secondary to the primary and that's why I want to model the coupling and the leakage inductance. This is for a high voltage output application.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: April 11, 2019, 02:04:16 am
content: Oh, well then that's easy, the peak flyback voltage is infinite.Without capacitance, there is no impedance, and the voltage can be arbitrarily high -- for arbitrarily fast switches.Tim

author: aiq25
author_rank: Regular Contributor
timestamp: April 11, 2019, 02:06:32 am
content: Quote from: imo on April 10, 2019, 06:21:29 pmThanks. This looks handy.

author: rbola35618
author_rank: Frequent Contributor
timestamp: April 12, 2019, 09:44:32 pm
content: Here is a video I made in how to model a transformer (Flyback) in spice.

author: aiq25
author_rank: Regular Contributor
timestamp: April 22, 2019, 05:42:00 am
content: Quote from: rbola35618 on April 12, 2019, 09:44:32 pmThank you very much! Exactly what I was looking for. Great videos and channel by the way, very helpful!