Potentiometer simulation


I’m trying to have a simulation for tone-stacks in kicad. This requires several sweeps of potentiometers.
I’m using
.SUBCKT pot_lin 1 2 3
.param w=limit(0.01m,wiper,0.99999)
R1 1 3 {Rtot*(1-w)}
R2 3 2 {Rtot*(w)}
But I cannot figure out how to pass wiper and rtot to the simulation. Right now i use
Spice_Model pot_lin(0.5 0.5) just for testing. But this results in a simulator error:

Error: unknown subckt: xrv1 /out 0 /dd2 pot_lin(0.5 1)

I’m kind of stuck, so I would really appreciate any help.


You might sweep the resistor electronically as shown in this thread:


Pretty close, but not what I was looking for. I want to sweep in the AC analysis. But thanks.
I guess the tool is not mature enough yet, but I’m really looking forward to when it is.


If you have a text box with the ac command, say

.ac dec 10 100 100k

on your circuit diagram page, why not edit it (double click onto the box) and add

.param Rtot=1k wiper=0.8


For the time being I use this one.


It has been VERY helpful!


thanks, this got rid of the error, but I still need to set up the simulation manually (entering ac parameters), even though I’m having the .ac command.
It says:
No. of Data Rows : 0