Stateflow controller guard conditions
Ältere Kommentare anzeigen
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!
Antworten (1)
Fangjun Jiang
am 5 Dez. 2011
0 Stimmen
"[0<Driver_Torque_Request<=0.7]" is not a valid condition. It should be "[0<Driver_Torque_Request && Driver_Torque_Request<=0.7]"
Kategorien
Mehr zu Stateflow finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!