* Z:\home\khalils\Downloads\files\data\raw_asc\5a997cfe90fe_current_source_channel.asc
* Generated by LTspice 26.0.1 for Windows.
* I_coil = Uin/R1
* Vout = (R5/(R4+R5))*(1+R2/R3)*Vin \n - (R2/R3)*Vref
* Subtractor
* Non-Inverting Amplifier
* 0..2.5V
* -0.5..+0.5V
* -0.5A..+0.5A
* DAC
* PSU
* R_coil = 0.2 Ohm .. 1 Ohm
* Library below included based on ModelFile attribute of instance XU3 (C:\users\khalils\AppData\Local\LTspice\lib\sym\DAC\AD5676R.asy)
R_coil Vout N006 0.5
XU1 N002 N006 Vcc Vee Vout TCA0372 ;pnba In+)In-)V+)V-)OUT
R5 N005 0 1k
V4 Vref 0 2.5
R2 N002 N001 2k
R1 N006 0 1
R4 N004 N005 2k
V3 Vcc 0 3
XU3 N003 Vcc 0 N004 AD5676R Gain=1 ;pnba Vdac)Vdd)GND)Vout
R3 N001 Vref 10k
V2 0 Vee 3
V1 N003 0 SINE(1.25 1.25 1 0)
XU2 N005 N001 Vcc Vee N002 LMV358 ;pnba In+)In-)V+)V-)OUT
.tran 0 3 0
.lib TCA0372.lib
.lib LMV358.lib
.options gmin=1e-11 abstol=1e-11
.lib AD5676R.sub
.backanno
.end

* LTspice schematic (.asc):
Version 4
SHEET 1 880 712
WIRE -320 -16 -368 -16
WIRE -208 -16 -240 -16
WIRE -848 0 -848 -16
WIRE -1584 32 -1584 -16
WIRE -464 112 -480 112
WIRE -368 112 -368 -16
WIRE -368 112 -384 112
WIRE -304 112 -368 112
WIRE -208 128 -208 -16
WIRE -208 128 -240 128
WIRE -32 128 -208 128
WIRE -1584 144 -1584 112
WIRE -1584 144 -1648 144
WIRE -1376 144 -1376 96
WIRE -976 144 -1200 144
WIRE -464 144 -608 144
WIRE -368 144 -384 144
WIRE -304 144 -368 144
WIRE 144 144 32 144
WIRE 224 144 144 144
WIRE -1648 160 -1648 144
WIRE -368 160 -368 144
WIRE -32 160 -80 160
WIRE 144 160 144 144
WIRE -1584 176 -1584 144
WIRE -1200 224 -1200 144
WIRE -80 256 -80 160
WIRE 144 256 144 240
WIRE 144 256 -80 256
WIRE -1376 272 -1376 224
WIRE 144 272 144 256
WIRE -1584 320 -1584 256
WIRE -848 320 -848 288
WIRE -1200 368 -1200 304
WIRE 144 368 144 352
IOPIN -1584 -16 Out
IOPIN -1584 320 Out
IOPIN 0 112 In
IOPIN 0 176 In
IOPIN -272 96 In
IOPIN -272 160 In
IOPIN -1376 96 Out
IOPIN -848 -16 In
IOPIN -480 112 In
RECTANGLE Normal -112 400 -560 -80 2
RECTANGLE Normal 288 400 -96 -80 2
RECTANGLE Normal -1456 400 -576 -80 2
RECTANGLE Normal -1712 400 -1472 -80 2
SYMBOL voltage -1584 16 R0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR InstName V3
SYMATTR Value 3
SYMBOL OpAmps\\opamp2 0 208 M180
SYMATTR InstName U1
SYMATTR Value TCA0372
SYMBOL OpAmps\\opamp2 -272 64 R0
SYMATTR InstName U2
SYMATTR Value LMV358
SYMBOL res -224 -32 R90
WINDOW 0 5 56 VBottom 2
WINDOW 3 27 56 VTop 2
SYMATTR InstName R2
SYMATTR Value 2k
SYMBOL res -480 160 R270
WINDOW 0 -20 57 VTop 2
WINDOW 3 -19 57 VBottom 2
SYMATTR InstName R4
SYMATTR Value 2k
SYMBOL DAC\\AD5676R -816 144 R0
SYMATTR InstName U3
SYMATTR SpiceLine Gain=1
SYMBOL res 128 144 R0
SYMATTR InstName R_coil
SYMATTR Value 0.5
SYMBOL voltage -1584 160 R0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR InstName V2
SYMATTR Value 3
SYMBOL res 128 256 R0
SYMATTR InstName R1
SYMATTR Value 1
SYMBOL res -384 144 R0
SYMATTR InstName R5
SYMATTR Value 1k
SYMBOL voltage -1376 128 R0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR InstName V4
SYMATTR Value 2.5
SYMBOL voltage -1200 208 R0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR InstName V1
SYMATTR Value SINE(1.25 1.25 1 0)
SYMBOL res -368 96 R90
WINDOW 0 6 54 VBottom 2
WINDOW 3 -18 55 VBottom 2
SYMATTR InstName R3
SYMATTR Value 10k
FLAG -1200 368 0
FLAG 144 368 0
FLAG 224 144 Vout
FLAG -1648 160 0
FLAG -1584 -16 Vcc
FLAG -1584 320 Vee
FLAG 0 112 Vee
FLAG 0 176 Vcc
FLAG -272 96 Vcc
FLAG -272 160 Vee
FLAG -368 240 0
FLAG -1376 272 0
FLAG -1376 96 Vref
FLAG -848 320 0
FLAG -848 -16 Vcc
FLAG -480 112 Vref
TEXT 296 416 Right 2 ;I_coil = Uin/R1
TEXT 304 8 Left 2 !.tran 0 3 0
TEXT 304 -72 Left 2 !.lib TCA0372.lib\n.lib LMV358.lib
TEXT 304 -16 Left 2 !.options gmin=1e-11 abstol=1e-11
TEXT -560 416 Left 2 ;Vout = (R5/(R4+R5))*(1+R2/R3)*Vin \n             - (R2/R3)*Vref
TEXT -560 -96 Left 2 ;Subtractor
TEXT -96 -96 Left 2 ;Non-Inverting Amplifier
TEXT -544 152 Left 1 ;0..2.5V
TEXT -200 136 Left 1 ;-0.5..+0.5V
TEXT 120 200 VCenter 1 ;-0.5A..+0.5A
TEXT -1456 -96 Left 2 ;DAC
TEXT -1712 -96 Left 2 ;PSU
TEXT 320 200 Left 2 ;R_coil = 0.2 Ohm .. 1 Ohm