实际上在这个软件里面是没有提供电位器这个元器件的不过我们可以通过以下这三个文件简单的实现它,用记事本创建以下三个文件,并把代码复制进去,记得修改后缀名。
然后把这三个文件放在系统库里面。具体是在哪,需要看个人安装时的设置。一般是在以下目录
C:\Users\【你的用户名】\AppData\Local\LTspice\lib\sym
potentiometer_test.asc
Version 4
SHEET 1 880 680
WIRE 272 48 0 48
WIRE 528 48 272 48
WIRE 272 80 272 48
WIRE 528 80 528 48
WIRE 0 96 0 48
WIRE 0 192 0 176
WIRE 272 208 272 176
WIRE 528 208 528 176
FLAG 272 208 0
FLAG 0 192 0
FLAG 320 128 out1
FLAG 528 208 0
FLAG 576 128 out2
SYMBOL voltage 0 80 R0
SYMATTR InstName V1
SYMATTR Value 10
SYMBOL potentiometer 272 176 M0
SYMATTR InstName U1
SYMATTR SpiceLine2 wiper=0.2
SYMBOL potentiometer 528 176 M0
SYMATTR InstName U2
SYMATTR SpiceLine R=1
SYMATTR SpiceLine2 wiper=0.8
EXT 140 228 Left 2 !.op
potentiometer.asy
Version 4
SymbolType BLOCK
LINE Normal 16 -31 -15 -16
LINE Normal -16 -48 16 -31
LINE Normal 16 -64 -16 -48
LINE Normal 1 -9 -15 -16
LINE Normal 1 0 1 -9
LINE Normal 1 -94 1 -87
LINE Normal -24 -56 -16 -48
LINE Normal -24 -40 -15 -48
LINE Normal -47 -48 -15 -48
LINE Normal -16 -80 16 -64
LINE Normal 1 -87 -16 -80
WINDOW 0 30 -90 Left 2
WINDOW 39 30 -50 Left 2
WINDOW 40 31 -23 Left 2
SYMATTR Prefix X
SYMATTR ModelFile potentiometer.lib
SYMATTR SpiceLine R=1k
SYMATTR SpiceLine2 wiper=0.5
SYMATTR Value2 potentiometer
PIN 0 -96 NONE 8
PINATTR PinName 1
PINATTR SpiceOrder 1
PIN 0 0 NONE 8
PINATTR PinName 2
PINATTR SpiceOrder 2
PIN -48 -48 NONE 8
PINATTR PinName 3
PINATTR SpiceOrder 3
potentiometer.lib
* This is the potentiometer
* _____
* 1--|_____|--2
* |
* 3
*
.SUBCKT potentiometer 1 2 3
.param w=limit(wiper,1m,.999)
R0 1 3 {R*(1-w)}
R1 3 2 {R*(w)}
.ENDS
分别调整了wipe值:1,0,0.5,测得的电压分别是:9.99V,5.012V,6.667V