step response but wrong answer from matlab!
4 views (last 30 days)
Show older comments
I just copy matlab code of step response of PIDT1 from "https://wiki.ibkastl.de/view/PIDT1-Glied" but the anser is completely defferent in compare of expected! Just look at the attached photo, you understand it?

% Transfer Function: FPIDT1 (First-Order PD Controller in Discrete-Time)
Kp = 8;
Tv = 1e-5;
Tn = 1e-5;
T1 = 2e-3;
s = tf('s');
FPIDT1 = Kp * (1 + (1 / (Tn * s)) + ((Tv + s) / (1 + T1 * s)))
% Plot Bode, Step, and Impulse Responses for FPIDT1
figure;
subplot(3, 1, 1);
bode(FPIDT1);
title('Bode Plot - FPIDT1');
subplot(3, 1, 2);
step(FPIDT1);
title('Step Response - FPIDT1');
subplot(3, 1, 3);
impulse(FPIDT1);
title('Impulse Response - FPIDT1');
0 Comments
Answers (1)
Star Strider
on 11 Feb 2024
f you plot the step respoonse on the same time scale, the MATLAB plot is the same.
See the added fourth subplot —
% Transfer Function: FPIDT1 (First-Order PD Controller in Discrete-Time)
Kp = 8;
Tv = 1e-5;
Tn = 1e-5;
T1 = 2e-3;
s = tf('s');
FPIDT1 = Kp * (1 + (1 / (Tn * s)) + ((Tv + s) / (1 + T1 * s)))
% Plot Bode, Step, and Impulse Responses for FPIDT1
figure;
subplot(4, 1, 1);
bode(FPIDT1);
title('Bode Plot - FPIDT1');
subplot(4, 1, 2);
step(FPIDT1);
title('Step Response - FPIDT1');
subplot(4, 1, 3);
impulse(FPIDT1);
title('Impulse Response - FPIDT1');
subplot(4, 1, 4);
step(FPIDT1);
xlim([0 0.02])
title('Step Response - FPIDT1 - Zoomed Time Range (0 \rightarrow 0.02 s)');
It could be seen even more easily if plotted in its own figure.
.
0 Comments
See Also
Categories
Find more on Get Started with Control System Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
