What am I doing wrong? Simulating a potentiometer

I started this effort with KiCAD v6, installed from Ubuntu’s own repository. Then I updated to v8 from KiCAD’s PPA. That fixed my opamps (yay!), but not the pots.

My goal is AC analysis for audio filters, but here’s about the simplest thing I could come up with that shows the problem and still does something interesting.

Dismissing the error message on the left and trying an AC simulation anyway, gives this in the terminal at lower left:

List of plots available:
Current const	Constant values (constants)
Compatibility modes selected: ps lt a
Warning: unknown .probe parameter p(c1),
.probe p(c1) will be ignored!
Warning: unknown .probe parameter p(v1),
.probe p(v1) will be ignored!
Warning: unknown .probe parameter p(c2),
.probe p(c2) will be ignored!
Circuit: KiCad schematic
Warning: Model issue on line 2 :
.model __rv1 potentiometer( r=10k ) ...
Unknown model type potentiometer - ignored
Error on line 9 :
arv1 net-_c1-pad2_ out 0 __rv1
MIF-ERROR - unable to find definition of model __rv1
Compatibility modes selected: ps lt a
Warning: unknown .probe parameter p(c1),
.probe p(c1) will be ignored!
Warning: unknown .probe parameter p(v1),
.probe p(v1) will be ignored!
Warning: unknown .probe parameter p(c2),
.probe p(c2) will be ignored!
Circuit: KiCad schematic
Warning: Model issue on line 2 :
.model __rv1 potentiometer( r=10k ) ...
Unknown model type potentiometer - ignored
Error on line 9 :
arv1 net-_c1-pad2_ out 0 __rv1
MIF-ERROR - unable to find definition of model __rv1
Error: circuit not parsed.
Error: vector frequency not found!
Error: vector frequency not found!

This is after setting the pot’s simulation model:

In my actual circuit with 6 pots, every one of them has this same problem. I also want to have some switches, which don’t work yet either, but I can fudge that for now with manual wiring changes.

I can fudge the pots too, with parameterized resistors, and that seems to work…until I try to tune them. Play with the fader and watch the plot change. Seems the tuner doesn’t support parameters??? Only direct component values? Not so good when I have multi-gang pots that have to keep their tracking.

I would expect the example above to produce this as-is, using the default wiper position of 0.5, but with a single tuning fader from 0 to 1 instead of two faders with actual resistances:

So like the title says, “What am I doing wrong?” “Why does the pot not work like that?”
Or, “What am I missing?”

TIA

You may find some pot models herre: Simulation examples for KiCad8/Eeschema/ngspice

That (potentiomers.7z)…kinda works…if I delete RV2. It does this if I leave it in:

Background thread stopped with timeout = 0
Compatibility modes selected: ps lt a
Circuit: KiCad schematic
Error on line 0 :
a.xrv2.apot 0 w2 net-_rv1-pad1_ xrv2:potmod
MIF-ERROR - unable to find definition of model xrv2:potmod
Error: circuit not parsed.

The others are okay, but still none of them are tunable.


The entry just above that looks good though. (epot.7z) Looks like it’ll support tunable multi-gang too! And some of the others give me an idea for the switches. But is there really not a more elegant way to do it?

And there’s still the question of why the pre-packaged thing falls flat, so that I have to do any of this in the first place. Of course, if this is what’s needed, then this is what’s needed, but it still seems awkward and definitely non-trivial to make work.

I use SPICE Subcircuits for my potentiometers.
THen simply adjust the values of the two resistors in series (center-tap is wiper).

EXAMPLE: 100K POTENTIMETER @ 75% R1=75000 R2=25000
(WHERE PINS 1 & 4 ARE GND/MIN., PINS 2 & 5 ARE WIPER, PINS 3 & 6 ARE MAX.)

==========

* PMTR100K
*
* SPICE (Simulation Program with Integrated Circuit Emphasis)
* SUBCIRCUIT
* 100K POTENTIOMETER 50%
*
.SUBCKT PMTR100K 1 2 3
R1 1 2 50000
R2 2 3 50000
.ENDS

==========

==========

* PMTRST100K
*
* SPICE (Simulation Program with Integrated Circuit Emphasis)
* SUBCIRCUIT
* 100K POTENTIOMETER STEREO 50%
*
.SUBCKT PMTRST100K 1 2 3 4 5 6
XA 1 2 3 PMTR100K
XB 4 5 6 PMTR100K
.ENDS
*
*
.SUBCKT PMTR100K 1 2 3
R1 1 2 50000
R2 2 3 50000
.ENDS

==========
type or paste code here