"step" Function Help
11 ビュー (過去 30 日間)
古いコメントを表示
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 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!