summaryrefslogtreecommitdiff
path: root/Working_Examples/3432/CH6/EX6.18
diff options
context:
space:
mode:
Diffstat (limited to 'Working_Examples/3432/CH6/EX6.18')
-rwxr-xr-xWorking_Examples/3432/CH6/EX6.18/DEPENDENCIES/fig_settings.sci9
-rwxr-xr-xWorking_Examples/3432/CH6/EX6.18/Ex6_18.sce42
-rwxr-xr-xWorking_Examples/3432/CH6/EX6.18/Ex6_18_f0.pdfbin0 -> 32830 bytes
-rwxr-xr-xWorking_Examples/3432/CH6/EX6.18/Ex6_18_f1.pdfbin0 -> 29436 bytes
4 files changed, 51 insertions, 0 deletions
diff --git a/Working_Examples/3432/CH6/EX6.18/DEPENDENCIES/fig_settings.sci b/Working_Examples/3432/CH6/EX6.18/DEPENDENCIES/fig_settings.sci
new file mode 100755
index 0000000..5d5e7d4
--- /dev/null
+++ b/Working_Examples/3432/CH6/EX6.18/DEPENDENCIES/fig_settings.sci
@@ -0,0 +1,9 @@
+//------------------------------------------------------------------
+//figure handel settings
+f=get("current_figure"); //Current figure handle
+f.background=8; //make the figure window background white
+l=f.children(1);
+l.background=8 ;//make the text background white
+id=color('grey');
+xgrid(id);
+//------------------------------------------------------------------
diff --git a/Working_Examples/3432/CH6/EX6.18/Ex6_18.sce b/Working_Examples/3432/CH6/EX6.18/Ex6_18.sce
new file mode 100755
index 0000000..0ec43ba
--- /dev/null
+++ b/Working_Examples/3432/CH6/EX6.18/Ex6_18.sce
@@ -0,0 +1,42 @@
+//Example 6.18
+//Lag compensation for DC motor.
+
+xdel(winsid())//close all graphics Windows
+clear;
+clc;
+//------------------------------------------------------------------
+//System transfer function
+s=poly(0,'s');
+g=1/s/(s+1);
+K=10; //DC gain
+KGs=syslin('c',K*g);
+
+//Lag compensator
+numD=10*s+1; //0.1
+denD=100*s+1; //0.01
+D=numD/denD;
+Ds=syslin('c',D);
+
+KGDs=Ds*KGs; //compensated system
+
+//The bode plot of the system
+bode([KGs;KGDs],0.001/2/%pi,10/2/%pi,['KG(s)';'D(s)G(s)'],"rad");
+exec .\fig_settings.sci; // custom script for setting figure properties
+title('Frequency response of lag-compensation design...
+ of DC motor','fontsize',3)
+//------------------------------------------------------------------
+//step response
+//closed loop system
+Gc=KGDs/(KGDs+1);
+figure;
+t=0:0.05:50;
+v=csim('step',t,Gc);
+plot(t,v,2)
+
+//Title, labels and grid to the figure
+exec .\fig_settings.sci; // custom script for setting figure properties
+title('Step response for Lag-compensation design...
+ of DC motor','fontsize',3)
+xlabel('Time t (sec.)','fontsize',2)
+ylabel('y','fontsize',2)
+//------------------------------------------------------------------
diff --git a/Working_Examples/3432/CH6/EX6.18/Ex6_18_f0.pdf b/Working_Examples/3432/CH6/EX6.18/Ex6_18_f0.pdf
new file mode 100755
index 0000000..5f85523
--- /dev/null
+++ b/Working_Examples/3432/CH6/EX6.18/Ex6_18_f0.pdf
Binary files differ
diff --git a/Working_Examples/3432/CH6/EX6.18/Ex6_18_f1.pdf b/Working_Examples/3432/CH6/EX6.18/Ex6_18_f1.pdf
new file mode 100755
index 0000000..e43c621
--- /dev/null
+++ b/Working_Examples/3432/CH6/EX6.18/Ex6_18_f1.pdf
Binary files differ