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/CH7/EX7.19/Ex7_19.sce | 56 ++++++++++++++++++++++++++++++++++++++++++ 3432/CH7/EX7.19/Ex7_19_f0.pdf | Bin 0 -> 20074 bytes 2 files changed, 56 insertions(+) create mode 100644 3432/CH7/EX7.19/Ex7_19.sce create mode 100644 3432/CH7/EX7.19/Ex7_19_f0.pdf (limited to '3432/CH7/EX7.19') diff --git a/3432/CH7/EX7.19/Ex7_19.sce b/3432/CH7/EX7.19/Ex7_19.sce new file mode 100644 index 000000000..013575d69 --- /dev/null +++ b/3432/CH7/EX7.19/Ex7_19.sce @@ -0,0 +1,56 @@ +//Example 7.19 +//Reference input to Type-1 control system: DC Motor + +xdel(winsid())//close all graphics Windows +clear; +clc; +//------------------------------------------------------------------ + +//Location of system Zero +z0=2; + +// State space representation +F=[0 1;0 -1]; +G=[0 1]'; +H=[1 0]; +J=0; +n=sqrt(length(F)); //order of the system + +//computing state feedback matrix to place poles at assumed location [-1 -2] +exec('./acker_dk.sci', -1); +K=acker_dk(F,G,[-1, -2]); //assume pd=[-1 -2] +//------------------------------------------------------------------ +//augmented matrix for tracking the reference +A=[F G;H J]; +N=A\[zeros(1,n) 1]'; +Nx=N(1:n); +Nu=N(n+1); +disp(Nx,"Nx",Nu,"Nu") + +//feedforward gain (input weight) +Ntilde=Nu+K*Nx; +disp(Ntilde,"N_tilde","Input gain: N_tilde =Nu+K Nx") +//------------------------------------------------------------------ +// Verify if ||y-r|| -> 0; + +syscl=syslin('c',(F-G*K),G*Ntilde,H,J); //closed loop system + +t=0:0.1:10; +r=ones(1,length(t));//reference input +[y x]=csim('step',t,syscl); //closed loop response + +e=sqrt((r-y).^2) //norm of error +plot(t,y); +plot(t,r,'m:'); //reference input +plot(t,e,'r-.'); //norm of error +xset('font size',3); +xstring(3,0.83,"y") +xstring(2,1,"r") +xstring(3,0.1,"$\|e\|$") +//Title, labels and grid to the figure +exec .\fig_settings.sci; // custom script for setting figure properties +title('Step response of undamped oscillator to reference input','fontsize',3); +xlabel('Time t (sec.)','fontsize',2); +ylabel('Amplitude','fontsize',2); +zoom_rect([0 -0.1 10 1.1]) +//------------------------------------------------------------------ diff --git a/3432/CH7/EX7.19/Ex7_19_f0.pdf b/3432/CH7/EX7.19/Ex7_19_f0.pdf new file mode 100644 index 000000000..67707bcb4 Binary files /dev/null and b/3432/CH7/EX7.19/Ex7_19_f0.pdf differ -- cgit