unit step disturbance at a time of 40 seconds
5 ビュー (過去 30 日間)
古いコメントを表示
How do I generate a unit step disturbance at a time of 40 seconds for my PID controller
clear all;
s=tf('s');
load time.dat;
load response.dat;
K = 2;
Tau = 3;
dt = 0.9;
g = ((2/(3*s + 1))*(exp(-dt*s)))
[gy,tg]=step(g,20)
plot(time, response,'k',tg,gy,'r','LineWidth',2)
hold on
% Cohen - Coon PI tuning
Kc = (1/K)*(Tau/dt)*(0.9 + (dt/(12*Tau)));
Tau_1 = (dt)*((30 + 3*(dt/Tau))/(9+20*(dt/Tau)));
P = Kc;
I = Kc/Tau_1;
cont = ((s*P + I)/s);
gol = cont*g
gcl = feedback(gol,1)
step(gcl,20)
hold on
grid on
Thanks
0 件のコメント
回答 (1 件)
Sam Chak
2022 年 12 月 12 日
編集済み: Sam Chak
2022 年 12 月 12 日
The closed-loop transfer function for Y(s)/D(s) is given by
The following shows how to compute the comparison between the step responses for 40 seconds. Let us know if this is the technical answer that you are looking for.
s = tf('s');
% Parameters
K = 2;
Tau = 3;
dt = 0.9;
% Plant
Gp = ((2/(3*s + 1))*(exp(-dt*s)));
% Cohen - Coon PI tuning
Kc = (1/K)*(Tau/dt)*(0.9 + (dt/(12*Tau)));
Tau_1 = (dt)*((30 + 3*(dt/Tau))/(9 + 20*(dt/Tau)));
Kp = Kc;
Ki = Kc/Tau_1;
Gc = ((Kp*s + Ki)/s);
% Response to the Unit Step Reference
Gol = Gc*Gp;
Gcl = feedback(Gol, 1); % closed-loop transfer function Y(s)/R(s)
step(Gcl, 40)
hold on
% Response to the Unit Step Disturbance
Gcd = feedback(Gp, Gc); % closed-loop transfer function Y(s)/D(s)
step(Gcd, 40)
legend('Step Reference Response', 'Step Disturbance Response')
hold off, grid on
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で PID Controller Tuning についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!