How to use rate limiter with square signal and variable step size?
조회 수: 8 (최근 30일)
이전 댓글 표시
Hi
Here's a screenshot of the model I'd like to set up.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/154010/image.png)
.
I feed a customized rectangular signal to a rate limiter to avoid vertical slopes. The input signal is basically like this:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/154012/image.png)
.
Unfortunately that doesn't seem to work. I'm using ode15s, it's a requirement. Here's the error message Simulink throws:
Error: Input signals to Rate Limiter '.../Rate Limiter' are neither discrete nor continuous sample time signals. Only discrete or continuous input signals are supported
Quite surprisingly I found a workaroud by adding an integrator directly followed by a derivative. This works:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/154013/image.png)
.
But it's ugly and I'm getting some very annoying stability issues in some cases. And I doubt very much that it is considered "good practice".
So how is one supposed to use this rate limiter block in such a situation?
.
John
댓글 수: 0
채택된 답변
Fernando
2014년 8월 5일
Hi John,
The problem you have is all about sample times, and sample times propagation. In your first example, there is probably no definition of sample time in any block, so that in the sample time propagation phase Simulink cannot determine the appropriate sample time for the block.
The workaround works because you've inserted an integrator, which has a defined continuous sample time. This is then back-propagated to the rate limiter block and to other blocks.
The easiest way to solve the problem in your first implementation is to select Sample time mode: continuous in the Rate Limiter Dialog Box.
댓글 수: 0
추가 답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Sources에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!