Transformer simulation

Hi,
I need support for the simulation of transformer. I want to simulate the transformer “Transformer_1P_SS” from KICAD with following model but receive a failure.

image

.SUBCKT XFORMER 1 2 3 4 5
Rp 1 2 80mohm
Rs1 5 4 70mohm
Rs2 4 3 70mohm
L1 1 2 500m
L2 5 4 50m
L3 3 4 50m
K12 L1 L2 L3 1
.ends

Failure

Background thread stopped with timeout = 0
Note: Compatibility modes selected: ps lt a
Circuit: KiCad schematic
Error on line:
k.xt1.k12 l.xt1.l1 l.xt1.l2 l3 1
unknown parameter (l3)
Error: circuit not parsed.

Is there anyone who can help me?
Thank you

Several issues:

Your resistors Rp, Rs1, Rs2 are parallel to the coils and thus are short circuiting the coils. They have to be in series to the coils (which requires an extra node for each coil)!

ngspice requires something like

K1 L1 L2 1

More than two Ls are not supported.

So you have to write

K1 L1 L2 1
K2 L1 L3 1
K3 L2 L3 1

to catch every dependency. This should be fixed in ngspice (but is not yet available).

1 Like

There is an update in the ngspice git development branch that allows K1 L1 L2 L3 L4 L5 0.99. This fix will be available in upcoming ngspice-43.

Thank you for your reply

This topic was automatically closed after 90 days. New replies are no longer allowed.