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
|
{
"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
}
|