summaryrefslogtreecommitdiff
path: root/Electronic_Principles/Chapter_23.ipynb
blob: a842cb818d83ddc5370132bbcd79479d5ddf9dfb (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
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "CHAPTER 23 OSCILLATORS"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 23-1, Page 897  "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "R1=100.0*10**3                        #non-inverting input resistance wiper R1(Ohm)\n",
      "R2=1.0*10**3                          #non-inverting input resistance R2(Ohm)\n",
      "C=0.01*10**-6                         #capacitance at non-inverting input(F)\n",
      "\n",
      "R=R1+R2                                         #max. total resistance(Ohm)\n",
      "fr1=(2*math.pi*R*C)**-1                          #minimum frequency(Hz)\n",
      "R=R2                                            #min. total resistance(Ohm)\n",
      "fr2=(2*math.pi*R*C)**-1                          #maximum frequency(Hz)\n",
      "\n",
      "print 'minimum frequency fr = ',round(fr1,2),'Hz'\n",
      "print 'maximum frequency fr = ',round((fr2/1000),2),'KHz'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "minimum frequency fr =  157.58 Hz\n",
        "maximum frequency fr =  15.92 KHz\n"
       ]
      }
     ],
     "prompt_number": 15
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 23-2, Page 897"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "Rf=2                         #feedback resistance(KOhm)\n",
      "Rl=1                         #lamp resistance(KOhm)\n",
      "Vl=2                         #lamp voltage(V)\n",
      "\n",
      "Il=Vl/Rl                     #lamp current(mA)\n",
      "Vout=Il*(Rf+Rl)              #output voltage of oscillator(V)\n",
      "\n",
      "print 'Lamp current = ',Il,'mA'\n",
      "print 'output voltage of oscillator = ',Vout,'Vrms'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Lamp current =  2 mA\n",
        "output voltage of oscillator =  6 Vrms\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 23-3, Page 904"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "C1=0.001*10**-6                     #capacitance in oscillator(F)\n",
      "C2=0.01*10**-6                      #capacitance in oscillator(F)\n",
      "L=15*10**-6                         #inductance(H)\n",
      "\n",
      "C=C1*C2/(C1+C2)                    #equivalent capacitance(F)\n",
      "fr=(2*math.pi*((L*C)**0.5))**-1     #oscillation frequency(Hz)\n",
      "B=C1/C2                            #feedback fraction\n",
      "Av_min=C2/C1                       #minimum voltage gain\n",
      "\n",
      "print 'feedback fraction B = ',B\n",
      "print 'oscillation frequency fr = ',round((fr*10**-6),2),'MHz'\n",
      "print 'minimum voltage gain Av(min) = ',Av_min"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "feedback fraction B =  0.1\n",
        "oscillation frequency fr =  1.36 MHz\n",
        "minimum voltage gain Av(min) =  10.0\n"
       ]
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 23-4, Page 908"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "C1=0.001*10**-6                     #capacitance in oscillator(F)\n",
      "C2=0.01*10**-6                      #capacitance in oscillator(F)\n",
      "C3=50.0*10**-12                     #capacitance in oscillator(F)\n",
      "L=15*10**-6                         #inductance(H)\n",
      "\n",
      "C=(C1**-1+C2**-1+C3**-1)**-1                  #equivalent capacitance(F)\n",
      "fr=(2*math.pi*((L*C)**0.5))**-1                #oscillation frequency(Hz)\n",
      "\n",
      "print 'oscillation frequency fr = ',round((fr*10**-6),2),'MHz'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "oscillation frequency fr =  5.97 MHz\n"
       ]
      }
     ],
     "prompt_number": 13
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 23-5, Page 912"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "import math\n",
      "\n",
      "Cs=0.05*10**-12                       #series capacitance in oscillator(F)\n",
      "Cm=10.0*10**-12                       #capacitance in oscillator(F)\n",
      "R=2.0*10**3                           #resistance in oscillator(Ohm)\n",
      "L=3                                   #inductance(H)\n",
      "\n",
      "fs=(2*math.pi*((L*Cs)**0.5))**-1                #series resonant frequency(Hz)\n",
      "Cp=Cs*Cm/(Cs+Cm)                               #equvalent parallel capacitance(F)\n",
      "fp=(2*math.pi*((L*Cp)**0.5))**-1                #parallel resonant frequency(Hz)\n",
      "\n",
      "print 'series resonant frequency fs = ',math.ceil(fs*10**-3),'KHz'\n",
      "print 'parallel resonant frequency fp = ',math.ceil(fp*10**-3),'KHz'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "series resonant frequency fs =  411.0 KHz\n",
        "parallel resonant frequency fp =  412.0 KHz\n"
       ]
      }
     ],
     "prompt_number": 16
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 23-6, Page 918"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "VCC=12.0                              #given supply voltage(V)\n",
      "R=33*10**3                            #given resistance(Ohm)\n",
      "C=0.47*10**-6                         #given capacitance(F)\n",
      "\n",
      "LTP=VCC/3                             #trip point LTP (V)\n",
      "UTP=2*LTP                             #trip point UTP (V)\n",
      "W=1.1*R*C                             #pulse width of output(s)\n",
      "\n",
      "print 'trigger voltage LTP = ',LTP,'V'\n",
      "print 'trigger voltage UTP = ',UTP,'V'\n",
      "print 'pulse width W = ',W*10**3,'ms'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "trigger voltage LTP =  4.0 V\n",
        "trigger voltage UTP =  8.0 V\n",
        "pulse width W =  17.061 ms\n"
       ]
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 23-7, Page 919"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "R=10*10**6                            #given resistance(Ohm)\n",
      "C=470*10**-6                          #given capacitance(F)\n",
      "\n",
      "W=1.1*R*C                             #pulse width of output(s)\n",
      "\n",
      "print 'pulse width W = ',W,'s = ',round((W/3600),2),'hours'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "pulse width W =  5170.0 s =  1.44 hours\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 23-8, Page 922"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "R1=75.0*10**3                            #given resistance1(Ohm)\n",
      "R2=30.0*10**3                            #given resistance2(Ohm)\n",
      "C=47.0*10**-9                            #given capacitance(F)\n",
      "\n",
      "f=1.44/((R1+(2*R2))*C)                 #frequency (Hz)\n",
      "D=(R1+R2)/(R1+(2*R2))                  #duty cycle     \n",
      "\n",
      "print 'frequency f = ',round(f,2),'Hz' \n",
      "print 'duty cycle D = ',round((D*100),2),'%'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "frequency f =  226.95 Hz\n",
        "duty cycle D =  77.78 %\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 23-9, Page 923"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "import math\n",
      "\n",
      "VCC=12.0                                 #given supply voltage(V)\n",
      "R1=75.0*10**3                            #given resistance1(Ohm)\n",
      "R2=30.0*10**3                            #given resistance2(Ohm)\n",
      "C=47.0*10**-9                            #given capacitance(F)\n",
      "Vcon1=11                                 #given Vcon(V)     \n",
      "Vcon2=1                                  #given Vcon(V)     \n",
      "\n",
      "W1=-(R1+R2)*C*(math.log((VCC-Vcon1)/(VCC-(0.5*Vcon1))))     #pulse width(s)\n",
      "T1=W1+(0.693*R2*C)                                          #period(s)\n",
      "D1=W1/T1                                                    #duty cycle\n",
      "f1=1/T1                                                     #frequency(Hz)\n",
      "W2=-(R1+R2)*C*(math.log((VCC-Vcon2)/(VCC-(0.5*Vcon2))))     #pulse width(s)\n",
      "T2=W2+(0.693*R2*C)                                          #period(s)\n",
      "D2=W2/T2                                                    #duty cycle\n",
      "f2=1/T2                                                     #frequency(Hz)\n",
      "\n",
      "print 'For Vcon = 11V,'\n",
      "print 'frequency f = ',round(f1,2),'Hz'\n",
      "print 'duty cycle D = ',round((D1*100),2),'%'\n",
      "print 'For Vcon = 1V,'\n",
      "print 'frequency f = ',round(f2,2),'Hz'\n",
      "print 'duty cycle D = ',round((D2*100),2),'%'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "For Vcon = 11V,\n",
        "frequency f =  97.9 Hz\n",
        "duty cycle D =  90.43 %\n",
        "For Vcon = 1V,\n",
        "frequency f =  835.77 Hz\n",
        "duty cycle D =  18.33 %\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 23-10, Page 927"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "VCC=12.0                                 #given supply voltage(V)\n",
      "R=9.1*10**3                              #given resistance(Ohm)\n",
      "C=0.01*10**-6                            #given capacitance(F)\n",
      "f=2.5*10**3                              #given frequency(Hz)\n",
      "Vmod=2                                   #peak value of modulating signal(V)                         \n",
      "\n",
      "T=1/f                                    #period of output pulse(s)\n",
      "W=1.1*R*C                                #pulse width(s)\n",
      "UTP_max=(2*VCC/3)+Vmod                   #maximum UTP(V)\n",
      "UTP_min=(2*VCC/3)-Vmod                   #minimum UTP(V)\n",
      "Wmin=-R*C*(math.log(1-(UTP_min/VCC)))    #minimum pulse width(s)\n",
      "Wmax=-R*C*(math.log(1-(UTP_max/VCC)))    #maximum pulse width(s)\n",
      "Dmin=Wmin/T                              #minimum duty cycle\n",
      "Dmax=Wmax/T                              #maximum duty cycle\n",
      "\n",
      "print 'period of output pulse T = ',T*10**6,'us'\n",
      "print 'Quiscent pulse width W = ',W*10**6,'us'\n",
      "print 'minimum UTP = ',UTP_min,'V'\n",
      "print 'maximum UTP = ',UTP_max,'V'\n",
      "print 'minimum pulse width W(min) = ',round((Wmin*10**6),2),'us'\n",
      "print 'maximum pulse width W(max) = ',round((Wmax*10**6),2),'us'\n",
      "print 'minimum duty cycle D(min) = ',round((Dmin*100),2),'%'\n",
      "print 'maximum duty cycle D(max) = ',round((Dmax*100),2),'%'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "period of output pulse T =  400.0 us\n",
        "Quiscent pulse width W =  100.1 us\n",
        "minimum UTP =  6.0 V\n",
        "maximum UTP =  10.0 V\n",
        "minimum pulse width W(min) =  63.08 us\n",
        "maximum pulse width W(max) =  163.05 us\n",
        "minimum duty cycle D(min) =  15.77 %\n",
        "maximum duty cycle D(max) =  40.76 %\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 23-11, Page 928"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "VCC=12.0                                 #given supply voltage(V)\n",
      "R1=3.9*10**3                             #given resistance(Ohm)\n",
      "R2=3*10**3                               #given resistance(Ohm)\n",
      "C=0.01*10**-6                            #given capacitance(F)\n",
      "Vmod=1.5                                 #peak value of modulating signal(V)                         \n",
      "\n",
      "W=0.693*(R1+R2)*C                                              #pulse width(s)\n",
      "T=0.693*(R1+(2*R2))*C                                          #period of output pulse(s)\n",
      "UTP_max=(2*VCC/3)+Vmod                                         #maximum UTP(V)\n",
      "UTP_min=(2*VCC/3)-Vmod                                         #minimum UTP(V)\n",
      "Wmin=-(R1+R2)*C*(math.log((VCC-UTP_min)/(VCC-(0.5*UTP_min))))  #minimum pulse width(s)\n",
      "Wmax=-(R1+R2)*C*(math.log((VCC-UTP_max)/(VCC-(0.5*UTP_max))))  #minimum pulse width(s)\n",
      "Tmin=Wmin+(0.693*R2*C)                                         #minimum period(s)\n",
      "Tmax=Wmax+(0.693*R2*C)                                         #maximum period(s)\n",
      "s=0.693*R2*C                                                   #space(s)\n",
      "\n",
      "print 'period of output pulse T = ',T*10**6,'us'\n",
      "print 'Quiscent pulse width W = ',W*10**6,'us'\n",
      "print 'minimum UTP = ',UTP_min,'V'\n",
      "print 'maximum UTP = ',UTP_max,'V'\n",
      "print 'minimum pulse width W(min) = ',round((Wmin*10**6),2),'us'\n",
      "print 'maximum pulse width W(max) = ',round((Wmax*10**6),2),'us'\n",
      "print 'minimum period T(min) = ',round((Tmin*10**6),2),'us'\n",
      "print 'maximum period T(max) = ',round((Tmax*10**6),2),'us'\n",
      "print 'space = ',round((s*10**6),2),'us'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "period of output pulse T =  68.607 us\n",
        "Quiscent pulse width W =  47.817 us\n",
        "minimum UTP =  6.5 V\n",
        "maximum UTP =  9.5 V\n",
        "minimum pulse width W(min) =  32.04 us\n",
        "maximum pulse width W(max) =  73.47 us\n",
        "minimum period T(min) =  52.83 us\n",
        "maximum period T(max) =  94.26 us\n",
        "space =  20.79 us\n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 23-12, Page 929"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "VCC=15.0                                 #given supply voltage(V)\n",
      "C=100*10**-9                             #given capacitance(F)\n",
      "Ic=1*10**-3                              #collector current (A)\n",
      "\n",
      "S=Ic/C                               #slope(V/s)             \n",
      "V=2*VCC/3                            #peak value(V)\n",
      "T=V/S                                #duration of ramp(s)     \n",
      "\n",
      "print 'slope is ',S/1000,'V/ms'\n",
      "print 'Peak value V = ',V,'V'\n",
      "print 'duration of ramp = ',T*10**3,'ms'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "slope is  10.0 V/ms\n",
        "Peak value V =  10.0 V\n",
        "duration of ramp =  1.0 ms\n"
       ]
      }
     ],
     "prompt_number": 35
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 23-13, Page 938"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "R=10*10**3                                #given resistance(Ohm)\n",
      "C=0.01*10**-6                             #given capacitance(F)\n",
      "\n",
      "f0=(R*C)**-1                              #output frequency(Hz)\n",
      "\n",
      "print 'output frequency f0 = ',f0/1000,'KHz' "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "output frequency f0 =  10.0 KHz\n"
       ]
      }
     ],
     "prompt_number": 37
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 23-14, Page 938"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "R1=1.0*10**3                                #given resistance(Ohm)\n",
      "R2=2.0*10**3                                #given resistance(Ohm)\n",
      "C=0.1*10**-6                                #given capacitance(F)\n",
      "\n",
      "f=(2/C)*((R1+R2)**-1)                     #output frequency(Hz)\n",
      "D=R1/(R1+R2)                              #duty cycle\n",
      "\n",
      "print 'output frequency f = ',round((f/1000),2),'KHz' \n",
      "print 'duty cycle = ',round((D*100),2),'%'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "output frequency f =  6.67 KHz\n",
        "duty cycle =  33.33 %\n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": []
    }
   ],
   "metadata": {}
  }
 ]
}