diff options
author | prashantsinalkar | 2017-10-10 12:27:19 +0530 |
---|---|---|
committer | prashantsinalkar | 2017-10-10 12:27:19 +0530 |
commit | 7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (patch) | |
tree | dbb9e3ddb5fc829e7c5c7e6be99b2c4ba356132c /3432/CH7/EX7.30/Ex7_30.sce | |
parent | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (diff) | |
download | Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.gz Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.bz2 Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.zip |
initial commit / add all books
Diffstat (limited to '3432/CH7/EX7.30/Ex7_30.sce')
-rw-r--r-- | 3432/CH7/EX7.30/Ex7_30.sce | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/3432/CH7/EX7.30/Ex7_30.sce b/3432/CH7/EX7.30/Ex7_30.sce new file mode 100644 index 000000000..99e6aaee4 --- /dev/null +++ b/3432/CH7/EX7.30/Ex7_30.sce @@ -0,0 +1,73 @@ +//Example 7.30
+// Full-Order Compensator Design for DC Servo.
+
+xdel(winsid())//close all graphics Windows
+clear;
+clc;
+//------------------------------------------------------------------
+
+// State space representation
+//Transfer function model for DC Servo
+s=poly(0,'s');
+num=10;
+den=s*(s+2)*(s+8);
+Gs=syslin('c',num/den);
+
+// State space representation
+F=[-10 1 0;-16 0 1;0 0 0];
+G=[0 0 10]';
+H=[1 0 0];
+J=0;
+n=sqrt(length(F));
+//Desired poles for the DC Servo system.
+Pc=[-1.42 -1.04+2.14*%i -1.04-2.14*%i ]
+
+
+// State feedback gain
+K=ppol(F,G,Pc)
+disp(K,'K=',"State feedback gain")
+
+//Estimator - error roots are at
+Pe=[-4.25 -3.13+6.41*%i -3.13-6.41*%i]
+L=ppol(F',H',Pe);
+L=L';
+disp(L,'L=',"Observer gain")
+//------------------------------------------------------------------
+//Compensator Design
+DK=-K*inv(s*eye(n,n)-F+G*K+L*H)*L;
+
+exec('./zpk_dk.sci', -1);
+[p,z]=zpk_dk(DK);
+D=poly(z,'s','roots')/poly(p,'s','roots')
+
+evans(Gs*D)
+zoom_rect([-8 -9 3 9])
+
+f=gca();
+f.x_location = "origin"
+f.y_location = "origin"
+xset("color",2);
+h=legend('');
+h.visible = "off"
+
+//Title, labels and grid to the figure
+exec .\fig_settings.sci; // custom script for setting figure properties
+title('Root locus for DC servo pole assignment','fontsize',3);
+//------------------------------------------------------------------
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|