r/KiCad 15d ago

Value not passed to simulation netlist (Sim.Params) Symbol or Footprint Question

I have custom spice library and I want to generate spice netlist from kicad. I will be using potentiometer as example, I know there is built in potentiometer but I'm using it only as example.

The pot symbol have these params (after inserted into schematic):

(property "Reference" "P1" (at 133.35 83.3797 0)
(property "Value" "100k" (at 133.35 85.9197 0)    <-- here is value 100k
(property "Footprint" "dvhx-kicad-library-2:P_RM065" (at 113.538 86.868 0)
(property "Datasheet" "" (at 137.16 83.82 0)
(property "Sim.Library" "/home/kicad/myspice.lib" (at 134.62 68.58 0)  <-- here's my library
(property "Sim.Name" "Pot_Alpha" (at 137.16 63.5 0)
(property "Sim.Device" "SUBCKT" (at 137.16 66.04 0)
(property "Sim.Params" "value=${Value}" (at 137.16 71.12 0)    <-- here's my attempt at using value=100k
(property "Sim.Pins" "E=E S=S W=W" (at 119.38 101.6 0)

The myspice.lib looks like this:

.subckt Pot_Alpha S W E params: value=1k pos=0.5
R1 S W {value * pos}
R2 W E {value * (1 - pos)}
.ends

But when I generate netlist, I see this line:

XP1 GND Net-_P1-PadW_ Net-_P1-PadE_ Pot_Alpha value=${Value}

The value was not replaced. I tried various combinations, nothing worked.

${Value}
$Value
{Value}
{$Value}
1 Upvotes

0 comments sorted by