Hi folks I am new to both Kicad and Spice simulation. Learning curve has been steep but I have made some progress. I would like to pass a voltage parameter into a PWL source and have not been successful. I tried defining a parameter on the schematic sheet and then using that parameter in the PWL definition but that doesn’t work. Any suggestions? By the way I am working on an Apple laptop which at times has its own complications.
Here is an example project with a PWL voltage source. It is just a voltage divider. Does that help you? You have to define pairs in the Sim.params field of “time” and “voltage”.
pwl.zip (5.1 KB)
Lucas, thanks for the reply. I can get the PWL function to work but what I am trying to do is to pass in a parameter. Something like:
.param PowerSupply=15
PWL" 0 0 1m {PowerSupply} 2m 0 "
but than doesn’t seem to work. I also noticed that in the ngspice manual the syntax for PWL is PWL( … ) while in Kicad it is PWL" … ". Replacing “…” with ( … ) causes errors. A bit confusing.
Oh, I see. Yeah, that seems to be a KiCad bug (or maybe put more a friendly: A missing feature).
If you click the netlist button inside the simulator, you can see what the kicad input is translated to for ngspice and then you will see that the kicad syntax is translated into the ngspice syntax. I agree, this is a bit confusing and not really consistent.