KiCAD Version: 6.0.11
My variable resistor model which can be controlled by an outside pwl voltage source has the final code as follows
* source variableR
.subckt VR P1 P2 CTR Rm
R1 Rm P1 R=(50k-V(CTR)+.001)
R2 P2 Rm R=(V(CTR)+.001)
.ends VR
BTW, I don’t know why I need to attach .001
at the end. The simulation will report an error without these .001
.
Anyway, the model is now able to work properly.
The following picture shows how I test the model.