From b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b Mon Sep 17 00:00:00 2001 From: priyanka Date: Wed, 24 Jun 2015 15:03:17 +0530 Subject: initial commit / add all books --- 1202/CH17/EX17.5/17_5.png | Bin 0 -> 9101 bytes 1202/CH17/EX17.5/17_5.sce | 66 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100755 1202/CH17/EX17.5/17_5.png create mode 100755 1202/CH17/EX17.5/17_5.sce (limited to '1202/CH17/EX17.5') diff --git a/1202/CH17/EX17.5/17_5.png b/1202/CH17/EX17.5/17_5.png new file mode 100755 index 000000000..70026971c Binary files /dev/null and b/1202/CH17/EX17.5/17_5.png differ diff --git a/1202/CH17/EX17.5/17_5.sce b/1202/CH17/EX17.5/17_5.sce new file mode 100755 index 000000000..e386215ce --- /dev/null +++ b/1202/CH17/EX17.5/17_5.sce @@ -0,0 +1,66 @@ +clear +clc + +//Example 17.5 +disp('Example 17.5') + +deltaT=[0.05 0.25 0.5 1]';//sampling time +K=-20; +theta=1+(deltaT/2);//Add half of sampling time to delay for finding PI settings +tau=5; + +//Table 11.3 ITAE disturbance settings +//Note that there is an error in book solution saying Table 11.2 +//It should be table 11.3 + +Y=0.859*(theta/tau)^(-0.977);Kc=Y/K; +taui=tau*(0.674*(theta/tau)^-0.680).^-1; + +mprintf('\n ITAE(disturbance) \n') +mprintf(' deltaT Kc tauI') +mprintf('\n %f %f %f',deltaT,Kc,taui) + +//Finding digital controller settings +//Eqn 17-55 +a0=1+deltaT./taui; +a1=-(1); //since tauD=0 +a2=0; +z=%z; + +Gcz=Kc.*(a0+a1*z^-1)./(1-z^-1); + +//Refer to table 17.1 to convert continuous transfer function to digital form +Gp=K*(1-exp(-1/tau*deltaT)).*z^(-1+(-1)./deltaT)./(1-exp((-1)/tau*deltaT)*z^-1);//z^(-1/deltaT) for delay + +G_CL=syslin('d',((Gp)./(Gcz.*Gp+1))); + +t=0:deltaT(1):15 +u=ones(1,length(t)); +yt=flts(u,G_CL(1,1)); +plot(t,yt,'-') + +t=0:deltaT(2):15 +u=ones(1,length(t)); +yt=flts(u,G_CL(2,1)); +plot(t,yt,'green--') + +t=0:deltaT(3):15 +u=ones(1,length(t)); +yt=flts(u,G_CL(3,1)); +plot(t,yt,'black-.') + +t=0:deltaT(4):15 +u=ones(1,length(t)); +yt=flts(u,G_CL(4,1)); +plot(t,yt,'red:') + +set(gca(),"data_bounds",[0 15 -8 1]); //putting bounds on display +l=legend("$\Delta t=0.05\ min$","$\Delta t=0.25\ min$","$\Delta t=0.5\ min$","$\Delta t=1\ min$",position=4); +xtitle("Example 17.5","Time(min)","$y$"); +a=get("current_axes"); +c=a.y_label;c.font_size=5; + +mprintf("\nNote that there is a mismatch between the book simulation and what\n... +what we get from SCILAB. The book is wrong. This has been crosschecked using\n... +simulation in SIMULINK(MATLAB)") + -- cgit