Finding Kp,Ti,Td with PID tuner
조회 수: 27 (최근 30일)
이전 댓글 표시
Hello, I'm trying to find and built a PID system.But it gets error.
P=4;
bode(P)
I=tf([1],[5]);
bode(I);
D=9;
bode(D);
sys=tf([270 50 1],[225 5 0])
[C_pi,info]=pidtune(sys,'PI')
[C_p,info]=pidtune(sys,'P')
bode(sys)
nyquist(sys)
[C_PD,info]=pidtune(syz,'PID')
I have to find,reponse time,steady stae error,overshot from Kp,Ki,Td.Function I have to work with is (1/s^2+10s+20).
Tune controller is in this sequence;
1.Only P element
2.Enable D, and returne P
3.Enable I and retune P,D.
And I have to plot, P,I,D,PI,PD,PID, bode and nyquist graphs.
댓글 수: 0
답변 (1개)
Sam Chak
2022년 6월 28일
Kind of remember seeing a similar question few days ago. Probably your classmate. Anyway, this is how you can plot the step response of a closed-loop system.
Question 1:
% Plant
Gp = tf(1, [1 10 20])
% Question 1
[Gc1, info] = pidtune(Gp, 'P')
% Closed-loop system
Gcl1 = minreal(feedback(Gc1*Gp, 1))
step(Gcl1, 3) % steady-state error between 0.8 and 1.0 is significant.
% bode(Gcl1)
% nyquist(Gcl1)
Question 2:
% Question 2
[Gc2, info] = pidtune(Gp, 'PD')
% Closed-loop system
Gcl2 = minreal(feedback(Gc2*Gp, 1))
step(Gcl2, 3) % response is super fast and steady-state error is reduced substantially 1 - 1216/1236, but overshoot is relatively high
% bode(Gcl2)
% nyquist(Gcl2)
Question 3:
% Question 3
[Gc3, info] = pidtune(Gp, 'PID')
% Closed-loop system
Gcl3 = minreal(feedback(Gc3*Gp, 1))
step(Gcl3, 3) % no steady-state error and the overshoot is reduced. Response settles under 2 seconds.
% bode(Gcl3)
% nyquist(Gcl3)
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Get Started with Control System Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!