Continuing the saga.
I implemented a small model for potentiometers, inspired by this page from pspice.com.
I have the ‘ngbehavior=ps’ set, so I was assuming my pots.lib should be in PSpice lingo.
The following two definitions are in my pots.lib:
.SUBCKT LINPOT (top, tap, bottom) PARAMS: R=1k SET=0.5
RTOP top tap {R*(1-SET)+0.001}
RBOT tap bottom {R*SET+0.001}
.ENDS LINPOT
and
.SUBCKT LOGPOT (top, tap, bottom) PARAMS: R=1k RANGE=1000 SET=0.5
RTOP top tap {R-(R/RANGE)*PWR(RANGE,SET)}
RBOT tap bottom {(R/RANGE)*PWR(RANGE,SET)}
.ENDS LOGPOT
Now I needed to pass the extra parameters to my model via the gui and to do that I added the parameters to the ‘Spice_Models’ field in the gui. This usage is not documented, as far as I could tell, but it is working, and I hope this functionality will stay. It is very convenient.
As an example, in the schematic I have used the symbol for a pot, annotated it as ‘X1’, in the spice gui I used the ‘Models’ tab and set the ‘Spice_Model’ field to
LINPOT PARAMS: R=47k SET=0.1
As another example, for a logarithmic potentiometer I set the ‘Spice_Model’ field to:
LOGPOT PARAMS: R=20k RANGE=1000 SET=0.5
This is all working fine and behaves like intended.
I have not seen any documentation about this use of parameters via the gui, though.
Any comments?
m