代码之家  ›  专栏  ›  技术社区  ›  CroCo

使用Simulink和tf()对同一系统的不同结果

  •  1
  • CroCo  · 技术社区  · 6 年前

    看看下面这个简单的系统

    enter image description here

    金伯利进程 =7130和 杜兰特 =59.3880. 这些值的设计应确保系统的超调量为20%,稳态误差小于0.01。Simulink模型得到了正确的结果 tf() 不。这就是模型

    enter image description here

    结果是

    enter image description here

    现在实施相同的系统 tf 具体如下:

    clear all
    clc
    kp=7130;
    kd=59.3880;
    num=[kd kp];
    den=[1 18+kd 72+kp];
    F=tf(num,den);
    step(F)
    stepinfo(F)
    

    产生不同的超调量。

    enter image description here

    tf() ?

    1 回复  |  直到 6 年前
        1
  •  1
  •   Matteo Ragni    6 年前

    错误是考虑到Simulink实现的正确响应。 step 给你正确的回答。

    纯导数 [kd, kp] [1] 作为分母你会得到一个错误。

    ,具有可变步长的行为 is quite uncertain, and should be avoided . 用控制器得到的闭环系统有一个相对阶(1个零,2个极点)。

    dy/dt = 0 对于 t = 0 这在这种闭环系统中是不可能的。正确的回答是 tf dy/dt > 0 对于 t=0 ).

    命令。

    enter image description here

    在图像中,我们有三个测试:

    • 解析传递函数
    • 导数的近似
    • 带导数块的模拟

    0.001 在特遣部队 s / (0.001 s + 1) ,你会看到,如果你把系数减小到0,那么 转移Fnc2 最后,Simulink中的解析传递函数给出了相同的响应

    在评论中,你说你评估了逆拉普拉斯,所以让我们也检查逆拉普拉斯。符号工具箱将为我们做到这一点:

    syms s kp kd t
    
    Plant = 1/(s^2 + 18 * s + 72)
    Reg = kp + kd * s
    
    L = Plant * Reg
    ClosedLoop = simplify(L / (1 + L))
    Step = 1/s
    
    ResponseStep = simplify(ilaplace(ClosedLoop * Step))
    
    ResponseStep_f = matlabFunction(simplify( ...
      subs( ...
        subs(ResponseStep, kp, 7130), kd, 59.3880)));
    
    t_ = linspace(0, 0.15, 200);
    y_ = arrayfun(t_closedLoop_d, t_);
    plot(t_, y_);
    

    enter image description here

    如你所见,逆拉普拉斯显示了超过25%的超调。

    this link

    enter image description here

    同样,超调率为25.9%