How can I use a triggered subsystem in a loop?

35 views (last 30 days)
In order to simulate a tracking problem for two robots with event-triggered control I think I need to use a Triggered Subsystem. Actually, the problem is that the trigger for the Subsystem depends on the output of the Triggered Subsystem. If I want to simulate the model it gives a loop error.
It is not possible for me to use the Latch option, otherwise the model isn't appropriate anymore. Also it is not possible to put a unit delay in the model, because otherwise the controlling of the robots is executed a step to late.
I tried some things with the option 'state output' of the integrator block to avoid loop errors, but then there is the problem that everytime the trigger occurs the sample of the state has to be kept constant until the next trigger occurs.
Are there any alternatives to deal with this situation?

Answers (2)

Azzi Abdelmalek
Azzi Abdelmalek on 2 Dec 2012
Edited: Azzi Abdelmalek on 2 Dec 2012
You said that the trigger for the Subsystem depends on the output of the Triggered Subsystem, which requires a unit delay block. Your subsystem can't do two calculus at the same step. When your subsystem calculate an output, this one will be a trigger for your subsystem which will calculate another output, if there is no any block with memory, can you tell Matlab, what is the beginning and the end of calculation? If there is any, it should be precised with for example a unit delay block
  2 Comments
Ahmed Fahmy
Ahmed Fahmy on 8 Nov 2021
I am having a similar problem. and despite having the memory element inside the triggered subsytem the issue remains there. From HW or logical point of view, the loop is broken, however Simulink is still bothered with the loop around the triggered subsystem.

Sign in to comment.


Erick Wang
Erick Wang on 9 Sep 2017
Hello, perhaps, you can use a Function-call to trigger a subsystem.

Categories

Find more on Schedule Model Components in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!