summaryrefslogtreecommitdiff
path: root/1499/CH6/EX6.2
diff options
context:
space:
mode:
Diffstat (limited to '1499/CH6/EX6.2')
-rw-r--r--1499/CH6/EX6.2/s2.pngbin0 -> 25034 bytes
-rw-r--r--1499/CH6/EX6.2/s2.sce49
2 files changed, 49 insertions, 0 deletions
diff --git a/1499/CH6/EX6.2/s2.png b/1499/CH6/EX6.2/s2.png
new file mode 100644
index 000000000..b7664243f
--- /dev/null
+++ b/1499/CH6/EX6.2/s2.png
Binary files differ
diff --git a/1499/CH6/EX6.2/s2.sce b/1499/CH6/EX6.2/s2.sce
new file mode 100644
index 000000000..2bf38cc4e
--- /dev/null
+++ b/1499/CH6/EX6.2/s2.sce
@@ -0,0 +1,49 @@
+s=%s;
+s=poly(0,'s');
+t=[0:0.05:10];
+syms Kv;
+g=(Kv/(s*(0.5*s+1)));
+// given Kv=20
+Kv=20;
+g=(20/(s*(0.5*s+1)));
+G=syslin('c',g)
+fmin=0.01;
+fmax=100;
+subplot(2,2,1)
+bode(G)
+
+subplot(2,2,2),
+plot2d(t,csim('step',t,G))
+//bode(G,fmin,fmax)
+//show_margins(G)
+
+xtitle("uncompensated system")
+[gm,freqGM]=g_margin(G)
+[pm,freqPM]=p_margin(G)
+disp(gm,"gain_margin=")
+disp((freqGM*2*%pi),"gain margin freq=");
+disp(pm,"phase margin=")
+disp((freqPM*2*%pi),"phase margin freq=");
+
+gc=(1+8.7*s)/(1+166.7*s)
+Gc=syslin('c',gc)
+disp(Gc,"transfer function of lead compensator=");
+G1=G*Gc
+disp(G1,"overall transfer function=");
+fmin=0.01;
+fmax=100;
+
+subplot(2,2,3)
+bode(G1)
+
+subplot(2,2,4),
+plot2d(t,csim('step',t,G1))
+
+
+//bode(G1,fmin,fmax);
+//show_margins(G1)
+xtitle("compensated system")
+[gm,freqGM]=g_margin(G1);
+[pm,freqPM]=p_margin(G1);
+disp(pm,"phase margin of compensated system=")
+disp((freqPM*2*%pi),"gain cross over frequency=")