summaryrefslogtreecommitdiff
path: root/Electronic_Principles/Chapter_19_New.ipynb
blob: 2cb36ac19c30e6cd2f228254790dba49ae3526f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "CHAPTER 19 NEGATIVE FEEDBACK"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 19-1, Page 709"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "Vin=50                            #input voltage(mV)\n",
      "Rf=3.9                            #feedback path resistance Rf (KOhm)\n",
      "R1=0.1                            #inverting input resistance R1(KOhm)\n",
      "AVOL=100000                       #open loop voltage gain\n",
      "\n",
      "B=R1/(Rf+R1)                     #feedback fraction\n",
      "Av=B**-1                         #closed loop voltage gain\n",
      "Err=100/(1+AVOL*B)               #percent error (%)\n",
      "Av1=Av-((Av/100)*Err)            #closed loop voltage gain1\n",
      "Av2=AVOL/(1+AVOL*B)              #closed loop voltage gain2\n",
      "\n",
      "print 'closed loop voltage gain by approach 1 = ',round(Av1,2)\n",
      "print 'closed loop voltage gain by approach 2 = ',round(Av2,2)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "closed loop voltage gain by approach 1 =  39.98\n",
        "closed loop voltage gain by approach 2 =  39.98\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 19-2, Page 713"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "Vin=50                            #input voltage(mV)\n",
      "Rf=3.9*10**3                      #feedback path resistance Rf (Ohm)\n",
      "R1=100                            #inverting input resistance R1(Ohm)\n",
      "AVOL=100000                       #open loop voltage gain\n",
      "B=0.025                           #feedback fraction\n",
      "Rin=2*10**6                       #open loop input resistance(Ohm)\n",
      "RCM=200*10**6                     #common mode input resistance(Ohm)\n",
      "\n",
      "Zin_CL=(1+(AVOL*B))*Rin           #closed loop input impedance(Ohm)\n",
      "Zin_CL1=RCM*Zin_CL/(RCM+Zin_CL)   #closed loop input impedance(Ohm)\n",
      "\n",
      "print 'closed loop input impedance Zin(CL) = ',round((Zin_CL1/10**6),2),'MOhm'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "closed loop input impedance Zin(CL) =  192.31 MOhm\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 19-3, Page 714"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "Rout=75                           #open loop output resistance(Ohm)\n",
      "AVOL=100000                       #open loop voltage gain\n",
      "B=0.025                           #feedback fraction\n",
      "\n",
      "Zout_CL=Rout/(1+AVOL*B)           #closed loop input impedance(Ohm)\n",
      "\n",
      "print 'closed loop output impedance Zout(CL) = ',round(Zout_CL,2),'Ohm'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "closed loop output impedance Zout(CL) =  0.03 Ohm\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 19-4, Page 714"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "THD=7.5                           #open loop total harmonic distortion (%)\n",
      "AVOL=100000                       #open loop voltage gain\n",
      "B=0.025                           #feedback fraction\n",
      "\n",
      "THD_CL=THD/(1+AVOL*B)             #closed loop total harmonic distortion (%)\n",
      "\n",
      "print 'Closed loop total harmonic distortion THD(CL) = ',round(THD_CL,3),'%'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Closed loop total harmonic distortion THD(CL) =  0.003 %\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 19-5, Page 716"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "Iin=1                             #input current(mA)\n",
      "Rf=5                              #feedback path resistance Rf (KOhm)\n",
      "\n",
      "Vout=-(Iin*Rf)                    #Output voltage at 1KHz (Vpp) \n",
      "\n",
      "print 'Output ac voltage at 1KHz Vout = ',Vout,'Vpp'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Output ac voltage at 1KHz Vout =  -5 Vpp\n"
       ]
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 19-6, Page 717"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "Rout=75.0                           #open loop output resistance(Ohm)\n",
      "AVOL=100000                         #open loop voltage gain\n",
      "Rf=5.0*10**3                        #feedback path resistance(Ohm)\n",
      "\n",
      "Zin_CL=Rf/(1+AVOL)              #closed loop input impedance(Ohm)\n",
      "Zout_CL=Rout/(1+AVOL)           #closed loop input impedance(Ohm)\n",
      "\n",
      "print 'closed loop input impedance Zin(CL) = ',round(Zin_CL,2),'Ohm'\n",
      "print 'closed loop output impedance Zout(CL) = ',round(Zout_CL,5),'Ohm'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "closed loop input impedance Zin(CL) =  0.05 Ohm\n",
        "closed loop output impedance Zout(CL) =  0.00075 Ohm\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 19-7, Page 718"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "Vin=2                              #input voltage(Vrms)\n",
      "RL1=2                              #load resistance (KOhm)\n",
      "R1=1                               #inverting input resistance R1(KOhm)\n",
      "RL2=4                              #load resistance(KOhm)\n",
      "\n",
      "iout=Vin/R1                         #output current (mA)\n",
      "PL1=(iout**2)*RL1                   #load power for 2 Ohm (W) \n",
      "PL2=(iout**2)*RL2                   #load power for 4 Ohm (W) \n",
      "\n",
      "print 'load power for 2 Ohm = ',PL1,'W'\n",
      "print 'load power for 4 Ohm = ',PL2,'W'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "load power for 2 Ohm =  8 W\n",
        "load power for 4 Ohm =  16 W\n"
       ]
      }
     ],
     "prompt_number": 26
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 19-8, Page 720"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "import math\n",
      "\n",
      "Iin=1.5*10**-3                     #input current(mA)\n",
      "RL1=1                              #load resistance (KOhm)\n",
      "R1=1                               #inverting input resistance R1(KOhm)\n",
      "RL2=2                              #load resistance (KOhm)\n",
      "Rf=1*10**3                         #feedback path resistance(Ohm)\n",
      "\n",
      "Ai=math.ceil(1+(Rf/R1))             #current gain\n",
      "iout=Iin*Ai                         #output current (mA)\n",
      "PL1=(iout**2)*RL1                   #load power for 1 Ohm (W) \n",
      "PL2=(iout**2)*RL2                   #load power for 2 Ohm (W) \n",
      "\n",
      "print 'load power for 2 Ohm = ',round(PL1,2),'W'\n",
      "print 'load power for 4 Ohm = ',round(PL2,2),'W'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "load power for 2 Ohm =  2.25 W\n",
        "load power for 4 Ohm =  4.51 W\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 19-9, Page 723"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "AB=1000                            #(1+AvolB) term \n",
      "f2_OL=160                          #open loop bandwidth(Hz)\n",
      "\n",
      "f2_CL=f2_OL*AB/1000               #closed loop bandwidth(KHz)\n",
      "\n",
      "print 'closed loop bandwidth f2(CL)= ',f2_CL,'KHZ'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "closed loop bandwidth f2(CL)=  160 KHZ\n"
       ]
      }
     ],
     "prompt_number": 29
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 19-10, Page 723"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "AVOL=250000                             #open loop voltage gain\n",
      "f2_OL=1.2                               #open loop bandwidth(Hz)\n",
      "Av_CL=50                                #closed loop voltage gain\n",
      "\n",
      "f2_CL=f2_OL*AVOL/Av_CL/1000             #closed loop bandwidth(KHz)\n",
      "\n",
      "print 'closed loop bandwidth for Av(CL) = 50, f2(CL)= ',f2_CL,'KHZ'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "closed loop bandwidth for Av(CL) = 50, f2(CL)=  6.0 KHZ\n"
       ]
      }
     ],
     "prompt_number": 32
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 19-11, Page 724"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "AVOL=50000                              #open loop voltage gain\n",
      "f2_OL=14                                #open loop bandwidth(Hz)\n",
      "\n",
      "f2_CL=f2_OL*(1+AVOL)/1000               #closed loop bandwidth(KHz)\n",
      "\n",
      "print 'closed loop bandwidth f2(CL)= ',f2_CL,'KHZ'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "closed loop bandwidth f2(CL)=  700 KHZ\n"
       ]
      }
     ],
     "prompt_number": 35
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 19-12, Page 724"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "AB=2500                            #(1+AvolB) term \n",
      "f2_OL=20                           #open loop bandwidth(Hz)\n",
      "\n",
      "f2_CL=f2_OL*AB/1000                #closed loop bandwidth(KHz)\n",
      "\n",
      "print 'closed loop bandwidth f2(CL)= ',f2_CL,'KHZ'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "closed loop bandwidth f2(CL)=  50 KHZ\n"
       ]
      }
     ],
     "prompt_number": 38
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 19-13, Page 724"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "import math\n",
      "\n",
      "Av_CL=10.0                                #voltage gain\n",
      "Funity=1*10**6                            #unity frequency (Hz) \n",
      "Sr=0.5                                    #slew rate (V/us)\n",
      "\n",
      "f2_CL=Funity/Av_CL/1000                    #closed loop bandwidth(KHz)\n",
      "Vp_max=1000*Sr/(2*math.pi*f2_CL)            #largest peak output voltage(V)\n",
      "\n",
      "print 'closed loop bandwidth f2(CL)= ',f2_CL,'KHZ'\n",
      "print 'largest peak output voltage Vp(max)= ',round(Vp_max,3),'V'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "closed loop bandwidth f2(CL)=  100.0 KHZ\n",
        "largest peak output voltage Vp(max)=  0.796 V\n"
       ]
      }
     ],
     "prompt_number": 13
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": []
    }
   ],
   "metadata": {}
  }
 ]
}