Simulink - How do I introduce a slow-to-fast rate transition block without delay?
25 次查看(过去 30 天)
显示 更早的评论
I would like to use a slow-to-fast rate transition block (or some equivalent) without introducing a unit delay in the resulting signal.
(Say, for example, I have a signal with sample time Ts1. I want a block with a much shorter sample time Ts2 to be able to utilize this signal at all times - so, the input to this 2nd block would look something like a step function.)
How might this be possible?
0 个评论
回答(1 个)
Mahesh Pai
2016-10-27
It is my understanding that you would like to know how to introduce a slow-to-fast rate transition block without delay.
The Rate-Transition block has three modes of operation:
1)Protected/Deterministic(default)
2)Protected/Nondeterministic
3)Unprotected/Nondeterministic
Please see the attached model "testRateTransition.slx" that demonstrates 6 possible cases: 3 modes of Rate Transition block for two kinds of transitions (slow-to-fast and fast-to-slow). If you simulate this model, and observe the waveforms along with the information in the above documentation, it should be clear how various modes introduce different values of latency.
The only way to have a slow-to-fast transition using a Rate Transition block without introducing any delay is to set the block in the 'Unprotected/non-deterministic' mode and set the "Tasking mode for periodic sample times" parameter on the 'Configuration Parameters > Solver' pane to 'SingleTasking'.
Please see the attached model "testRateTransition_singleTasking.slx" which has the above setting. If you simulate this model, you can see that the third signal on the "Scope 1" block no longer has the delay of 0.01 s (sample time of the faster task).
There are two execution modes for a fixed-step Simulink model: single-tasking and multitasking. These modes are available only for fixed-step solvers. To select an execution mode, use the "Tasking mode for periodic sample times" menu on the 'Solver' pane of the 'Configuration Parameters' dialog box. By default, the 'Auto' mode applies multitasking execution for a multirate model.
In multitasking execution, the faster task always executes before the slower task. The "Scope" block is at a faster rate, so it can see the result of the slower task only after one step of the faster task. In 'SingleTasking' mode, the slower task executes first, so its result is ready when the faster task executes at the same step.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Schedule Model Components 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!