diff options
Diffstat (limited to '46/CH17/EX17.4')
-rwxr-xr-x | 46/CH17/EX17.4/Example17_4.sce | 41 | ||||
-rwxr-xr-x | 46/CH17/EX17.4/figure17_4a.jpg | bin | 0 -> 72606 bytes | |||
-rwxr-xr-x | 46/CH17/EX17.4/figure17_4b.jpg | bin | 0 -> 73194 bytes |
3 files changed, 41 insertions, 0 deletions
diff --git a/46/CH17/EX17.4/Example17_4.sce b/46/CH17/EX17.4/Example17_4.sce new file mode 100755 index 000000000..1a2e58d94 --- /dev/null +++ b/46/CH17/EX17.4/Example17_4.sce @@ -0,0 +1,41 @@ +//Example 17.4
+clc
+s=%s;
+syms Kc K1 tauI tauD
+K=0.09;
+Kc=K1/K;
+Gc=K1*(1+1/(tauI*s)+tauD*s)
+g1=1/((s+1)*(s+2));
+//g2=exp(-0.5*s), we can write it as g2=(2-0.5*s)/(2+0.5*s). Therefore,
+g2=(2-0.5*s)/(2+0.5*s);
+G=g1*g2;
+G=syslin('c',G)
+clf
+bode(G)
+show_margins(G)
+//From the bode diagrams we get
+wc0=1.56;//rad/min
+A=0.145;
+Ku=1/A
+Pu=2*%pi/wc0
+//By Z-N rules
+//For P controller
+K1=0.5*Ku
+Gc=K1
+G1=Gc*G/K1
+//For PI controller
+K1=0.45*Ku
+tauI=Pu/1.2
+Gc=K1*(1+1/(tauI*s))
+G2=Gc*G/K1
+//For PID controller
+K1=0.6*Ku
+tauI=Pu/2
+tauD=Pu/8
+Gc=K1*(1+1/(tauI*s)+tauD*s)
+G3=Gc*G/K1
+clf
+bode([G1;G2;G3])
+legend(['G1';'G2';'G3']);
+
+
diff --git a/46/CH17/EX17.4/figure17_4a.jpg b/46/CH17/EX17.4/figure17_4a.jpg Binary files differnew file mode 100755 index 000000000..f416d1dc9 --- /dev/null +++ b/46/CH17/EX17.4/figure17_4a.jpg diff --git a/46/CH17/EX17.4/figure17_4b.jpg b/46/CH17/EX17.4/figure17_4b.jpg Binary files differnew file mode 100755 index 000000000..6dbafe2d3 --- /dev/null +++ b/46/CH17/EX17.4/figure17_4b.jpg |