Tuning PI, PD, PID controller

조회 수: 28 (최근 30일)
Dragana Krstevska
Dragana Krstevska 2020년 5월 15일
답변: Sam Chak 2022년 9월 7일
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');

답변 (1개)

Sam Chak
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])
Gp = 1 --------------- s^2 + 10 s + 20 Continuous-time transfer function.
% PID (Auto)
Gc1 = pidtune(Gp, 'PID')
Gc1 = 1 Kp + Ki * --- + Kd * s s with Kp = 39.3, Ki = 116, Kd = 3.33 Continuous-time PID controller in parallel form.
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)
Gc = 1 s Kp + Ki * --- + Kd * -------- s Tf*s+1 with Kp = 32.9, Ki = 86.9, Kd = 0.363, Tf = 0.121 Continuous-time PIDF controller in parallel form.
Gcl2= feedback(Gc*Gp, 1);
% Step responses
step(Gcl1, 2), hold on
step(Gcl2, 2), grid on
legend('PID', 'PIDF')

카테고리

Help CenterFile Exchange에서 PID Controller Tuning에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by