Catatan singkat Daily Life of Engineering Student tentang control loop di MATLAB. Berikut ini adalah script MATLAB untuk merancang controller berdasarkan 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')
%% 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 adalah step response dari plant dan closed-loop.
Lihat juga tentang.
Kendali state space MATLAB.
- State space controlability and observability.
- State space to transfer function.
- Pole-placement.
- Linear-Quadratic Regulator.
- Bode plot diagram state space.