Hi Everyone! I built a very simple transformer in KiCad 8 using two coupled inductors. It works when I simulate it with ngspice from it's auto-generated spice netlist. I extracted the relevant part's from the auto-generated spice netlist into a separate file so I could reuse the spice model in my other projects whenever I need to simulate a transformer. This new spice model file is called "transformer.lib" and it contains the following data,
****************************************************
* Transformer 1P 1S
****************************************************
*
* Primary In (PA)
* | Primary Out (PB)
* | | Secondary In (SA)
* | | | Secondary Out (SB)
* | | | |
.SUBCKT Transformer_1P_1S 1 2 3 4
.PARAM Lp=1m Ls=1m k=1
L1 1 2 Lp
L2 3 4 Ls
K L1 L2 k
.ENDS Transformer_1P_1S
You'll notice three parameter's
Ls,
Lp and
k above. The problem is when I load the "tranformer.lib" file to be used as the spice model for a transformer symbol in KiCad 8, I don't see
Ls,
Lp and
k parameter's in the "Parameters" section of "Simulation Model Editor" dialog box (the dialog box appears when you double click a symbol and click "Edit Simulation Model" button on the bottom). I'm very new to spice, ngspice and KiCad 8 and this is my first reusable model. I'd like to be able to adjust these three parameter's in the "Paramters" section based on the project/circuit needs whenever I want to simulate a transformer with ngspice in KiCad 8 very similar to how you can set values for resistor's and capacitors. I'm not sure what I'm doing wrong here or If I'm missing spice syntax. I've attached a screenshot below for the "Simulation Model Editor" dialog box and you can see the "Parameter's" section is empty when I select the model. How do I fix this?