* Z:\home\khalils\Downloads\files\data\raw_asc\4e5dee35a1f3_opwien1.asc
* Generated by LTspice 26.0.1 for Windows.
* Wien Bridge Oscillator\nHelmut Sennewald\nhttp://www.ecircuitcenter.com/Circuits/opwien/opwien.htm\n \nThe big drawback of this Wien-oscillator is that \nthe amplitiude is very dependent on the tolerance \nof the resistors R10, R11, R12.\n Amplitude variation is from 6V to 18V even with \n1% resistors.
* OPWIEN.CIR - OPAMP WIEN-BRIDGE OSCILLATOR\n* http://www.ecircuitcenter.com/Circuits/opwien/opwien.htm\n*\n* CURRENT PULSE TO START OSCILLATIONS\nIS 0 3 PWL(0U 0M 10U 0.1M 40U 0.1M 50U 0M 10M 0M)\n*\n* RC TUNING\nR2 4 6 10K\nC2 6 3 16NF\nR1 3 0 10K\nC1 3 0 16NF\n* NON-INVERTING OPAMP\nR10 0 2 10K\nR11 2 5 18K\nXOP 3 2 4 OPAMP1\n* AMPLITUDE STABILIZATION\nR12 5 4 5K\nD1 5 4 D1N914\nD2 4 5 D1N914\n*\n.model D1N914 D(Is=0.1p Rs=16 CJO=2p Tt=12n Bv=100 Ibv=0.1p)\n*\n* OPAMP MACRO MODEL, SINGLE-POLE \n* connections: non-inverting input\n* | inverting input\n* | | output\n* | | |\n.SUBCKT OPAMP1 1 2 6\n* INPUT IMPEDANCE\nRIN 1 2 10MEG\n* DC GAIN (100K) AND POLE 1 (100HZ)\nEGAIN 3 0 1 2 100K\nRP1 3 4 1K\nCP1 4 0 1.5915UF\n* OUTPUT BUFFER AND RESISTANCE\nEBUFFER 5 0 4 0 1\nROUT 5 6 10\n.ENDS\n*\n* ANALYSIS\n.TRAN 0.05MS 10MS
* INPUT IMPEDANCE
* DC GAIN (100K) AND POLE 1 (100HZ)
* OUTPUT BUFFER AND RESISTANCE
*
*B1 50 0 V=limit(V(5),-10,10)
*ROUT 50 6 10
* Monte Carlo Analysis
* --------------------------------
*
*
*
*
*
*.param IS=0.01p*(1+100*rand(stp+8000)) ;115mV
* Debug with .measure
* Principle of MC with LTspice\n \n1. Stepped sweep with any parameter, here 'stp'.\n \n2. Use a different rand() function for each value.\nThis can be done with an offset in the rand().\nrand(stp+10000)\nrand(stp+20000)\n...\n \n3. Add the tolerance multiplied with the rand()\n.param R1X=5k*(1+tol(-0.5+rand(stp+10000))\n.param R2X=1k*(1+tol(-0.5+rand(stp+20000))\n...\n \n4. You can use ".measure" to extract results.\nPlease watch the output from ".measure" in \nthe SPICE-Error-Log File or with\nView->SPICE Error Log
ROUT 5 6 10
D2 out 3 D1N914
CP1 4 0 1.5915UF
RP1 3 4 1K
C1 1 0 {C1}
R10 0 2 {R10}
RIN 1 2 10MEG
R1 1 0 {R1}
R11 2 3 {R11}
C2 1 4 {C2}
EGAIN 3 0 1 2 100K
R12 3 out {R12}
EBUFFER 5 0 4 0 1
D1 3 out D1N914
XU1 2 1 out opamp1 ;pnba invin)noninvin)out
R2 4 out {R2}
.model D D
.lib C:\users\khalils\AppData\Local\LTspice\lib\cmp\standard.dio
.tran 0 20m 12m 1u
.options plotwinsize=0
.SUBCKT OPAMP1 2 1 6
.ENDS
.model D1N914 D(Is={IS} Rs=16 CJO=2p Tt=12n Bv=100 Ibv=0.1p)
.ic v(1)=.01
.step param stp 1 100 1 ; 100 simulations
.param tol1=0.01 ; resistor GAIN
.param tol2=0.01 ; resistor R*C
.param tol3=0.05 ; capacitor R*C
.param Isnom=0.1p ; nominal Is
.param dVf=60m ; Vf tolerance +/-60mV
.param Ismin=Isnom/(exp(dVf/25m))
.param Isdelta=Ismin*(exp(2*dVf/25m)-1)
.param R10=10k*(1-tol1+tol1*2*rand(stp+1000))
.param R11=18k*(1-tol1+tol1*2*rand(stp+2000))
.param R12=5k*(1-tol1+tol1*2*rand(stp+3000))
.param R1=10k*(1-tol2+tol2*2*rand(stp+4000))
.param R2=10k*(1-tol2+tol2*2*rand(stp+5000))
.param C1=10n*(1-tol3+tol3*2*rand(stp+6000))
.param C2=10n*(1-tol3+tol3*2*rand(stp+7000))
.param IS=Ismin+Isdelta*rand(stp+8000)
.measure tran T1 FIND time WHEN V(out)=0 rise=1 TD=1ms
.measure tran T2 FIND time WHEN V(out)=0 rise=6 TD=1ms
.measure tran freq param 5/(T2-T1)
.measure tran vplus MAX V(out) rise=1 from 1ms
.measure tran vminus MIN V(out) fall=1 from 1ms
.measure tran vpeak param (vplus-vminus)*0.5
.options nomarch
.measure tran ISsim param IS
.measure tran R10sim param R10
.backanno
.end

* LTspice schematic (.asc):
Version 4
SHEET 1 2932 1164
WIRE -160 336 -160 320
WIRE -112 320 -160 320
WIRE -96 624 -96 576
WIRE -96 736 -96 688
WIRE -48 576 -96 576
WIRE -32 736 -96 736
WIRE -32 768 -32 736
WIRE 0 320 -32 320
WIRE 16 320 0 320
WIRE 16 432 16 320
WIRE 16 576 -48 576
WIRE 16 576 16 464
WIRE 16 624 16 576
WIRE 16 736 -32 736
WIRE 16 736 16 704
WIRE 64 320 16 320
WIRE 64 432 16 432
WIRE 64 464 16 464
WIRE 64 576 16 576
WIRE 144 576 128 576
WIRE 160 320 144 320
WIRE 176 224 176 128
WIRE 176 320 160 320
WIRE 176 320 176 224
WIRE 176 576 144 576
WIRE 208 128 176 128
WIRE 208 224 176 224
WIRE 208 320 176 320
WIRE 320 128 272 128
WIRE 320 224 272 224
WIRE 320 224 320 128
WIRE 320 320 288 320
WIRE 320 320 320 224
WIRE 320 448 128 448
WIRE 320 448 320 320
WIRE 320 576 256 576
WIRE 320 576 320 448
WIRE 352 448 320 448
IOPIN 352 448 Out
RECTANGLE Normal 944 344 512 216
RECTANGLE Normal 1104 88 512 -616
RECTANGLE Normal 1832 -392 1144 -616
SYMBOL Opamps\\opamp 96 384 R0
WINDOW 3 21 87 Left 0
SYMATTR Value opamp1
SYMATTR InstName U1
SYMATTR SpiceLine ""
SYMATTR SpiceLine2 ""
SYMBOL cap -112 624 R0
SYMATTR InstName C1
SYMATTR Value {C1}
SYMBOL cap 64 592 R270
WINDOW 0 32 32 VTop 0
WINDOW 3 0 32 VBottom 0
SYMATTR InstName C2
SYMATTR Value {C2}
SYMBOL res 48 336 R270
WINDOW 0 32 56 VTop 0
WINDOW 3 0 56 VBottom 0
SYMATTR InstName R11
SYMATTR Value {R11}
SYMBOL diode 272 208 R90
WINDOW 0 0 32 VBottom 0
WINDOW 3 32 32 VTop 0
SYMATTR InstName D2
SYMATTR Value D1N914
SYMBOL diode 208 144 R270
WINDOW 0 32 32 VTop 0
WINDOW 3 0 32 VBottom 0
SYMATTR InstName D1
SYMATTR Value D1N914
SYMBOL res 0 608 R0
SYMATTR InstName R1
SYMATTR Value {R1}
SYMBOL res -128 336 R270
WINDOW 0 32 56 VTop 0
WINDOW 3 0 56 VBottom 0
SYMATTR InstName R10
SYMATTR Value {R10}
SYMBOL res 160 592 R270
WINDOW 0 32 56 VTop 0
WINDOW 3 0 56 VBottom 0
SYMATTR InstName R2
SYMATTR Value {R2}
SYMBOL res 192 336 R270
WINDOW 0 32 56 VTop 0
WINDOW 3 0 56 VBottom 0
SYMATTR InstName R12
SYMATTR Value {R12}
FLAG -160 336 0
FLAG -32 768 0
FLAG 352 448 out
FLAG -48 576 1
FLAG 0 320 2
FLAG 160 320 3
FLAG 144 576 4
TEXT -136 -720 Left 0 ;Wien Bridge Oscillator\nHelmut Sennewald\nhttp://www.ecircuitcenter.com/Circuits/opwien/opwien.htm\n \nThe big drawback of this Wien-oscillator is that \nthe amplitiude is very dependent on the tolerance \nof the resistors R10, R11, R12.\n Amplitude variation is from 6V to 18V even with \n1% resistors.
TEXT 1160 -360 Left 0 ;OPWIEN.CIR - OPAMP WIEN-BRIDGE OSCILLATOR\n* http://www.ecircuitcenter.com/Circuits/opwien/opwien.htm\n*\n* CURRENT PULSE TO START OSCILLATIONS\nIS       0      3   PWL(0U 0M   10U 0.1M   40U 0.1M   50U 0M   10M 0M)\n*\n* RC TUNING\nR2      4       6       10K\nC2      6       3       16NF\nR1      3       0       10K\nC1      3       0       16NF\n* NON-INVERTING OPAMP\nR10     0       2       10K\nR11     2       5       18K\nXOP     3 2     4       OPAMP1\n* AMPLITUDE STABILIZATION\nR12     5       4       5K\nD1      5       4       D1N914\nD2      4       5       D1N914\n*\n.model  D1N914  D(Is=0.1p Rs=16 CJO=2p Tt=12n Bv=100 Ibv=0.1p)\n*\n* OPAMP MACRO MODEL, SINGLE-POLE \n* connections:      non-inverting input\n*                   |   inverting input\n*                   |   |   output\n*                   |   |   |\n.SUBCKT OPAMP1      1   2   6\n* INPUT IMPEDANCE\nRIN     1       2       10MEG\n* DC GAIN (100K) AND POLE 1 (100HZ)\nEGAIN   3 0     1 2     100K\nRP1     3       4       1K\nCP1     4       0       1.5915UF\n* OUTPUT BUFFER AND RESISTANCE\nEBUFFER         5 0     4 0     1\nROUT    5       6       10\n.ENDS\n*\n* ANALYSIS\n.TRAN   0.05MS 10MS
TEXT -120 144 Left 0 !.tran 0 20m 12m 1u
TEXT -120 168 Left 0 !.options plotwinsize=0
TEXT 512 392 Left 0 !.SUBCKT OPAMP1      2   1   6\n* INPUT IMPEDANCE\nRIN     1       2       10MEG\n* DC GAIN (100K) AND POLE 1 (100HZ)\nEGAIN   3 0     1 2     100K\nRP1     3       4       1K\nCP1     4       0       1.5915UF\n* OUTPUT BUFFER AND RESISTANCE\nEBUFFER         5 0     4 0     1\n*\n*B1 50 0 V=limit(V(5),-10,10)\n*ROUT    50      6       10\nROUT      5      6      10\n.ENDS
TEXT 464 136 Left 0 !.model  D1N914  D(Is={IS} Rs=16 CJO=2p Tt=12n Bv=100 Ibv=0.1p)
TEXT -120 224 Left 0 !.ic v(1)=.01
TEXT 552 -584 Left 0 !* Monte Carlo Analysis\n* --------------------------------\n.step param stp 1 100 1    ; 100 simulations\n*\n.param tol1=0.01   ; resistor GAIN\n.param tol2=0.01   ; resistor R*C\n.param tol3=0.05   ; capacitor R*C\n.param Isnom=0.1p ; nominal Is\n.param dVf=60m   ; Vf tolerance +/-60mV\n.param Ismin=Isnom/(exp(dVf/25m))\n.param Isdelta=Ismin*(exp(2*dVf/25m)-1)\n*\n.param R10=10k*(1-tol1+tol1*2*rand(stp+1000))\n.param R11=18k*(1-tol1+tol1*2*rand(stp+2000))\n.param R12=5k*(1-tol1+tol1*2*rand(stp+3000))\n*\n.param R1=10k*(1-tol2+tol2*2*rand(stp+4000))\n.param R2=10k*(1-tol2+tol2*2*rand(stp+5000))\n*\n.param C1=10n*(1-tol3+tol3*2*rand(stp+6000))\n.param C2=10n*(1-tol3+tol3*2*rand(stp+7000))\n*\n*.param IS=0.01p*(1+100*rand(stp+8000)) ;115mV\n.param IS=Ismin+Isdelta*rand(stp+8000)
TEXT 1160 -592 Left 0 !.measure tran T1 FIND time WHEN V(out)=0 rise=1 TD=1ms\n.measure tran T2 FIND time WHEN V(out)=0 rise=6 TD=1ms\n.measure tran freq param 5/(T2-T1)\n \n.measure tran vplus MAX V(out) rise=1 from 1ms\n.measure tran vminus MIN V(out) fall=1 from 1ms\n.measure tran vpeak param (vplus-vminus)*0.5
TEXT -120 192 Left 0 !.options nomarch
TEXT 552 248 Left 0 !* Debug with .measure \n.measure tran ISsim param IS\n.measure tran R10sim param R10
TEXT -136 -440 Left 0 ;Principle of MC with LTspice\n \n1. Stepped sweep with any parameter, here 'stp'.\n \n2. Use a different rand() function for each value.\nThis can be done with an offset in the rand().\nrand(stp+10000)\nrand(stp+20000)\n...\n \n3. Add the tolerance multiplied with the rand()\n.param R1X=5k*(1+tol(-0.5+rand(stp+10000))\n.param R2X=1k*(1+tol(-0.5+rand(stp+20000))\n...\n \n4. You can use ".measure" to extract results.\nPlease watch the output from ".measure" in \nthe SPICE-Error-Log File or with\nView->SPICE Error Log