step response but wrong answer from matlab!

조회 수: 4 (최근 30일)
Mohammadreza
Mohammadreza 2024년 2월 11일
답변: Star Strider 2024년 2월 11일
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)))
FPIDT1 = 8.016e-05 s^2 + 0.01608 s + 8 ----------------------------- 2e-08 s^2 + 1e-05 s Continuous-time transfer function.
% 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');

답변 (1개)

Star Strider
Star Strider 2024년 2월 11일
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)))
FPIDT1 = 8.016e-05 s^2 + 0.01608 s + 8 ----------------------------- 2e-08 s^2 + 1e-05 s Continuous-time transfer function.
% 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.
.

카테고리

Help CenterFile Exchange에서 Get Started with Control System Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by