From 7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 Mon Sep 17 00:00:00 2001 From: prashantsinalkar Date: Tue, 10 Oct 2017 12:27:19 +0530 Subject: initial commit / add all books --- 3432/CH8/EX8.2/Ex8_2.sce | 65 ++++++++++++++++++++++++++++++++++++++++ 3432/CH8/EX8.2/Ex8_2_f0.pdf | Bin 0 -> 17544 bytes 3432/CH8/EX8.2/Ex8_2_f1.pdf | Bin 0 -> 37047 bytes 3432/CH8/EX8.2/Ex8_2_model.xcos | 1 + 4 files changed, 66 insertions(+) create mode 100644 3432/CH8/EX8.2/Ex8_2.sce create mode 100644 3432/CH8/EX8.2/Ex8_2_f0.pdf create mode 100644 3432/CH8/EX8.2/Ex8_2_f1.pdf create mode 100644 3432/CH8/EX8.2/Ex8_2_model.xcos (limited to '3432/CH8/EX8.2') diff --git a/3432/CH8/EX8.2/Ex8_2.sce b/3432/CH8/EX8.2/Ex8_2.sce new file mode 100644 index 000000000..d5b21520e --- /dev/null +++ b/3432/CH8/EX8.2/Ex8_2.sce @@ -0,0 +1,65 @@ +//Example 8.2 +// Design of a Space Station Attitude Digital Controller using +// Discrete Equivalents + +xdel(winsid())//close all graphics Windows +clear; +clc; +//------------------------------------------------------------------ +// State space representation of continuous time system +s=poly(0,'s'); +num=1; +den=(s^2); +Gs=syslin('c',num/den); +Ds=0.81*(s+0.2)/(s+2); +Ds=syslin('c',Ds); +sysc=Gs*Ds; + +//Root locus +evans(sysc) +zoom_rect([-2 -0.4 0.5 0.4]) +f=gca(); +f.x_location = "origin" +f.y_location = "origin" +h=legend(''); +h.visible = "off" +exec .\fig_settings.sci; //custom script for setting figure properties +title('s-plane locus with respect to K','fontsize',3) +//------------------------------------------------------------------ +//Contonuous time response of the system +figure, +tc=0:0.1:30; +syscl=sysc/(1+sysc) +yc=csim("step",tc,syscl); +plot(tc,yc,'b') +//------------------------------------------------------------------ +// Discretization of the system at +z=poly(0,'z') +// sampling time Ts=1 sec +Ts=1; +Dz1=horner(Ds,2/Ts*(z-1)/(z+1)) +disp(Dz1,"Dz1=","Discrete-time controller with Ts=1 sec.") + +// sampling time Ts=0.5 sec +Ts2=0.5; +Dz2=horner(Ds,2/Ts2*(z-1)/(z+1)) +disp(Dz2,"Dz2=","Discrete-time controller with Ts=0.5 sec.") + +//discrete-time response of the system. + +importXcosDiagram(".\Ex8_2_model.xcos") + //The diagram data structure +xcos_simulate(scs_m,4); +//scs_m.props.context +plot(yt1.time,yt1.values,'m-.') //with Ts=1sec. +plot(yt2.time,yt2.values,'r--') //with Ts=0.5 sec. +//------------------------------------------------------------------------------ + +title('step responses of continous and digital implementations','fontsize',3) + +exec .\fig_settings.sci; // custom script for setting figure properties +xlabel('Time (sec)','fontsize',2) +ylabel('Plant output','fontsize',2) +legend("Continuous design","Discrete equivalent design, T=1 sec."... +,"Discrete equivalent design, T=0.5 sec.",4) +//------------------------------------------------------------------------------ diff --git a/3432/CH8/EX8.2/Ex8_2_f0.pdf b/3432/CH8/EX8.2/Ex8_2_f0.pdf new file mode 100644 index 000000000..58a1e2d85 Binary files /dev/null and b/3432/CH8/EX8.2/Ex8_2_f0.pdf differ diff --git a/3432/CH8/EX8.2/Ex8_2_f1.pdf b/3432/CH8/EX8.2/Ex8_2_f1.pdf new file mode 100644 index 000000000..614471a7f Binary files /dev/null and b/3432/CH8/EX8.2/Ex8_2_f1.pdf differ diff --git a/3432/CH8/EX8.2/Ex8_2_model.xcos b/3432/CH8/EX8.2/Ex8_2_model.xcos new file mode 100644 index 000000000..ec561ed0c --- /dev/null +++ b/3432/CH8/EX8.2/Ex8_2_model.xcos @@ -0,0 +1 @@ + \ No newline at end of file -- cgit