MATLAB: Root Locus


Daily Life of Engineering Student, catatan kali ini tentang root locus MATLAB.
Berikut ini adalah script MATLAB untuk plot root locus.

clear all, close all, clc;

%% Transfer function

num = 1;
den = [1 4 3];
sys = tf(num,den);
% the plant
Kp = 100;
Ki = 50;
Kd = 25;
PID = tf([Kd Kp Ki],[1 0]);
% PID controller

%% Closed-loop system

CL = feedback(PID*sys,1);
% Closed-loop system

t = 0:0.01:5;
% time interval

figure(1)
step(sys);
hold on;
step(CL,t);
legend('Initial plant','Closed-loop system');
stepinfo(CL)
% plot the step response in get the information
%
%        RiseTime: 0.0883
%    SettlingTime: 0.1625
%     SettlingMin: 0.9038
%     SettlingMax: 0.9938
%       Overshoot: 0
%      Undershoot: 0
%            Peak: 0.9938
%        PeakTime: 0.2934

[R,K] = rlocus(CL);
% R complex root locations for the gains K

figure(2)
rlocusplot(CL)
pole(CL)
% root locus plot
%
%  -24.9525
%   -3.4701
%   -0.5775

Berikut adalah plot root locus dan step response.



Lihat juga tentang.
Kendali state space MATLAB.