Simulink中的三阶速率限制器?如何产生平滑的触发信号? [英] 3rd-order rate limiter in Simulink? How to generate smooth triggered signals?

查看:246
本文介绍了Simulink中的三阶速率限制器?如何产生平滑的触发信号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,对于那些不熟悉Simulink的人,有一个可以想象的外部-Simulink部分解决方案:

我需要创建一个满足以下条件的向量:

I need to create a vector satisfying the following conditions:

  • 已知初始值a1
  • 已知最终值a2
  • 它具有预定义的步长,但长度未预先确定
  • 整个范围内的一阶导数限于v_max. -v_max
  • 整个范围内的二阶导数限制为a_max. -a_max
  • 在整个范围内,
  • 三阶导数仅限于j_max. -j_max
  • 在第一和最后一点,所有导数均为.
  • known initial value a1
  • known final value a2
  • it has a pre-defined step size, but the length is not pre-determined
  • the first derivative over the whole range is limited to v_max resp. -v_max
  • the second derivative over the whole range is limited to a_max resp. -a_max
  • the third derivative over the whole range is limited to j_max resp. -j_max
  • at the first and the final point all derivatives are zero.

在您问到目前为止您尝试过什么"之前,我只是想在Simulink之外解决它,因此我尝试了下面的全部内容;) 但是,也许你们有个好主意,而我继续致力于自己的解决方案.

Before you ask "what have you tried so far", I just had the idea to solve it outside Simulink and I tried the whole stuff below ;) But maybe you guys have a good idea, while I keep working on my own solution.

我想基于Simulink中的触发信号生成平滑的斜坡信号(三阶导数限制).

I'd like to generate smooth ramp signals (3rd derivative limited) based on a trigger signal in Simulink.

要获得触发步骤,我创建了一个触发子系统,用于传播触发输出.看起来像这样:

To get a triggered step I created a triggered subsystem propagating the trigger output. It looks like that:

但是我实际上不希望迈出一步,我需要一个非常平滑的斜坡,并使用有限的导数直到3阶.后面的数学是:

But I actually don't want a step, I need a very smooth ramp with limited derivatives up to the 3rd order. The math behind is:

displacement: x
speed: v = x'
acceleration: a = v' = x''
jerk: j = a' = v'' = x'''

(如果您对此很熟悉,我曾经有一个非常

(If this looks familiar to you, I once had a very similar question. I thought about a bounty on it, but after the necessary edit of the question both answers would have been invalid)

由于只有一阶速率限制器,因此我使用了两个导数和一个双重积分来解决我的问题.但是市长有一个缺点,我不能再忽略了.为了便于说明,我选择了一个较大的步长0.1.

As there are just rate limiters of 1st order, I used two derivates and a double integration to resolve my problem. But there is a mayor drawback, I can not ignore anymore. For the sake of illustration I chose a relatively big step size of 0.1.

完整的最小示例(固定步骤,步骤大小:0.1,ode4): 在此处下载

可以看出,信号甚至没有达到预期的步长10,而且最终还不是恒定的.

在我整个模型的开发过程中,这种方法足以满足小步长的需要.但是我到达了真正需要按预期进行平滑过渡的地步.这意味着我需要一个最终恒定的信号,其信号的精确度由步长增益指定.

Over the development process of my whole model, this approach was satisfactory enough for small step sizes. But I reached the point where I really need the smooth ramp as intended. That means I need a finally constant signal at exactly the value, specified by the step height gain.

我已经花了几天时间解决问题,希望现在能在这里得到一些帮助.

I already spent days to resolve the problem, and hope to fine some help here now.

我的一些想法:

    动态地将阶跃高度增加到实际期望值之上,并使最终输出饱和.如果速率限制,步长和模拟步长不够灵活,则可能会找到令人满意的解决方案.但是由于一切都必须灵活,所以在太多情况下会违反加速度和加速度限制.
  • 我尝试使用Matlab function块并编写了自己的三阶速率限制器.尽管对于触发时刻而言,这对我来说似乎是可能的,但我没有解决如何在斜坡结束时使减速度"平滑的问题.另外,我还需要C编译器,这将使得很难在没有问题的其他系统上使用我的模型. (至少我是这样认为的.)
  • dynamically increase the step height over the actual desired value and saturate the final output. If the rate limits,step height and the simulation step size wouldn't be flexible one could probably find a satisfying solution. But as everything has to be flexible, there are too much cases where the acceleration and jerk limit is violated.
  • I tried to use the Matlab function block and write my own 3rd order rate limiter. Though it seems possible for me for the trigger moment, I have no solution how to smooth the "deceleration" at the end of the ramp. Also I'd need C-compilers, which would make it hard to use my model on other systems without problems. (At least I think so.)

求解器不能进行重大更改(ode3或ode4),并且固定步长是必需的(0.00001至0.01).

当前使用的,不是真正有用的方法:

对于> 1.07 ,我得到以下输出(所有值均在其极限值处进行了归一化): 尽管位移看起来不错,但是违反加速度限制是非常有害的.

For a dynamic amplification of 1.07 I get the following output (all values normalised on their limits): Though the displacement looks nice, the violation of the acceleration limit is very harmful.

对于 1.05 dynamic amplification,我得到以下输出(所有值均在其限制范围内标准化): 加速度保持在其边界内,但位移未达到预期值. (图片中不清楚)混蛋仍然很大. (我可以忍受,但这不是很好)

For a dynamic amplification of 1.05 I get the following output (all values normalised on their limits): The acceleration stays in its boundaries, but the displacement does not reach the intended value. (not really clear in the picture) The jerk is still to big. (I could live with that, but it's not nice)

因此,在我看来,Simulink内部解决方案离现实还很遥远.有什么想法如何创建行为良好的自定义功能块吗?

在开始模拟之前就已经知道了模拟步长,步长和速率限制. (但是我连续有很多这样的触发平滑斜坡,它应该提供事件离散控件).因此,我可以想象在simulink外部创建整个平滑斜坡并将其保存为timeseries对象,并在触发被激活时将其附加到当前信号上.

Simulation step size, step height, and the rate limits are known before the simulation starts. (But I have a lot of these triggered smooth ramps in a row, it should feed a event-discrete control). So I could imagine to create the whole smooth ramp outside simulink and save it as a timeseries object and append it on the current signal when the trigger is activated.

推荐答案

您看到的问题是因为差异没有很好地解决. 求差会放大模拟中存在的数值.

The problems you see are because the difference is not conditioned very well. Taking the difference amplifies the numerical that exists in your simulation.

如果您尝试应用实际步骤,则混响也总是很大. 我猜对于您的方法,最好以其他方式解决: 即通过加速,加速和速度来实现您的目标.

Also the jerk will always be large if you try to apply an actual step. I guess for your approach it would be better to work the other way around: i.e. make a jerk, acceleration and velocity with which your step is achieved.

我认为您正在寻找类似ref3块的内容: http://www.dct.tue.nl/home_of_ref3.htm 请注意网站上的免责声明,使用起来有点麻烦.

I think your looking for something like the ref3 block: http://www.dct.tue.nl/home_of_ref3.htm Note the disclaimer on the site and that it is a little cumbersome to use.

这篇关于Simulink中的三阶速率限制器?如何产生平滑的触发信号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆