SimPower Systems and Stateflow

3 views (last 30 days)
Wayne
Wayne on 9 Sep 2013
Answered: Joel Van Sickel on 1 Dec 2020
Greetings,
I am having an issue with Stateflow that has me completely baffled, and I suspect it is related to SimPower Systems.
I have an abc-to-dq SimPowerSystems block - that is feeding a f(u) block, which takes the RMS value. The equation in the f(u) block is sqrt(u(1)^2+u(2)^2)/sqrt(2). That (double) output is being fed into a stateflow block, which does some calculations and changes states based on that value being over a threshold for a certain amount of time. I have that same output feeding a standard scope. The output on the scope looks normal - it fluctuates between .49 and .51. When I view it in Stateflow, it tracks normally, but then for one brief moment the value skyrockets to 193919841805095.500000. Since the Simulink scope reads the data fine but Stateflow does not, this makes me think there is a data type miscommunication. I have tried using standard math blocks instead of the f(u), and I get the same issue (though it is a smaller number, around 8 instead of 1.9 gigazillion). I've tried using a convert block (to double), but that doesn't help.
Any insight here would be appreciated, becasue I am stumped ..

Answers (1)

Joel Van Sickel
Joel Van Sickel on 1 Dec 2020
The data type will not be randomly changing. There is potentially a bug in the stateflow model or the f(u) block that is hitting overlow or something else.
This answer is part of a MATLAB Answers cleanup effort for unanswered questions that are outstanding.

Categories

Find more on Complex Logic in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!