Tuning PI, PD, PID controller
조회 수: 28 (최근 30일)
이전 댓글 표시
Hi guys,
I'm using pidtune and pidtool for tuning the controllers, but even if I put all three constants (Kd, Ki, Kp) it tunes the controller as if it's a p controller. Will post the code bellow, also the return message as a pic. Please help <3.
Kp=290;
Ki=500;
Kd=46;
num1=[Kd Kp Ki];
den1=[1 0];
W=tf(num1,den1);
num2=[1];
den2=[1 10 20];
G=tf(num2,den2);
A=series(W,G);
sys=feedback(A,1);
t=0:0.01:2;
y=step(sys,t);
plot(t,y);
grid on;
pidtune(G,'pi')
pidtool(G,'pid');
댓글 수: 0
답변 (1개)
Sam Chak
2022년 9월 7일
Not sure what happened. But it works for both auto and manual tuning.
% Plant
Gp = tf(1, [1 10 20])
% PID (Auto)
Gc1 = pidtune(Gp, 'PID')
Gcl1 = feedback(Gc1*Gp, 1);
% PIDF (Manual)
kp = 32.94;
ki = 86.88;
kd = 0.3632;
Tf = 0.1208;
Gc = pid(kp, ki, kd, Tf)
Gcl2= feedback(Gc*Gp, 1);
% Step responses
step(Gcl1, 2), hold on
step(Gcl2, 2), grid on
legend('PID', 'PIDF')
댓글 수: 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!