Why temporal logic is ignored in my Stateflow chart?
4 次查看(过去 30 天)
显示 更早的评论
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?
0 个评论
回答(1 个)
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 !
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!