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
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
|
{
"cells": [
{
"cell_type": "markdown",
"metadata": {
"collapsed": true
},
"source": [
"# Chapter 9: Specialixed IC Applications"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": true
},
"source": [
"## Example 9.1"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Resistance R2 is 31.6 kilo ohm\n",
"Resistance R3 is 3.27 kilo ohm\n",
"Resistance R1 is Open\n",
"Resistance R4 is 25.15 kilo ohm\n",
"Resistance R5 is 25.15 kilo ohm\n",
"Resistance R6 is 1.8 kilo ohm\n",
"Resistance R7 is 9.0 kilo ohm\n",
"Resistance R8 is 1.5 kilo ohm\n"
]
}
],
"source": [
"#Example 9.1\n",
"#The FLT-U2 is to be used as a second order inverting Butterworth low pass filter\n",
"#with a dc gain of 5,cutoff frequency of 2 kHz and Q=10. Determine the values\n",
"#of the external components.\n",
"\n",
"from __future__ import division #to perform decimal division\n",
"import math\n",
"\n",
"\n",
"#Variable declaration\n",
"dc_gain=5\n",
"f1=2*10**3 # Cutoff freq in Hz\n",
"Q=10 # Figure of merit\n",
"\n",
"\n",
"#calculation\n",
"R2=(316*10**3)/10 #Resistance R2\n",
"R3=(100*10**3)/((3.16*Q)-1)\n",
"R4=(5.03*10**7)/f1\n",
"R5=R4\n",
"R6=1.8*10**3 # Assumption\n",
"R7=dc_gain*R6\n",
"R8=(R6*R7)/(R6+R7)\n",
"\n",
"\n",
"#result\n",
"print \"Resistance R2 is\",round(R2/10**3,2),\"kilo ohm\"\n",
"print \"Resistance R3 is\",round(R3/10**3,2),\"kilo ohm\"\n",
"print \"Resistance R1 is Open\"\n",
"print \"Resistance R4 is\",round(R4/10**3,2),\"kilo ohm\"\n",
"print \"Resistance R5 is\",round(R5/10**3,2),\"kilo ohm\"\n",
"print \"Resistance R6 is\",round(R6/10**3,2),\"kilo ohm\"\n",
"print \"Resistance R7 is\",round(R7/10**3,2),\"kilo ohm\"\n",
"print \"Resistance R8 is\",round(R8/10**3,2),\"kilo ohm\"\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": true
},
"source": [
"## Example 9.2"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Resistance R2 is 100.0 kilo ohm\n",
"Resistance R3 is 2.96 kilo ohm\n",
"Resistance R1 is Open ohm\n",
"Resistance R4 is 10.0 kilo ohm\n",
"Resistance R5 is 10.0 kilo ohm\n"
]
}
],
"source": [
"\n",
"#Example 9.2\n",
"#Using the FLT-U2, design a second order inverting Butterworth bandpass filter\n",
"#with centre frequency f1=5 kHz and Q=10.\n",
"\n",
"from __future__ import division #to perform decimal division\n",
"import math\n",
"\n",
"\n",
"#Variable declaration\n",
"f1=5*10**3 # Center freq in Hz\n",
"Q=10 # Figure of merit\n",
"R2=100*10**3 # Constant for band-pass filter\n",
"\n",
"\n",
"#calculation\n",
"R3=(100*10**3)/((3.48*Q)-1)\n",
"R4=(5.03*10**7)/f1\n",
"R5=R4\n",
"\n",
"\n",
"\n",
"#result\n",
"print \"Resistance R2 is\",round(R2/10**3,2),\"kilo ohm\"\n",
"print \"Resistance R3 is\",round(R3/10**3,2),\"kilo ohm\"\n",
"print \"Resistance R1 is Open\",\"ohm\"\n",
"print \"Resistance R4 is\",round(R4/10**3),\"kilo ohm\"\n",
"print \"Resistance R5 is\",round(R5/10**3),\"kilo ohm\"\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": true
},
"source": [
"## Example 9.3"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Resistance R2 is 100.0 kilo ohm\n",
"Resistance R3 is 2.96 kilo ohm\n",
"Resistance R1 is Open ohm\n",
"Resistance R4 is 10.06 kilo ohm\n",
"Resistance R5 is 10.06 kilo ohm\n",
"Resistance R6 is 10.0 kilo ohm\n",
"Resistance R7 is 10.0 kilo ohm\n",
"Resistance R8 is 10.0 kilo ohm\n",
"Resistance R9 is 3.33 kilo ohm\n"
]
}
],
"source": [
"\n",
"#Example 9.3\n",
"#Using the FLT-U2, design a notch filter with 5 kHz notch out frequency and\n",
"#Q=10.\n",
"\n",
"from __future__ import division #to perform decimal division\n",
"import math\n",
"\n",
"\n",
"#Variable declaration\n",
"f1=5*10**3 # Center freq in Hz\n",
"Q=10 # Figure of merit\n",
"R2=100*10**3 # Constant for band-pass filter\n",
"\n",
"\n",
"#calculation\n",
"R3=(100*10**3)/((3.48*Q)-1)\n",
"R4=(5.03*10**7)/f1\n",
"R5=R4\n",
"R6=10*10**3 #Assumption\n",
"R7=R6\n",
"R8=R6\n",
"R9=(R6*R7*R8)/(R6*R7+R6*R8+R7*R8) #Since R6||R7||R8\n",
"\n",
"\n",
"\n",
"#result\n",
"print \"Resistance R2 is\",round(R2/10**3,2),\"kilo ohm\"\n",
"print \"Resistance R3 is\",round(R3/10**3,2),\"kilo ohm\"\n",
"print \"Resistance R1 is Open\",\"ohm\"\n",
"print \"Resistance R4 is\",round(R4/10**3,2),\"kilo ohm\"\n",
"print \"Resistance R5 is\",round(R5/10**3,2),\"kilo ohm\"\n",
"print \"Resistance R6 is\",round(R6/10**3),\"kilo ohm\"\n",
"print \"Resistance R7 is\",round(R7/10**3),\"kilo ohm\"\n",
"print \"Resistance R8 is\",round(R8/10**3),\"kilo ohm\"\n",
"print \"Resistance R9 is\",round(R9/10**3,2),\"kilo ohm\"\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": true
},
"source": [
"## Example 9.4"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Resistance R2 is 20.0 kilo ohm\n",
"Resistance R3 is 14.14 kilo ohm\n"
]
}
],
"source": [
"\n",
"#Example 9.4\n",
"#Using the MF5,design a second order Butterworth lowpass filter with a cutoff\n",
"#frequency of 500Hz and a passband gain of -2. Assume that a 5,-5 V power supply\n",
"#and a CMOS clock are used.\n",
"from __future__ import division #to perform decimal division\n",
"import math\n",
"\n",
"\n",
"#Variable declaration\n",
"f1=500 #Cut-off freq in Hz\n",
"Holp=-2 #Passband gain\n",
"R1=10*10**3 #Assumption\n",
"Q=0.707 #Figure of merit Q is fixed for second order butterworth LPF\n",
"#calculation\n",
"\n",
"R2=-R1*Holp #Using Holp=-R2/R1;\n",
"R3=Q*R2 #Using Q=R3/R2\n",
"\n",
"#result\n",
"print \"Resistance R2 is\",round(R2/10**3),\"kilo ohm\"\n",
"print \"Resistance R3 is\",round(R3/10**3,2),\"kilo ohm\"\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": true
},
"source": [
"## Example 9.5"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Capacitance C is 1.0 micro Farad\n"
]
}
],
"source": [
"\n",
"#Example 9.5\n",
"#In the circuit of figure 9-16(a), Ra=10 Kilo ohm, the output pulse width\n",
"#tp=10 ms. Determine the value of C.\n",
"\n",
"from __future__ import division #to perform decimal division\n",
"import math\n",
"\n",
"\n",
"#Variable declaration\n",
"Ra=10*10**3 #Resistance in ohm\n",
"tp=10*10**-3 #Output pulse width\n",
"C=tp/(1.1*Ra)\n",
"\n",
"#calculation\n",
"C=tp/(1.1*Ra)\n",
"\n",
"#result\n",
"print \"Capacitance C is\",round(C*10**6),\"micro Farad\"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 9.6"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Resistance Ra is 54.55 kilo ohm\n"
]
}
],
"source": [
"\n",
"#Example 9.6\n",
"#The circuit of figure 9-16 (a) is to be used as a divide-by-2 network.\n",
"#The frequency of the input trigger signal is 2 kHz.If the value of C=0.01 uF\n",
"#What should be the value of Ra.\n",
"\n",
"from __future__ import division #to perform decimal division\n",
"import math\n",
"\n",
"\n",
"#Variable declaration\n",
"f=2*10**3 #Freq of input trigger signal in Hz\n",
"C=0.01*10**-6\n",
"\n",
"#calculation\n",
"tp=1.2/f\n",
"Ra=tp/(1.1*C)\n",
"\n",
"#result\n",
"print \"Resistance Ra is\",round(Ra/10**3,2),\"kilo ohm\"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 9.7"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Charging time of the capacitor is 0.42 ms\n",
"Discharging time of the capacitor is 0.27 ms\n",
"Freq of oscillation is 1.4 kHz\n"
]
}
],
"source": [
"\n",
"#Example 9.7\n",
"#In the astable multivibrator of figure 9-21(a), Ra=2.2 kilo ohm, Rb=3.9 kilo ohm\n",
"#and C=0.1 uF. Determine the pulse width tc, negative pulse width td and free\n",
"#running frequency fo.\n",
"\n",
"from __future__ import division #to perform decimal division\n",
"import math\n",
"\n",
"\n",
"#Variable declaration\n",
"Ra=2.2*10**3 # Resistance in ohm\n",
"Rb=3.9*10**3 # Resistance in ohm\n",
"C=0.1*10**-6 # capacitance in farad\n",
"\n",
"#calculation\n",
"tc=0.69*(Ra+Rb)*C # Charging time of the capacitor\n",
"td=0.69*Rb*C # Discharging time of the capacitor\n",
"T=tc+td\n",
"fo=1/T # Freq of oscillation\n",
"\n",
"\n",
"#result\n",
"print \"Charging time of the capacitor is\",round(tc*10**3,2),\"ms\"\n",
"print \"Discharging time of the capacitor is\",round(td*10**3,2),\"ms\"\n",
"print \"Freq of oscillation is\",round(fo/10**3,1),\"kHz\"\n"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": true
},
"source": [
"## Example 9.8"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Freq of free running ramp generator is 5.16 kHz\n"
]
}
],
"source": [
"\n",
"#Example 9.8\n",
"#Referring to the circuit of figure 9-24(a),determine the frequency of the free-\n",
"#running ramp generator if R is set at 10 kHz.\n",
"#Assume that Vbe=Vd1=0.7 V.\n",
"\n",
"from __future__ import division #to perform decimal division\n",
"import math\n",
"\n",
"\n",
"#Variable declaration\n",
"R=10*10**3 #Resistance in ohm\n",
"Vcc=5 #Supply voltage in volt\n",
"Vbe=0.7 #Base to emitter voltage in volt\n",
"C=0.05*10**-6 #Capacitance in farad\n",
"\n",
"#calculation\n",
"Ic=(Vcc-Vbe)/R #Collector current in ampere\n",
"fo=(3*Ic)/(Vcc*C)\n",
"\n",
"#result\n",
"print \"Freq of free running ramp generator is\",round(fo/10**3,2),\"kHz\"\n"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": true
},
"source": [
"## Example 9.9"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Free running frequency of VCO is 2.5 kHz\n",
"Lock range frequency of VCO is 1.0 kHz\n",
"Capture range frequency of VCO is 66.49 Hz\n"
]
}
],
"source": [
"\n",
"#Example 9.9\n",
"#Referring to the circuit of figure 9-33(a),determine the free-running frequency\n",
"#fout, the lock range fl and the capture range fc.\n",
"\n",
"from __future__ import division #to perform decimal division\n",
"import math\n",
"\n",
"\n",
"#Variable declaration\n",
"R1=12*10**3 # Resistance in ohm\n",
"V_plus=10 # Supply voltage in volt\n",
"V_minus=-10 # Supply voltage in volt\n",
"C1=0.01*10**-6 # Capacitance in farad\n",
"C2=10*10**-6 # Capacitance in farad\n",
"\n",
"#calculation\n",
"fout=1.2/(4*R1*C1)\n",
"V=V_plus-V_minus\n",
"fl=(8*fout)/V\n",
"fc=math.sqrt(fl/(2*math.pi*3.6*10**3*C2))\n",
"\n",
"#result\n",
"print \"Free running frequency of VCO is\",round(fout/10**3,1),\"kHz\"\n",
"print \"Lock range frequency of VCO is\",round(fl/10**3),\"kHz\"\n",
"print \"Capture range frequency of VCO is\",round(fc,2),\"Hz\"\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": true
},
"source": [
"## Example 9.10"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Resistance R is 20.0 ohm\n",
"Output voltage Vo is 17.0 Volt\n",
"Min input voltage Vin is 19.0 Volt\n"
]
}
],
"source": [
"\n",
"#Example 9.10\n",
"#Using the 7805C voltage regulator , design a current source that will deliver\n",
"#a 0.25 A current to a 48 ohm, 10 W load.\n",
"\n",
"from __future__ import division #to perform decimal division\n",
"import math\n",
"\n",
"\n",
"#Variable declaration\n",
"Vr=5 #Voltage in volt\n",
"Il=0.25 #Load current in ampere\n",
"Rl=48 #Load resistance in ohm\n",
"dropout_volt=2 #Constant for IC7805C\n",
"\n",
"#calculation\n",
"R=Vr/Il #Approximate result sice Iq is negligible in the eq. Il=(Vr/Il)+Iq where Iq is quiescent current\n",
"Vl=Rl*Il\n",
"Vo=Vr+Vl\n",
"Vin=Vo+dropout_volt\n",
"\n",
"#result\n",
"print \"Resistance R is\",R,\"ohm\"\n",
"print \"Output voltage Vo is\",Vo,\"Volt\"\n",
"print \"Min input voltage Vin is\",Vin,\"Volt\"\n"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": true
},
"source": [
"## Example 9.11"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Resistance R2_min is 0.71 kilo ohm\n",
"Resistance R2_max is 2.03 kilo ohm\n",
"Therefore resistance should be varied from R2_min to R2_max values\n",
"To do this we take R2 as 3kohm potentiometer\n"
]
}
],
"source": [
"\n",
"#Example 9.11\n",
"#Design an adjustable voltage regulator to satisfy the following specifications\n",
"#Output voltage Vo= 5 to 12 V\n",
"#Output current Io= 1 A.\n",
"#Voltage regulator is LM317.\n",
"\n",
"\n",
"from __future__ import division #to perform decimal division\n",
"import math\n",
"\n",
"\n",
"#Variable declaration\n",
"Vo_min=5 #Min output voltage in volt\n",
"Vo_max=12 #Max output voltage in volt\n",
"Vref=1.25 #Reference voltage in volt\n",
"Iadj=100*10**-6 #Adjustment pin current in ampere\n",
"R1=240 #Assumption\n",
"C2=1*10**-6 #Added to the circuit to improve transient response\n",
"C3=1*10**-6 #Added to the circuit to obtain high ripple rejection ratios\n",
"\n",
"#calculation\n",
"R2_min=R1*(Vo_min-Vref)/(Vref+Iadj*R1) #Using Vo_min=Vref*(1+R2/R1)+Iadj*R2\n",
"R2_max=R1*(Vo_max-Vref)/(Vref+Iadj*R1) #Using Vo_max=Vref*(1+R2/R1)+Iadj*R2\n",
"\n",
"#result\n",
"print \"Resistance R2_min is\",round(R2_min/10**3,2),\"kilo ohm\"\n",
"print \"Resistance R2_max is\",round(R2_max/10**3,2),\"kilo ohm\"\n",
"print \"Therefore resistance should be varied from R2_min to R2_max values\"\n",
"print \"To do this we take R2 as 3kohm potentiometer\"\n"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": true
},
"source": [
"## Example 9.12"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Sense current,Ipk is 1.0 A\n",
"Sense resistance,Rsc is 0.33 ohm\n",
"Constant K is 1.06\n",
"i.e, ton is K times of toff\n",
"OFF time period,toff is 24.27 us\n",
"ON time period,ton is 25.73 us\n",
"Inductance,L is 151.7 uH\n",
"Output capacitance,Co is 125.0 uF\n",
"Resistance R2 is 12.0 kilo ohm\n",
"Resistance R1 is 38.0 kilo ohm\n",
"efficiency is 81.0\n"
]
}
],
"source": [
"\n",
"#Example 9.12\n",
"#Design a step down switching regulator according to the following\n",
"#specifications.\n",
"#Input voltage Vin= 12 V dc.\n",
"#Output voltage Vo= 5V at 500 m A maximum.\n",
"#Output ripple voltage Vripple= 50 mV or 1% of Vo\n",
"#Switching regulator :uA78S40.\n",
"\n",
"from __future__ import division #to perform decimal division\n",
"import math\n",
"\n",
"\n",
"#Variable declaration\n",
"Iomax=500*10**-3 # Max output current in ampere\n",
"Vo=5 # Output voltage in volt\n",
"Vd=1.25 # Voltage drop across the power diode in volt\n",
"Vin=12 # Input voltage in volt\n",
"Vs=1.1 # Output saturation voltage in volt\n",
"Vripple=50*10**-3 # Output ripple voltage in volt\n",
"Vref=1.245 # Reference voltage in volt\n",
"Vr2=1.2 # Voltage across resistance R2 in volt\n",
"\n",
"#calculation\n",
"Ipk=2*Iomax # Sense current in ampere\n",
"Rsc=0.33/Ipk # Sense resistance in ohm\n",
"K=(Vo+Vd)/(Vin-Vs-Vo) # K= ton/toff\n",
"f=20*10**3 # Assuming operating freq in Hz\n",
"T=1/f\n",
"toff=T/2.06 # Using ton+toff=T and substituting for ton\n",
"ton=1.06*toff\n",
"Ct=45*10**-5*toff # Oscillator timing capacitance in farad\n",
"L=((Vo+Vd)/Ipk)*toff # Inductance in henry\n",
"Co=Ipk*((ton+toff)/(8*Vripple)) # Output capacitance in farad\n",
"I2=0.1*10**-3 # Assuming the current through R2\n",
"R2=Vref/I2 # Resistance R2 in ohm\n",
"R2=12*10**3 # Taking approximate value\n",
"R1=(R2*(Vo-Vr2))/Vr2 # Using Vr2=(R1*Vo)/R1+R2, voltage divider rule\n",
"efficiency=((Vin-Vs+Vd)/Vin)*(Vo/(Vo+Vd))*100\n",
"\n",
"#result\n",
"print \"Sense current,Ipk is\",Ipk,\"A\"\n",
"print \"Sense resistance,Rsc is\",Rsc,\"ohm\"\n",
"print \"Constant K is\",round(K,2)\n",
"print \"i.e, ton is K times of toff\"\n",
"print \"OFF time period,toff is\",round(toff*10**6,2),\"us\"\n",
"print \"ON time period,ton is\",round(ton*10**6,2),\"us\"\n",
"print \"Inductance,L is\",round(L*10**6,2),\"uH\"\n",
"print \"Output capacitance,Co is\",round(Co*10**6,3),\"uF\"\n",
"print \"Resistance R2 is\",R2/10**3,\"kilo ohm\"\n",
"print \"Resistance R1 is\",R1/10**3,\"kilo ohm\"\n",
"print \"efficiency is\",efficiency\n"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": true
},
"source": [
"## Example 9.13"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Sense current,Ipk is 6 A\n",
"Sense resistance,Rsc is 0.055 ohm\n",
"Constant K 1.06\n",
"i.e, ton is K times of toff\n",
"OFF time period,toff is 24.27 us\n",
"ON time period,ton is 25.73 us\n",
"Oscillator timing capacitance,Ct is 10.9 nF\n",
"Inductance,L is = %.8f H 25.28 uH\n",
"Output capacitance,Co is = %.7f F 0.75 milli Farad\n"
]
}
],
"source": [
"#Example 9.13\n",
"#Upgrade the switching regulator in Example 9-12 to provide +5V at 3A.\n",
"#Use the same specifications given in example 9-12,except the output ratings.\n",
"\n",
"from __future__ import division #to perform decimal division\n",
"import math\n",
"\n",
"\n",
"#Variable declaration\n",
"Iomax=3 #Max output current in ampere\n",
"Vo=5 #Output voltage in volt\n",
"Vd=1.25 #Voltage drop across the power diode in volt\n",
"Vin=12 #Input voltage in volt\n",
"Vs=1.1 #Output saturation voltage in volt\n",
"Vripple=50*10**-3 #Output ripple voltage in volt\n",
"Vref=1.245 #Reference voltage in volt\n",
"Vr2=1.2 #Voltage across resistance R2 in volt\n",
"\n",
"#calculation\n",
"Ipk=2*Iomax #Sense current in ampere\n",
"Rsc=0.33/Ipk #Sense resistance in ohm\n",
"K=(Vo+Vd)/(Vin-Vs-Vo) #K= ton/toff\n",
"f=20*10**3 #Assuming operating freq in Hz\n",
"T=1/f\n",
"toff=T/2.06 #Using ton+toff=T and substituting for ton\n",
"ton=1.06*toff\n",
"Ct=45*10**-5*toff #Oscillator timing capacitance in farad\n",
"L=((Vo+Vd)/Ipk)*toff #Inductance in henry\n",
"Co=Ipk*((ton+toff)/(8*Vripple)) #Output capacitance in farad\n",
"\n",
"#result\n",
"print \"Sense current,Ipk is\",Ipk,\"A\"\n",
"print \"Sense resistance,Rsc is\",Rsc,\"ohm\"\n",
"print \"Constant K\",round(K,2)\n",
"print \"i.e, ton is K times of toff\"\n",
"print \"OFF time period,toff is\",round(toff*10**6,2),\"us\"\n",
"print \"ON time period,ton is\",round(ton*10**6,2),\"us\"\n",
"print \"Oscillator timing capacitance,Ct is\",round(Ct*10**9,1),\"nF\"\n",
"print \"Inductance,L is = %.8f H\",round(L*10**6,2),\"uH\"\n",
"print \"Output capacitance,Co is = %.7f F\",round(Co*10**3,5),\"milli Farad\"\n"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
|