Disturbance Rejection with PID turner

1 次查看(过去 30 天)
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