Why temporal logic is ignored in my Stateflow chart?

2 ビュー (過去 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 Center および File ExchangeComplex Logic についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by