Kamis, 02 Agustus 2018

Matlab: Control Loop

Catatan singkat perihal control loop di MATLAB. Berikut ini yaitu script MATLAB untuk merancang controller menurut kondisi loop yang diinginkan, loop shaping.

clear all, close all, clc;

%% The transfer function

P = tf([1],[1 0 2 5])
% the plant
% P =
%         1
%   -------------
%   s^3 + 2 s + 5

pole(P)

desiredLoop = tf([10],[1 0])
% desired loop
%   10
%   --
%   s

K = desiredLoop/P
% Gain
% K =
%
%   10 s^3 + 20 s + 50
%   ------------------
%           s

%% Closed-loop system

CL = feedback(series(K,P),1)

t = 0:0.01:5;

step(P,t), grid
hold on;
step(CL,t)
legend('Plant', 'Closed-loop system')

Berikut ini yaitu step response dari plant dan closed-loop.

Lihat juga tentang.
Kendali state space MATLAB.

Sumber http://lang8088.blogspot.com


EmoticonEmoticon