APPLICATION NOTE
2
Figure 2: Simulation result for Linear potentiometer circuit
For this analysis, a DC sweep of the parameter PSET is used and PSET is swept from 0 to 1 in increments
of 0.2.
So far we have assumed that the pot is linear, but for a logarithmic pot we need an extra parameter, that is, the
dynamic range of the pot. The potentiometer can then be implemented by the following subcircuit.
.SUBCKT POT (TOP, BOTTOM, TAP) PARAMS: R=1K RANGE=1000 SET=.5
RTOP TOP TAP {R-(R/RANGE)*PWR(RANGE,SET)}
RBOT TAP BOTTOM { (R/RANGE)*PWR(RANGE,SET)}
.ENDS
As SET goes from 0 to 1, the value of RBOT goes logarithmically from RĂ·RANGE to R. RTOP makes up the
difference between RBOT and the total resistance of the pot.
If a time-varying potentiometer is needed, it can be built using the same ideas as above. The subcircuit for time-
varying potentiometer implements a voltage controlled resistance. One then builds an appropriate controlling
waveform (using, for instance, the piecewise linear (PWL) type) to vary the resistance as desired.
Figure 3: Time-varying potentiometer test circuit