diff options
Diffstat (limited to 'Electronic_Devices_by_T_L_Floyd/16-Oscillators.ipynb')
-rw-r--r-- | Electronic_Devices_by_T_L_Floyd/16-Oscillators.ipynb | 222 |
1 files changed, 222 insertions, 0 deletions
diff --git a/Electronic_Devices_by_T_L_Floyd/16-Oscillators.ipynb b/Electronic_Devices_by_T_L_Floyd/16-Oscillators.ipynb new file mode 100644 index 0000000..38fb85a --- /dev/null +++ b/Electronic_Devices_by_T_L_Floyd/16-Oscillators.ipynb @@ -0,0 +1,222 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 16: Oscillators" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 16.1: Wien_bridge_oscillator.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//ex16.1\n", +"R1=10*10^3;\n", +"R2=R1;\n", +"R=R1;\n", +"C1=0.01*10^-6;\n", +"C2=C1;\n", +"C=C1;\n", +"R3=1*10^3;\n", +"r_ds=500;\n", +"f_r=1/(2*%pi*R*C);\n", +"disp(f_r,'resonant frequency of the Wein-bridge oscillator in Hertz')\n", +"//closed loop gain A_v=3 to sustain oscillations\n", +"A_v=3;\n", +"//A_v=(R_f+R_i)+1 where R_i is composed of R3 and r_ds\n", +"R_f=(A_v-1)*(R3+r_ds);\n", +"disp(R_f,'value of R_f in ohms')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 16.2: Phase_shift_oscillator.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//ex16.2\n", +"A_cl=29; //A_cl=R_f/R_i;\n", +"R3=10*10^3;\n", +"R_f=A_cl*R3;\n", +"disp(R_f,'value of R_f in ohms')\n", +"//let R1=R2=R3=R and C1=C2=C3=C\n", +"R=R3;\n", +"C3=0.001*10^-6;\n", +"C=C3;\n", +"f_r=1/(2*%pi*sqrt(6)*R*C);\n", +"disp(f_r,'frequency of oscillation in Hertz')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 16.3: FET_Colpitts_oscillator.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//ex16.3\n", +"C1=0.1*10^-6;\n", +"C2=0.01*10^-6;\n", +"L=50*10^-3; //in Henry\n", +"C_T=C1*C2/(C1+C2); //total capacitance\n", +"f_r=1/(2*%pi*sqrt((L*C_T)));\n", +"disp(f_r,'frequency of oscillation in Hertz when Q>10')\n", +"Q=8; //when Q drops to 8\n", +"f_r=(1/(2*%pi*sqrt((L*C_T))))*sqrt((Q^2/(1+Q^2)));\n", +"disp(f_r,'frequency of oscillation in hertz when Q=8')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 16.4: Triangular_wave_oscillator.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//ex16.4\n", +"R1=10*10^3;\n", +"R2=33*10^3;\n", +"R3=10*10^3;\n", +"C=0.01*10^-6;\n", +"f_r=(1/(4*R1*C))*(R2/R3);\n", +"disp(f_r,'frequency of oscillation in hertz')\n", +"//the value of R1 when frequency of oscillation is 20 kHz\n", +"f=20*10^3;\n", +"R1=(1/(4*f*C))*(R2/R3);\n", +"disp(R1,'value of R1 in ohms to make frequency 20 kiloHertz')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 16.5: Sawtooth_VCO.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//ex16.5\n", +"V=15;\n", +"C=0.0047*10^-6;\n", +"R3=10*10^3;\n", +"R4=R3;\n", +"R2=10*10^3;\n", +"R1=68*10^3;\n", +"R_i=100*10^3;\n", +"V_G=R4*V/(R3+R4); //gate voltage at which PUT turns on\n", +"V_p=V_G; //neglecting 0.7V, this the peak voltage of sawtooth wave\n", +"disp(V_p,'neglecting 0.7V, this the peak voltage of sawtooth wave in volts')\n", +"V_F=1; //minimum peak value of sawtooth wave\n", +"V_pp=V_p-V_F;\n", +"disp(V_pp,'peak to peak amplitude of the sawtooth wave in volts')\n", +"V_IN=-V*R2/(R1+R2);\n", +"f=(abs(V_IN)/(R_i*C))*(1/(V_pp));\n", +"disp(f,'frequency of the sawtooth wave')\n", +"T=1/f;\n", +"xtitle('Sawtooth voltage controlled oscillator')\n", +"x=[];\n", +"for t=0:1*10^-5:4*10^-3 \n", +" tcor = t- floor(t/T)*T;\n", +" x_temp = (V_pp/T)*tcor + 1;\n", +" x = [x, x_temp];\n", +" end;\n", +" t=0:1*10^-5:4*10^-3\n", +" plot(t,x)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 16.6: 555_timer.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//ex16.6\n", +"R1=2.2*10^3;\n", +"R2=4.7*10^3;\n", +"C_ext=0.022*10^-6;\n", +"f_r=1.44/((R1+2*R2)*C_ext);\n", +"disp(f_r,'frequency of the 555 timer in hertz')\n", +"duty_cycle=((R1+R2)/(R1+2*R2))*100;\n", +"disp(duty_cycle,'duty cycle in percentage')" + ] + } +], +"metadata": { + "kernelspec": { + "display_name": "Scilab", + "language": "scilab", + "name": "scilab" + }, + "language_info": { + "file_extension": ".sce", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "scilab", + "version": "0.7.1" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} |