"step" Function Help
显示 更早的评论
I am trying to plot a step response with the "step" function. I am getting a plot, but it is not what I expected. My step response jumps up and stays flat, rather than oscillating as expected.
What am I doing wrong, and how can I change my code so it looks like the second picture I posted?? Thanks!
Code:
clear
clc
kp=10;
kd=.3;
j1=1*10^(-3);
j2=2*10^(-4);
b=5.82*10^(-3);
k=5;
num1=[j2 b k];
den1=[j1*j2 (j1+j2)*b (j1+j2)*k 0 0];
g1=tf(num1,den1);
num2=[b k];
den2=[j1*j2 (j1+j2)*b (j1+j2)*k 0 0];
g2=tf(num2,den2);
num3=[kd kp];
den3=1;
c=tf(num3,den3);
t2=g2*c/(1+g1*c);
step(t2)
1 个评论
Matt Kindig
2013-5-21
Your code gives me the desired (oscillating) image. Maybe add a 'close all' at the top of your script?
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Time-Domain Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!