"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!