* Z:\home\khalils\Downloads\files\data\raw_asc\23883413c4fb_TIA_LoopGain_Probe_LTC6241.asc
* Generated by LTspice 26.0.1 for Windows.
* Elements added to \ncompute current gain\nGi=I(V3)/I(V4)
* Element added to \ncompute voltage gain\nGv=-V(x)/V(y)
* Here the open loop gain is determined from the closed loop system[1].\nThe voltage gain and current gain are independently measured in\ntwo circuits identical except for the elements inserted into\nthe loop to make the measurements. Then the open loop gain\ncan be plotted by plotting the quantity:\n \n((I(V3)/I(V4))*(-V(x)/V(y))-1)/((I(V3)/I(V4))+(-V(x)/V(y))+2)\n \nAlternatively, you can add the lines\n.func Gi()=I(V3)/I(V4)\n.func Gv()=-V(x)/V(y)\n.func middlebrook(x,y) = (x*y-1)/(x+y+2)\nto your plot.defs file and then plot the quantity\nmiddlebrook(Gi(),Gv())
* This example schematic is supplied for informational/educational purposes only.
* 1] Middlebrook, R.D., "Measurement of Loop Gain in Feedback Systems", Int. J. Electronics, vol 38, No. 4, pp. 485-512, 1975
* This is exactly a copy from Frank Wiedmann's loopgain work.\nThanks Frank for your example.\n \nIf a single supply is used, especially take care of the input and \noutput voltage. The opamp has no gain if the output is at 0V.\nPlot this: ((I(V3)/I(V4))*(-V(x)/V(y))-1)/((I(V3)/I(V4))+(-V(x)/V(y))+2)
* Library below included based on ModelFile attribute of instance XU1, XU2 (C:\users\khalils\AppData\Local\LTspice\lib\sym\OpAmps\LTC6241.asy)
XU1 offs N001 +V -V N002 LTC6241 ;pnba IN+)IN-)VCC)VEE)OUT
R1 N003 0 10k
V1 +V 0 5
I1 0 Z AC 1
C4 N005 0 {CP}
C2 N006 N005 35n
XU2 offs N005 +V -V X LTC6241 ;pnba IN+)IN-)VCC)VEE)OUT
R6 Y N005 100
R2 N001 0 10k
V4 Z N003 0
R7 N006 Y 20
R3 N003 N001 100
R5 N005 0 10k
V6 offs 0 0
V3 Z N002 0
V2 Y X AC 1
R4 Y 0 10k
C3 N001 0 {CP}
C1 N004 N001 35n
R8 N004 N003 20
V5 -V 0 -5
.ac dec 30 .1 10Meg
.param CP=10u
.STEP PARAM Cp LIST 1n 10n 100n 1u 10u
.lib LTC4.lib
.backanno
.end

* LTspice schematic (.asc):
Version 4
SHEET 1 2412 1728
WIRE 384 80 384 64
WIRE 96 160 96 144
WIRE -128 176 -208 176
WIRE -48 176 -128 176
WIRE 64 176 -48 176
WIRE 288 192 128 192
WIRE 384 192 384 160
WIRE 384 192 368 192
WIRE 400 192 384 192
WIRE 432 192 400 192
WIRE 624 192 512 192
WIRE -128 208 -128 176
WIRE 64 208 32 208
WIRE -448 224 -448 208
WIRE -208 224 -208 176
WIRE 96 240 96 224
WIRE 624 240 624 192
WIRE 688 240 624 240
WIRE 688 256 688 240
WIRE -448 320 -448 304
WIRE -208 320 -208 288
WIRE -128 320 -128 288
WIRE 64 320 48 320
WIRE 144 320 128 320
WIRE 240 320 224 320
WIRE 688 352 688 336
WIRE -448 416 -448 400
WIRE -336 416 -336 400
WIRE -48 416 -48 176
WIRE 48 416 48 320
WIRE 48 416 -48 416
WIRE 80 416 48 416
WIRE 240 416 240 320
WIRE 240 416 160 416
WIRE 624 416 624 240
WIRE 624 416 240 416
WIRE -448 512 -448 496
WIRE -336 512 -336 496
WIRE 96 560 96 544
WIRE -128 576 -208 576
WIRE -48 576 -128 576
WIRE 64 576 -48 576
WIRE 352 592 128 592
WIRE 368 592 352 592
WIRE 480 592 448 592
WIRE 608 592 480 592
WIRE -128 608 -128 576
WIRE 64 608 32 608
WIRE -208 624 -208 576
WIRE 96 640 96 624
WIRE 608 640 608 592
WIRE 672 640 608 640
WIRE 672 656 672 640
WIRE -208 720 -208 688
WIRE -128 720 -128 688
WIRE 64 720 48 720
WIRE 144 720 128 720
WIRE 240 720 224 720
WIRE 672 752 672 736
WIRE -48 816 -48 576
WIRE 48 816 48 720
WIRE 48 816 -48 816
WIRE 80 816 48 816
WIRE 240 816 240 720
WIRE 240 816 160 816
WIRE 608 816 608 640
WIRE 608 816 240 816
LINE Normal 524 258 524 33
LINE Normal 274 258 524 258
LINE Normal 274 33 524 33
LINE Normal 274 258 274 33
LINE Normal 285 523 535 523
LINE Normal 285 681 535 681
LINE Normal 535 681 535 523
LINE Normal 285 681 285 523
SYMBOL res 656 640 R0
SYMATTR InstName R4
SYMATTR Value 10k
SYMBOL voltage 384 192 R90
WINDOW 0 -32 56 VBottom 0
WINDOW 3 32 56 VTop 0
SYMATTR InstName V3
SYMATTR Value 0
SYMBOL voltage -336 400 R0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR InstName V1
SYMATTR Value 5
SYMBOL cap 128 304 R90
WINDOW 0 0 32 VBottom 0
WINDOW 3 32 32 VTop 0
SYMATTR InstName C1
SYMATTR Value 35n
SYMBOL voltage 416 192 R270
WINDOW 0 32 56 VTop 0
WINDOW 3 -32 56 VBottom 0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR InstName V4
SYMATTR Value 0
SYMBOL res 128 336 R270
WINDOW 0 32 56 VTop 0
WINDOW 3 0 56 VBottom 0
SYMATTR InstName R8
SYMATTR Value 20
SYMBOL res -144 192 R0
SYMATTR InstName R2
SYMATTR Value 10k
SYMBOL voltage 464 592 R90
WINDOW 0 -32 56 VBottom 0
WINDOW 3 32 56 VTop 0
WINDOW 38 60 56 VTop 0
SYMATTR InstName V2
SYMATTR Value 1
SYMATTR SpiceModel AC
SYMBOL voltage -448 400 R0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR InstName V5
SYMATTR Value -5
SYMBOL cap -224 224 R0
SYMATTR InstName C3
SYMATTR Value {CP}
SYMBOL current 384 80 R0
WINDOW 38 39 48 Left 0
SYMATTR SpiceModel AC
SYMATTR InstName I1
SYMATTR Value 1
SYMBOL res -144 592 R0
SYMATTR InstName R5
SYMATTR Value 10k
SYMBOL res 128 736 R270
WINDOW 0 32 56 VTop 0
WINDOW 3 0 56 VBottom 0
SYMATTR InstName R7
SYMATTR Value 20
SYMBOL cap 128 736 M270
WINDOW 0 32 32 VTop 0
WINDOW 3 0 32 VBottom 0
SYMATTR InstName C2
SYMATTR Value 35n
SYMBOL cap -224 624 R0
SYMATTR InstName C4
SYMATTR Value {CP}
SYMBOL res 672 240 R0
SYMATTR InstName R1
SYMATTR Value 10k
SYMBOL voltage -448 208 R0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR InstName V6
SYMATTR Value 0
SYMBOL res 176 400 R90
WINDOW 0 0 56 VBottom 0
WINDOW 3 32 56 VTop 0
SYMATTR InstName R3
SYMATTR Value 100
SYMBOL res 176 832 M270
WINDOW 0 32 56 VTop 0
WINDOW 3 0 56 VBottom 0
SYMATTR InstName R6
SYMATTR Value 100
SYMBOL Opamps\\LTC6241 96 192 R0
SYMATTR InstName U1
SYMBOL Opamps\\LTC6241 96 592 R0
SYMATTR InstName U2
FLAG 384 64 0
FLAG -336 512 0
FLAG -128 320 0
FLAG 688 352 0
FLAG -128 720 0
FLAG 352 592 X
FLAG 480 592 Y
FLAG 96 144 +V
FLAG -336 400 +V
FLAG -448 512 0
FLAG -448 400 -V
FLAG 96 240 -V
FLAG 96 544 +V
FLAG 96 640 -V
FLAG 672 752 0
FLAG 400 192 Z
FLAG 32 208 offs
FLAG 32 608 offs
FLAG -448 320 0
FLAG -448 208 offs
FLAG -208 320 0
FLAG -208 720 0
TEXT -536 592 Left 0 !.ac dec 30 .1 10Meg
TEXT 272 -40 Left 0 ;Elements added to \ncompute current gain\nGi=I(V3)/I(V4)
TEXT 288 448 Left 0 ;Element added to \ncompute voltage gain\nGv=-V(x)/V(y)
TEXT -456 -272 Left 0 ;Here the open loop gain is determined from the closed loop system[1].\nThe voltage gain and current gain are independently measured in\ntwo circuits identical except for the elements inserted into\nthe loop to make the measurements.  Then the open loop gain\ncan be plotted by plotting the quantity:\n \n((I(V3)/I(V4))*(-V(x)/V(y))-1)/((I(V3)/I(V4))+(-V(x)/V(y))+2)\n \nAlternatively, you can add the lines\n.func Gi()=I(V3)/I(V4)\n.func Gv()=-V(x)/V(y)\n.func middlebrook(x,y) = (x*y-1)/(x+y+2)\nto your plot.defs file and then plot the quantity\nmiddlebrook(Gi(),Gv())
TEXT -304 904 Left 0 ;This example schematic is supplied for informational/educational purposes only.
TEXT -544 872 Left 0 ;1] Middlebrook, R.D., "Measurement of Loop Gain in Feedback Systems", Int. J. Electronics, vol 38, No. 4, pp. 485-512, 1975
TEXT -456 -496 Left 0 ;This is exactly a copy from Frank Wiedmann's loopgain work.\nThanks Frank for your example.\n \nIf a single supply is used, especially take care of the input and \noutput voltage. The opamp has no gain if the output is at 0V.\nPlot this:  ((I(V3)/I(V4))*(-V(x)/V(y))-1)/((I(V3)/I(V4))+(-V(x)/V(y))+2)
TEXT -528 640 Left 0 !.param CP=10u
TEXT -544 768 Left 0 !.STEP PARAM Cp LIST 1n 10n 100n 1u 10u