Something wrong with coupled inductors

Looks like it something wrong with coupled inductors simulation. It show incorrect readings.

Tried same schematics in different sim software. They show more-less real output.

NGspise sow pVolts, mVolts

Its simple push-pull converter.
Inductor output is about 25 volts.

Here is netlist. What i did wrong with setting up coupled inductor?

.title KiCad schematic
.include “2N2222A.LIB”
Q2 0 Net-C2-Pad2 2 Q2n2222a
Q1 0 Net-C1-Pad2 1 Q2n2222a
R1 Net-C2-Pad2 Vin 10k
R2 Net-C1-Pad2 Vin 10k
C1 2 Net-C1-Pad2 1000p
C2 1 Net-C2-Pad2 1000p
VCC1 Vin 0 dc 5 ac 0
R3 Net-D1-Pad2 0 10M
L1 2 Vin 30m
L2 test1 Net-D2-Pad1 200n
R4 test2 0 10M
D1 test1 Net-D1-Pad2 DIODE
D2 Net-D2-Pad1 Net-D1-Pad2 DIODE
D3 test2 test1 DIODE
D4 test2 Net-D2-Pad1 DIODE
L3 Vin 1 30m
.tran 1m 1000m
K1 L1 L3 L2 1
.end

Had you try my version of transformer bellow:

Also section 3.2.11 in http://ngspice.sourceforge.net/docs/ngspice-manual.pdf show that
K1 L2 L3 L2 1 is not the correct way to couple multiple inductors.

Manual doesn’t say anything about correct way to make multiple inductors. Only this chapter 3.2.11

Coupled (Mutual) InductorsGeneral form:KXXXXXXX LYYYYYYY LZZZZZZZ value
Examples:K43 LAA LBB 0.999KXFRMR L1 L2 0.87

Thank you. Tried this. Nice library, but why i need to include ngspice.cir in schematic?

Thanks for the hint.

I will add this to the manual.

1 Like

Thank you!

BTW. What is correct way to do it?

It is pairwise coupling

L1 1 0  10u
L2 2 0  11u
L3 3 0  10u

k12 L1 L2 0.99
k23 L2 L3 0.99
k13 L1 L3 0.98
1 Like

Thank you!

Did that. It gives me exactly same results. But what I noticed. If you put all Lxxx in one K - it not even always work.
Pairwise coupling works always.

Dont know. Right now Im using nightly build. Maybe it because of that.

This is not supported by ngspice. It is pure chance if it works.

the .cir is the spice models that needed when run spice simulation. So you need to add include statement to that file in your spice netlist or the KiCad directive in text box.