Смекни!
smekni.com

Автоматическая система регулирования промышленного кондиционера (стр. 5 из 5)

0 0 0 0 0 0 0 0 -1/118 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;

0 0 0 0 0 0 0 0 1/26.7 -1/26.7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;

0 0 0 0 0 0 0 0 0 4/14 -2/14 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;

0 0 0 0 0 0 0 0 0 0 0 -1/430 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;

0 0 0 0 0 0 0 0 0 0 0 4/80 -2/80 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;

0 0 0 0 0 0 0 0 0 0 0 0 0 -1/470 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;

0 0 0 0 0 0 0 0 0 0 0 0 0 4/170 -2/170 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1/480 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4/180 -2/180 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1/430 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4/100 -2/100 0 0 0 0 0 0 0 0 0 0 0 0 0 0;

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1/840 0 0 0 0 0 0 0 0 0 0 0 0 0;

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4/100 -2/100 0 0 0 0 0 0 0 0 0 0 0 0;

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1/800 0 0 0 0 0 0 0 0 0 0 0;

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4/250 -2/250 0 0 0 0 0 0 0 0 0 0;

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1/570 0 0 0 0 0 0 0 0 0;

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4/300 -2/300 0 0 0 0 0 0 0 0;

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1/450 0 0 0 0 0 0 0;

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4/150 -2/150 0 0 0 0 0 0;

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1/640 0 0 0 0 0;

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4/220 -2/220 0 0 0 0;

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1/540 0 0 0;

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4/300 -2/300 0 0;

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1/950 0;

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4/480 -2/480];

B=[6.5/118000;

0000;

0000;

0-6.1/130000;

0000;

006.5/1180;

0000;

0000;

0 006.5/118;

0 000;

0 000;

00.4/43000;

0000;

000.3/4700;

0000;

0000.9/480;

0000;

-0.7/430000;

0000;

00.2/84000;

0000;

000.9/8000;

0000;

0000.5/570;

0000;

-0.1/450000;

0000;

00.1/64000;

0000;

000.1/5400;

0000;

0000.2/950;

0000];

%B=[ 0 0 0 0;0 0.4/430 0 0;0 0 0 0;0 0 0.3/470 0;0 0 0 0;0 0 0 0.9/480;0 0 0 0;-0.7/430 0 0 0;0 0 0 0;0 0.2/840 0 0;0 0 0 0;0 0 0.9/800 0;0 0 0 0;0 0 0 0.5/570;0 0 0 0;-0.1/450 0 0 0;0 0 0 0;0 0.1/640 0 0;0 0 0 0;0 0 0.1/540 0;0 0 0 0;0 0 0 0.2/950;0 0 0 0];

C=[0 -1 1 -1 1 0 -1 -1 0 -1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;

0 0 0 0 0 0 0 0 0 0 0 -1 1 -1 1 -1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 1 -1 1 -1 1 -1 1 0 0 0 0 0 0 0 0;

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 1 -1 1 -1 1 -1 1];

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

dt=0.1/max(abs(eig(A))); %0.25

D=zeros(4);

t=[0:dt:5000];

[Ad Bd]=c2d(A,B,dt);

G=length(t);

y=dstep(Ad,Bd,C,D,1,G);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

figure(1)

subplot(4,4,1); plot(t,y(:,1));grid;ylabel('y1,РЎ');title('Razgon u1,1%');

subplot(4,4,5); plot(t,y(:,2));grid;ylabel('y2,РЎ');

subplot(4,4,9); plot(t,y(:,3));grid;ylabel('y3,РЎ');

subplot(4,4,13); plot(t,y(:,4));grid;ylabel('y4,РЎ');

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

y=dstep(Ad,Bd,C,D,2,G);

subplot(4,4,2); plot(t,y(:,1));grid;ylabel('y1,РЎ');title('Razgon u2,1%');

subplot(4,4,6); plot(t,y(:,2));grid;ylabel('y2,РЎ');

subplot(4,4,10); plot(t,y(:,3));grid;ylabel('y3,РЎ');

subplot(4,4,14); plot(t,y(:,4));grid;ylabel('y4,РЎ');

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

y=dstep(Ad,Bd,C,D,3,G);

subplot(4,4,3); plot(t,y(:,1));grid;ylabel('y1,РЎ');title('Razgon u3,1%');

subplot(4,4,7); plot(t,y(:,2));grid;ylabel('y2,РЎ');

subplot(4,4,11); plot(t,y(:,3));grid;ylabel('y3,РЎ');

subplot(4,4,15); plot(t,y(:,4));grid;ylabel('y4,РЎ');

y=dstep(Ad,Bd,C,D,4,G);

subplot(4,4,4); plot(t,y(:,1));grid;ylabel('y1,РЎ');title('Razgon u4,1%');

subplot(4,4,8); plot(t,y(:,2));grid;ylabel('y2,РЎ');

subplot(4,4,12); plot(t,y(:,3));grid;ylabel('y3,РЎ');

subplot(4,4,16); plot(t,y(:,4));grid;ylabel('y4,РЎ');

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

A1=[Ad zeros(33,4); C eye(4)];

B1=[Bd;zeros(4)];

C1=[zeros(4,33) eye(4)];

Q=[eye(33) zeros(33,4);zeros(4,33) eye(4)];

R=eye(4);

Q1=eye(37);

R1=eye(4);

K=dlqr(A1,B1,Q,R);

L=dlqr(A1',C1',Q1,R1)';

K1=K(:,1:33);

K2=K(:,34:37);

L1=L(1:33,:);

L2=L(34:37,:);

Ar=[Ad-Bd*K1 -Bd*K2-L1 L1; C eye(4)-L2 L2; zeros(4,33) zeros(4) eye(4)];

Br=[zeros(33,4); zeros(4); eye(4)];

Cr=[-K zeros(4)];

x=zeros(33,1); xr=zeros(41,1); u=zeros(4,1);

yy=[]; uu=[];f=[0.5;0.5;0.5;1];z=[7;0.8;1.5;2.8];

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

for i=1:10000,

y=C*x; e=-z+y;

u=Cr*xr; xr=Ar*xr+Br*e;

y=C*x; x=Ad*x+Bd*(u+f);

yy=[yy; y']; uu=[uu; u'];

end


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

x1=x; xr1=xr; u1=u;

figure(2)

subplot(4,4,2); plot(yy(:,1));grid;ylabel('y1,C');title('y1');

subplot(4,4,4); plot(yy(:,2));grid;ylabel('y2,C');title('y2');

subplot(4,4,6); plot(yy(:,3));grid;ylabel('y3,C');title('y3');

subplot(4,4,8); plot(yy(:,4));grid;ylabel('y4,C');title('y4');

subplot(4,4,1); plot(uu(:,1));grid;ylabel('u1,%');title('u1');

subplot(4,4,3); plot(uu(:,2));grid;ylabel('u2,%');title('u2');

subplot(4,4,5); plot(uu(:,3));grid;ylabel('u3,%');title('u3');

subplot(4,4,7); plot(uu(:,4));grid;ylabel('u4,%');title('u4');

Функциональная схема автоматизации приведена на рисунке


Рисунок – Функциональная схема автоматизации