{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Chapter 9: Phase Locked Loop Analysis" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 9.1: PLLA_Ex_9_1.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "//chapter 9: Stability Analysis\n", "//Example 9.1 page no 357\n", "//given\n", "Kv=50//DC gain\n", "wL=100//corner frequency\n", "disp('The system crossover frequecny is approximately 50 rad/s')\n", "PhaseMargin=90-(atan(50/wL)*180/%pi)//phase margin of system\n", "disp('At this frequency the phase shift of the open loop transfer function is -112.5')\n", "disp(PhaseMargin,'The phase margin is ')" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 9.2: PLLA_Ex_9_2.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "//chapter 9: Stability Analysis\n", "//Example 9.2 page no 357\n", "//given\n", "Kv=50//DC gain\n", "wL=10//corner frequency\n", "disp('The system crossover frequecny is approximately 22 rad/s')\n", "PhaseMargin=90-(atan(22/wL)*180/%pi)//phase margin of system\n", "disp(PhaseMargin,'The phase margin is ')\n", "" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 9.3: PLLA_Ex_9_3.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "close\n", "//chapter 9: Stability Analysis\n", "//Example 9.3 page no 361\n", "//given\n", "clear\n", "wL=258\n", "s=poly(0,'s')\n", "h=syslin('c',(100/(s*(s/wL+1)^2 )))\n", "clf();bode(h,1,1000);\n", "disp('The open loop gain and the phase plots are given .It is seen that the crossover frequency is 15Hz,and the phase margin is 50degree')\n", "disp('We know that the overshoot can be increased by decreasing the phase margin.In fact,in this case selecting wL=233 rad/s corresponding to phase margin of 43.5degree gives an overshoot of 20persent')" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 9.4: PLLA_Ex_9_4.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "close\n", "//chapter 9: Stability Analysis\n", "//Example 9.4 page no 363\n", "//given\n", "clear\n", "N=2\n", "Kv=0.83*10^3//DC gain\n", "B=1250//closed loop bandwidth\n", "wn=1.27*10^3\n", "wL=wn^2/Kv//corner frequency\n", "s=poly(0,'s')\n", "h=syslin('c',(1/((s^2/wn^2)+0.9*s/wn+1)))\n", "clf();bode(h,1,1000);" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 9.5: PLLA_Ex_9_5.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "close\n", "//chapter 9: Stability Analysis\n", "//Example 9.5 page no 368\n", "//given\n", "clear\n", "Ka=(2.2e3)^2\n", "wz=(2*%pi)/(2.2/sqrt((2.2e3)^2))\n", "s=poly(0,'s')\n", "h=syslin('c',(1000*(s/(wz+1))/(s^2/Ka +(s/wz) +1)))\n", "clf();bode(h,1,1000);" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 9.6: PLLA_Ex_9_6.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "//Chapter 9:Stability Analysis\n", "//example 8.6 page no 373\n", "//given\n", "zeta=0.8//damping ratio\n", "B=10^3//closed loop bandwidth\n", "X=sqrt(1+2*zeta^2+sqrt(2+4*zeta^2+4*zeta^4))\n", "Ka=(B/X)^2//loop gain\n", "wn=sqrt(Ka)//\n", "wz=wn/(2*zeta)//the system zero\n", "mprintf('the closed loop gain is %3.2e (rad/s)^2 \n wn = %f rad/s \n the system has zero at %d rad/s',Ka,wn,wz)\n", "\n", "\n", "\n", "\n", "\n", "" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 9.7: PLLA_Ex_9_7.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "//Chapter 9:Phase locked loop Analysis \n", "//Example 9.7 page no 376\n", "a=28//taking alpha as a\n", "Ka=0.21*10^6\n", "GF=20*log10(a)^1/2\n", "disp(GF,'The value of gain is ')\n", "disp('so we must determine where the uncompensated frequency response is -14.5dB ')\n", "Wc=a^(1/4)*Ka^(1/2)\n", "disp('The 28:1 lead ratio will increase the crossover frequency by a factor 2.3 The factor zero is placed at ')\n", "Wz=Wc/sqrt(a)//systems zero\n", "Wp=a*Wz//systems pole\n", "mprintf('The crossover frequency is %3.2e rad/s \n The zero is placed at %d rad/s \n The pole is placed at %d rad/s ',Wc,Wz,Wp)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 9.9: PLLA_Ex_9_9.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "//Chapter 9:Phase locked loop Analysis \n", "//Example 9.9 page no 380\n", "disp('since the phase margin without time delay is 50 degree, a 10 degree phase lag can be introduced by the time delay at the crossover frequecy.That is ,')\n", "Wc=1000//crossover frequency\n", "thetaT=-0.174\n", "T=thetaT/Wc//time delay\n", "mprintf('The time delay is %3.2e ',T)" ] } ], "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 }