t23comp.m
来自「状态反馈matlab仿真程序」· M 代码 · 共 40 行
M
40 行
%------------------------------------------------------------------
% This program is used to compare the step responses of Unstable System
% by Zero-pole placement method, Inner-model method and Z-N method etc.
% NOTE: The 't23k1k2.m' must be executed first to produce K,T,tao3.
%------------------------------------------------------------------
Ts=150;
SetValue=1;
Tnoise=Ts+1;
Weight=0;
Anoise=0;
Stime=0;
Nload=0.0001;
%Nload=0;
figure(4);
clf;
xlabel('t'); ylabel('y'); Title('The Step Response of Unstable System');
hold on
%(1)Zero-pole placement method with 'StatePIDzp.mdl'
Kp=0.1523;
Ti=1.9823;
Td=0.4842;
[t,xx,yy]=sim('StatePIDzp',Ts);
plot(t,yy);
%(2)Inner-model method to solve the step response with 'StatePIDmo.mdl'
lemda=7.3;
Kp=b1/(2*lemda*K);
Ti=b1/b0;
Td=b2/b1;
Lf=lemda/2;
[t,xx,yy]=sim('StatePIDmo',Ts);
plot(t,yy);
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?