Malc
February 15, 2019, 6:24am
1
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:
I had develop a ngspice.lib for symbol, and parrallel with ngspice.cir file to expose addition spice model…
I hope it help you as it help me… This should work for all KiCad version from 4.0 to 5.0.
You need to add spice directive to include the ngpsice.cir file in your schematic.
ngspice.cir (1.6 KB)
ngspice.lib (10.7 KB)
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.
Malc
February 15, 2019, 8:25am
4
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
Malc
February 15, 2019, 8:26am
5
Thank you. Tried this. Nice library, but why i need to include ngspice.cir in schematic?
holger
February 15, 2019, 8:40am
6
Thanks for the hint.
I will add this to the manual.
1 Like
Malc
February 15, 2019, 8:41am
7
Thank you!
BTW. What is correct way to do it?
holger
February 15, 2019, 8:48am
8
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
Malc
February 15, 2019, 9:05am
9
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.
holger
February 15, 2019, 9:38am
10
Malc:
all Lxxx in one K
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.