* Z:\home\khalils\Downloads\files\data\raw_asc\2ca7bb69ef82_res_sensor_opamp_const_cur.asc
* Generated by LTspice 26.0.1 for Windows.
* Library below included based on ModelFile attribute of instance XU1, XU2 (C:\users\khalils\AppData\Local\LTspice\lib\sym\OpAmps\AD8542.asy)
R1 VloadR 0 {Rsense}
R5 N004 0 510k
D2 VsenseKR VloadKR PMEG3010BEA
R4 Vs N004 16k
R6 VloadKR 0 {Rsense}
R3 Vref 0 510k
V1 Vs 0 3.3 Rser=10m
R2 Vs Vref 16k
M1 VsenseR N001 Vset Vset BSS84
M2 VsenseKR N003 N002 N002 BSS84
RsetLowR Vs Vset 22 tol=1
D1 VsenseR VloadR PMEG3010BEA
XU2 N004 N002 Vs 0 N003 AD8542 ;pnba In+)In-)V+)V-)OUT
XU1 Vref Vset Vs 0 N001 AD8542 ;pnba In+)In-)V+)V-)OUT
RsetHighR Vs N002 51 tol=1
.model D D
.lib C:\users\khalils\AppData\Local\LTspice\lib\cmp\standard.dio
.model NMOS NMOS
.model PMOS PMOS
.lib C:\users\khalils\AppData\Local\LTspice\lib\cmp\standard.mos
.op
.step param Rsense 1 5001 25
.lib AD8542.sub
.backanno
.end

* LTspice schematic (.asc):
Version 4
SHEET 1 1028 1540
WIRE 448 -48 448 -80
WIRE 16 32 16 0
WIRE 448 64 448 32
WIRE 448 64 208 64
WIRE -224 96 -224 64
WIRE 272 112 272 96
WIRE 208 128 208 64
WIRE 240 128 208 128
WIRE 448 128 448 64
WIRE 400 144 304 144
WIRE 16 160 16 112
WIRE 48 160 16 160
WIRE 240 160 48 160
WIRE 16 192 16 160
WIRE 272 192 272 176
WIRE -224 208 -224 176
WIRE 448 288 448 224
WIRE 608 288 448 288
WIRE 16 304 16 272
WIRE 448 368 448 288
WIRE 448 512 448 432
WIRE 448 560 448 512
WIRE 448 672 448 640
WIRE 448 800 448 768
WIRE 16 880 16 848
WIRE 448 912 448 880
WIRE 448 912 208 912
WIRE 272 960 272 944
WIRE 208 976 208 912
WIRE 240 976 208 976
WIRE 448 976 448 912
WIRE 400 992 304 992
WIRE 16 1008 16 960
WIRE 240 1008 16 1008
WIRE 16 1040 16 1008
WIRE 272 1040 272 1024
WIRE 448 1136 448 1072
WIRE 608 1136 448 1136
WIRE 16 1152 16 1120
WIRE 448 1216 448 1136
WIRE 448 1360 448 1280
WIRE 448 1408 448 1360
WIRE 448 1520 448 1488
SYMBOL res 432 -64 R0
SYMATTR InstName RsetLowR
SYMATTR Value 22
SYMATTR SpiceLine tol=1
SYMBOL pmos 400 1072 M180
SYMATTR InstName M2
SYMATTR Value BSS84
SYMBOL res 0 864 R0
SYMATTR InstName R4
SYMATTR Value 16k
SYMBOL OpAmps\\AD8542 272 80 R0
SYMATTR InstName U1
SYMBOL schottky 432 1216 R0
SYMATTR InstName D2
SYMATTR Value PMEG3010BEA
SYMBOL OpAmps\\AD8542 272 928 R0
SYMATTR InstName U2
SYMBOL schottky 432 368 R0
SYMATTR InstName D1
SYMATTR Value PMEG3010BEA
SYMBOL res 432 784 R0
SYMATTR InstName RsetHighR
SYMATTR Value 51
SYMATTR SpiceLine tol=1
SYMBOL res 432 544 R0
SYMATTR InstName R1
SYMATTR Value {Rsense}
SYMBOL pmos 400 224 M180
SYMATTR InstName M1
SYMATTR Value BSS84
SYMBOL res 0 176 R0
SYMATTR InstName R3
SYMATTR Value 510k
SYMBOL res 0 16 R0
SYMATTR InstName R2
SYMATTR Value 16k
SYMBOL voltage -224 80 R0
WINDOW 123 0 0 Left 0
WINDOW 39 24 124 Left 2
SYMATTR SpiceLine Rser=10m
SYMATTR InstName V1
SYMATTR Value 3.3
SYMBOL res 432 1392 R0
SYMATTR InstName R6
SYMATTR Value {Rsense}
SYMBOL res 0 1024 R0
SYMATTR InstName R5
SYMATTR Value 510k
FLAG 16 0 Vs
FLAG 16 304 0
FLAG 48 160 Vref
FLAG 272 96 Vs
FLAG 272 192 0
FLAG 448 672 0
FLAG 448 -80 Vs
FLAG 448 64 Vset
FLAG 608 288 VsenseR
FLAG 448 512 VloadR
FLAG -224 64 Vs
FLAG -224 208 0
FLAG 16 848 Vs
FLAG 16 1152 0
FLAG 272 944 Vs
FLAG 272 1040 0
FLAG 448 1520 0
FLAG 448 768 Vs
FLAG 608 1136 VsenseKR
FLAG 448 1360 VloadKR
TEXT 32 440 Left 2 !.op
TEXT 32 416 Left 2 !.step param Rsense 1 5001 25