声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 1283|回复: 0

[综合讨论] 怎么用step把2个系统的阶跃信号联系起来?

[复制链接]
发表于 2007-7-13 12:54 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
下面是STEP的帮助说明:
step response of LTI system

Syntax
step(sys)
step(sys,t)
step(sys1,sys2,...,sysN)
step(sys1,sys2,...,sysN,t)
step(sys1,'PlotStyle1',...,sysN,'PlotStyleN')
[y,t,x] = step(sys)


Description

step calculates the unit step response of a linear system. Zero initial state is assumed in the state-space case. When invoked with no output arguments, this function plots the step response on the screen.
step(sys) plots the step response of an arbitrary LTI model sys. This model can be continuous or discrete, and SISO or MIMO. The step response of multi-input systems is the collection of step responses for each input channel. The duration of simulation is determined automatically based on the system poles and zeros.
step(sys,t) sets the simulation horizon explicitly. You can specify either a final time t = Tfinal (in seconds), or a vector of evenly spaced time samples of the form
t = 0:dt:Tfinal

For discrete systems, the spacing dt should match the sample period. For continuous systems, dt becomes the sample time of the discretized simulation model (see "Algorithm"), so make sure to choose dt small enough to capture transient phenomena.
To plot the step responses of several LTI models sys1,..., sysN on a single figure, use
step(sys1,sys2,...,sysN)
step(sys1,sys2,...,sysN,t)

All systems must have the same number of inputs and outputs but may otherwise be a mix of continuous- and discrete-time systems. This syntax is useful to compare the step responses of multiple systems.
You can also specify a distinctive color, linestyle, and/or marker for each system. For example,
step(sys1,'y:',sys2,'g--')

plots the step response of sys1 with a dotted yellow line and the step response of sys2 with a green dashed line.
When invoked with output arguments,
[y,t] = step(sys)
[y,t,x] = step(sys)        % for state-space models only
y = step(sys,t)

return the output response y, the time vector t used for simulation, and the state trajectories x (for state-space models only). No plot is drawn on the screen. For single-input systems, y has as many rows as time samples (length of t), and as many columns as outputs. In the multi-input case, the step responses of each input channel are stacked up along the third dimension of y. The dimensions of y are then
1.jpg
and y(:,:,j) gives the response to a unit step command injected in the jth input channel. Similarly, the dimensions of x are
2.jpg





我设计的系统在内环有个阶跃干扰。
我是先求的不加干扰时的输出:
内环设计(不加干扰时)
g1=tf(0.01,[0.005 0.06 0.1001]); %电机传递函数
>> g2=tf([50 300],1);%PD控制器
>> g3=tf(1,[1 0]);%积分环节
>> g4=tf(15000,[1 70 2500]); %机械系统传递函数
>> g5=feedback(g1*g2,1);%内环闭环传递函数(不加干扰时)
>> g6=g5*g3*g4;%外环开环传递函数(不加干扰时)
>> g7=feedback(g6,1);%外环闭环传递函数(不加干扰时)
>> step(g7)
>> bode(g6)
>> margin(g6)


在设计只有干扰时的

内环设计(单独加干扰时)
g1=tf(0.01,[0.005 0.06 0.1001]); %电机传递函数
g2=tf([50 300],1); %PD控制器
g3=tf(1,[1 0]); %积分环节
g4=tf(15000,[1 70 2500]); %机械系统传递函数
g5=feedback(g1,g2); %内环闭环传递函数(单独加干扰时)
g6=g5*g3*g4; %外环开环传递函数(单独加干扰时)
g7=feedback(g6,g2); %外环闭环传递函数(单独加干扰时)
step(g7)
bode(g6)
margin(g6)




现在的问题时,我要将这2部分叠加起来。用STEP这个函数。
不知道怎么做?
回复
分享到:

使用道具 举报

您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-12-12 08:35 , Processed in 0.069617 second(s), 22 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表