kodzikkodzik

Kolorwanie:
Status:
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
te=ScopeData.time;
ue=ScopeData.Data(:,1);
ye=ScopeData.Data(:,2);
subplot(211);
plot(te,ue),grid;
legend('u');
subplot(212)
plot(te,ye),grid;
legend('y')
n=find(te<=30000);
ns=max(n);
t=te(ns:end)-te(ns);
u=ue(ns:end)-ue(ns-1);
y=ye(ns:end)-ye(ns);
figure
subplot(211)
plot(t,u),grid;
legend('u');
subplot(212)
plot(t,y),grid;
legend('y')
yu=y(end);
uu=u(end);
n10=find(y<=0.1*yu);
n10=max(n10);
t10=y(n10);
y10=y(n10);
n90=find(y<=0.9*yu);
n90=max(n90);
t90=t(n90);
y90=y(n90);
figure
plot(t,y,t10,y10,'*',t90,y90,'*'),grid
k=yu/uu;
T=(t90-t10)/2.2;
L=k;
M=[T 1]
ymodel=lsim(L,M,u,t);
figure
plot(t,y,t,ymodel),grid
tr=10*60;
kp=(4*T)/(tr*k);
Ti=2*T;
Td=Ti/4;
P=kp;
I=kp/Ti;
D=kp*Td;

Copyrights 2014-2020 © Wklejaj.pl Wszelkie prawa zastrzeżone.