"step" Function Help

조회 수: 11 (최근 30일)
Robert
Robert 2013년 5월 21일
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.
Here is what I am supposed to be getting: http://imageshack.us/a/img843/2634/14005675.png
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
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!

Translated by