Why temporal logic is ignored in my Stateflow chart?

조회 수: 6 (최근 30일)
Zoi Blatsi
Zoi Blatsi 2016년 10월 31일
답변: Shivang Menon 2016년 11월 3일
In my Stateflow chart, there is a subchart which I would like to check for changes every 0.2 seconds. I have implemented it with a self-transition [after(0.2,sec)]. Instead, the check is done at every time step, which means that my system doesn't have the time to settle, and is therefore unstable.
Should I implement it elsehow?

답변 (1개)

Shivang Menon
Shivang Menon 2016년 11월 3일
The stateflow chart (and as a result, the subchart) will execute at every time step. If the time step is less than 0.2 sec, and if the subchart is active, then it will be checked at every time step instead of when "after" is true. You need to transition out of the chart if you want the "after" command to take precedence. Consider the chart below:
Assuming the time step to be 0.1, The simulink engine enters the subchart at time 0, but transitions to the "state that does nothing" at time 0.1. So, if you want the subchart to be checked every 0.2 seconds, you need to change the transition from the state to the subchart to transition after 0.1 sec (instead of 0.2).
Hope this helps !

카테고리

Help CenterFile Exchange에서 Decision Logic에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by