How to Include Transformer Built-in Model in to SUBCKT?

Hello folks,
I’ve created a DAB model (with idea switches and diodes), also wanted to include the transformer model that we have built-in in QSPICE. But here is the error I’m getting when I run the simulation:

Fatal error: Error: too few nodes: ã—1 «ipn n18 n17 sb» turns=np ns

x1 is the transformer in the below netlist.

Netlist:

.SUBCKT DABideal_1ph INp INn OUTp OUTn G1 G2 G3 G4 G5 G6 G7 G8 Ip Is PA PB SA SB
S1 INp PA N01 N02 IdealSWp
D1 PA INp IdealD
S2 PA INn N03 N04 IdealSWp
D2 INn PA IdealD
S3 INp PB N05 N06 IdealSWp
D3 PB INp IdealD
S4 PB INn N07 N08 IdealSWp
D4 INn PB IdealD
L1 PA Ipp Ldab RSER=ESR_L
E1 N01 N02 G1 0 1
E2 N03 N04 G2 0 1
E3 N05 N06 G3 0 1
E4 N07 N08 G4 0 1
C2 PB N18 Cblock
×1 «Ipn N18 N17 SB» Turns=Np Ns
S5 OUTp SA N09 N10 IdealSWs
D5 SA OUTp IdealD
S6 SA OUTn N11 N12 IdealSWs
D6 OUTn SA IdealD
S7 OUTp SB N13 N14 IdealSWs
D7 SB OUTp IdealD
S8 SB OUTn N15 N16 IdealSWs
D8 OUTn SB IdealD
E5 N09 N10 G5 0 1
E6 N11 N12 G6 0 1
E7 N13 N14 G7 0 1
E8 N15 N16 G8 0 1
C1 N17 SAp Cblock
R1 Ipn Ipp Rsens
B1 Ip 0 V=(V(Ipp)-V(Ipn))/Rsens
R2 SA SAp Rsens
B2 Is 0 V=(V(SAp)-V(SA))/Rsens
.model IdealDp D (Ron=Dp_Ron Roff=1Meg Vfwd=Dp_FWD)
.model IdealSWp SW (Ron=Ron_SWp Roff=1Meg Vt=0.5 Vh=-0.5)
* .param Ldab=3.3µ
* .param ESR_L=5m
* .param Cblock=90µ
* .param Ron_SWp=2m
* .param Np=1
* .param Ns=4
* .param Rsens=0.1m
.model IdealSWs SW (Ron=Ron_SWs Roff=1Meg Vt=0.5 Vh=-0.5)
* .param Ron_SWs=19m
.model IdealDs D (Ron=Ds_Ron Roff=1Meg Vfwd=Ds_FWD)
* .param Dp_Ron=0.1m
* .param Ds_Ron=0.2m
* .param Dp_FWD=0.7
* .param Ds_FWD=1.2
.ENDS DABideal_1ph

QSPICE Schematic:

Symbol: Generated netlist file is called inside the symbol.

Worst case, I’ll replace it with a coupled inductor pair but I’d like to use the transformer model.

Any hints?
Thank you in advance
Regards

Your symbol is linked to a netlist file (.cir). I assume your .cir file is encoded in UTF-8, as this is a common encoding for text files. However, QSpice with devices that begin with special characters like Ã, ¥, ×, etc., and it reads in ANSI encoding. Therefore, if you paste your QSpice netlist into a .cir file (a text file) encoded in UTF-8, it will appear with messed up characters in QSpice due to the encoding mismatch. (Qspice netlist, .qsch are in ANSI)

If you use Notepad++, you can first change the encoding to ANSI, then paste the netlist, and it will display the characters correctly without any issues.

This is the subckt netlist you provided and with .cir encoded with ANSI
DABmodel_1ph.cir (1.3 KB)

By the way, you have D diode use model name IdealD, but you don’t have .model IdealD in your netlist.

1 Like