Stateflow controller guard conditions

I'm attempting to build a simulink model of a hybrid electric drivetrain for a college course. I was wondering, when creating the guards for transitions between different states in a stateflow controller, what's the proper way to define a range of values for which you want the transition to happen?
For example, I want to transition from state 1 to state 2 if the variable Driver_Torque_Request falls between 0 and 0.7. I wrote the guard as such: [0<Driver_Torque_Request<=0.7], but I get unexpected behavior from the controller, eg constant looping between states 1 and 2 despite the fact that Driver_Torque_Request stays constant at zero.
I've also tried several permutations of the guard but haven't had any luck. Any ideas what might be the problem? I appreciate any guidance. Project due this Thursday!

回答 (1 件)

Fangjun Jiang
Fangjun Jiang 2011 年 12 月 5 日

0 投票

"[0<Driver_Torque_Request<=0.7]" is not a valid condition. It should be "[0<Driver_Torque_Request && Driver_Torque_Request<=0.7]"

カテゴリ

ヘルプ センター および File ExchangeStateflow についてさらに検索

製品

質問済み:

2011 年 12 月 4 日

Community Treasure Hunt

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

Start Hunting!

Translated by