필터 지우기
필터 지우기

Disturbance Rejection with PID turner

조회 수: 1 (최근 30일)
Esin Derin
Esin Derin 2022년 6월 25일
댓글: Esin Derin 2022년 6월 25일
I'm trying to do a disturbance rejection with PID tuner.I'm trying to do it but it keeps giving error.Could you help me?
G=tf([1],[0.1 1]);
G.InputName='yzad';
G.Output='ys';
yzad={1,10,100}
K={-100,-10,1,5,3}
Sum=sumbkl('++','yzad','ys')
ISAPID=connect('-100','Sum','G')
tf(ISAPID)
You can find my diagram attached .Thanks

채택된 답변

Sam Chak
Sam Chak 2022년 6월 25일
For simplicity, you can do something straightforward and plot the time responses like this.
Case 1a: , rad/s
% sin(omega*t) = sin((2π*Freq)*t) = sin((2π/τ)*t)
omega = 1; % angular frequency {1, 10, 100} rad/s
tau = 2*pi/omega; % time period of a wave
Tf = 2*tau; % wave duration of Tf seconds
[u, t] = gensig("sine", tau, Tf); % generates a signal where t runs from 0 to Tf seconds
G = tf(1, [0.1 1]); % plant transfer function
K = -100; % feedback gain {-100, -10, -1, 5, 3}
H = -K;
Gcl = feedback(G, H) % closed-loop system subjected to a disturbance Y(s)/D(s)
Gcl = 1 ----------- 0.1 s + 101 Continuous-time transfer function.
lsim(Gcl, u, t)
grid on
Case 1b: , rad/s
% sin(omega*t) = sin((2π*Freq)*t) = sin((2π/τ)*t)
omega = 10; % angular frequency {1, 10, 100} rad/s
tau = 2*pi/omega; % time period of a wave
Tf = 2*tau; % wave duration of Tf seconds
[u, t] = gensig("sine", tau, Tf); % generates a signal where t runs from 0 to Tf seconds
G = tf(1, [0.1 1]); % plant transfer function
K = -100; % feedback gain {-100, -10, -1, 5, 3}
H = -K;
Gcl = feedback(G, H) % closed-loop system subjected to a disturbance Y(s)/D(s)
Gcl = 1 ----------- 0.1 s + 101 Continuous-time transfer function.
lsim(Gcl, u, t)
grid on
Case 1c: , rad/s
% sin(omega*t) = sin((2π*Freq)*t) = sin((2π/τ)*t)
omega = 100; % angular frequency {1, 10, 100} rad/s
tau = 2*pi/omega; % time period of a wave
Tf = 2*tau; % wave duration of Tf seconds
[u, t] = gensig("sine", tau, Tf); % generates a signal where t runs from 0 to Tf seconds
G = tf(1, [0.1 1]); % plant transfer function
K = -100; % feedback gain {-100, -10, -1, 5, 3}
H = -K;
Gcl = feedback(G, H) % closed-loop system subjected to a disturbance Y(s)/D(s)
Gcl = 1 ----------- 0.1 s + 101 Continuous-time transfer function.
lsim(Gcl, u, t)
grid on
Case 2a: , rad/s
% sin(omega*t) = sin((2π*Freq)*t) = sin((2π/τ)*t)
omega = 1; % angular frequency {1, 10, 100} rad/s
tau = 2*pi/omega; % time period of a wave
Tf = 2*tau; % wave duration of Tf seconds
[u, t] = gensig("sine", tau, Tf); % generates a signal where t runs from 0 to Tf seconds
G = tf(1, [0.1 1]); % plant transfer function
K = -10; % feedback gain {-100, -10, -1, 5, 3}
H = -K;
Gcl = feedback(G, H) % closed-loop system subjected to a disturbance Y(s)/D(s)
Gcl = 1 ---------- 0.1 s + 11 Continuous-time transfer function.
lsim(Gcl, u, t)
grid on

추가 답변 (0개)

카테고리

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