필터 지우기
필터 지우기

How to build PID controller on command Line

조회 수: 1 (최근 30일)
Bahar Ebru
Bahar Ebru 2022년 6월 26일
답변: Sam Chak 2022년 6월 27일
Hello, I'm trying to find and built a PID system.But it gets error.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.
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')

답변 (1개)

Sam Chak
Sam Chak 2022년 6월 27일
Not exactly sure what you are trying to do (your description and code are not tally). After checking the documentation, I think you can try something like this:
% Plant
Gp = tf(1, [1 10 20])
Gp = 1 --------------- s^2 + 10 s + 20 Continuous-time transfer function.
% Compensator
[Gc, info] = pidtune(Gp, 'PID')
Gc = 1 Kp + Ki * --- + Kd * s s with Kp = 39.3, Ki = 116, Kd = 3.33 Continuous-time PID controller in parallel form.
info = struct with fields:
Stable: 1 CrossoverFrequency: 4.1614 PhaseMargin: 74.0404
% Closed-loop system
Gcl = feedback(Gc*Gp, 1);
Gcl = minreal(Gcl)
Gcl = 3.326 s^2 + 39.27 s + 115.9 --------------------------------- s^3 + 13.33 s^2 + 59.27 s + 115.9 Continuous-time transfer function.
step(Gcl, 5)
bode(Gcl)
nyquist(Gcl)

카테고리

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