summaryrefslogtreecommitdiff
path: root/Working_Examples/3885/CH6/EX6.2/Ex6_2.sce
diff options
context:
space:
mode:
authorSiddharth Agarwal2019-09-03 18:27:40 +0530
committerSiddharth Agarwal2019-09-03 18:27:40 +0530
commit8ac15bc5efafa2afc053c293152605b0e6ae60ff (patch)
treee1bc17aae137922b1ee990f17aae4a6cb15b7d87 /Working_Examples/3885/CH6/EX6.2/Ex6_2.sce
parent52a477ec613900885e29c4a0b02806a415b4f83a (diff)
downloadXcos_block_examples-master.tar.gz
Xcos_block_examples-master.tar.bz2
Xcos_block_examples-master.zip
Xcos examples from textbooks and for blocksHEADmaster
Diffstat (limited to 'Working_Examples/3885/CH6/EX6.2/Ex6_2.sce')
-rwxr-xr-xWorking_Examples/3885/CH6/EX6.2/Ex6_2.sce45
1 files changed, 45 insertions, 0 deletions
diff --git a/Working_Examples/3885/CH6/EX6.2/Ex6_2.sce b/Working_Examples/3885/CH6/EX6.2/Ex6_2.sce
new file mode 100755
index 0000000..a413259
--- /dev/null
+++ b/Working_Examples/3885/CH6/EX6.2/Ex6_2.sce
@@ -0,0 +1,45 @@
+//control systems by Nagoor Kani A
+//Edition 3
+//Year of publication 2015
+//Scilab version 6.0.0
+//operating systems windows 10
+// Example 6.2
+
+clc;
+clear;
+s=poly(0,'s')
+//calculation of gain K
+kv=30//velocity error constant is 30sec^-1
+// open loop transfer function G(s)=K/s*(s+4)*(s+80)
+//by definition of velocity error constant applying limit s=0 in G(s)
+disp('the value of K is 9600;')
+h=syslin('c',9600/(s*(s+4)*(s+80)))
+bode(h)
+show_margins(h)
+xtitle("uncompensated system")
+//from the plot the phase margin of uncompensated system is 12
+//but the system requires phase margin of 33 so lag compensation required
+pm=38//choose PM of compensated system is 38 degree
+phigcn=38-180// phase of G(s) at new gain cross over frequency
+wgcn=4.7//the frequency corrosponding to phase of -142 is 4.7 rad/sec
+agcn=16//db magnitude at wgcn
+//20log betaa=16
+betaa=10^(agcn/20)
+disp(betaa,'the value for betaa is')
+zc=wgcn/10//zero of lag compensator
+t=10/wgcn
+disp(t,'the value for t is')
+pc=1/(betaa*t)
+disp(pc,'pole of lag compensator is')
+//transfer function of lag compensation is (s+1/t)/(s+1/betaa*t))
+hc=syslin('c', (6.3*(1+2.13*s))/(1+13.419*s))
+disp(hc,'the transfer function of lag compensator is;')
+//open loop transfer function of compensated system is h*hc
+hcmp=syslin('c',h*hc)
+disp(hcmp,'open loop transfer function of compensated system is')
+figure()
+bode(hcmp)
+show_margins(hcmp)
+xtitle("compensated system")
+
+