Inifite simulation stop time / Scope problems

Dear Sir / Madam,
I am using a Stateflow in Matlab simulink to determine whether a controller subsystem is enabled or disabled. Therefore, I have the simulation model stop time set to 'infinite' which also requires a variable step time.
The problem here that when I plot a value from the subsystem (cylinder displacement) into a simulink scope, the x-axis shows inrealistic time values of around 300 * 10^5 seconds.
What I actually would want to accomplish is an inifite stop time, but with realistic (RealTime) time values.
Is this possible?
Thanks in advance

답변 (1개)

Toshinobu Shintai
Toshinobu Shintai 2019년 5월 23일

0 개 추천

Dear Mathieu Risseeuw.
I still don't understand fully what is the problem for you, but
is the "simulation pacing" solve your problem?
If the scope of the model actually shows inrealistic value, please report as a bug.
(For example, real time step is 4.01s, but scope time step is 50700s.)
Thank you.

댓글 수: 5

Mathieu Risseeuw
Mathieu Risseeuw 2019년 5월 23일
편집: Mathieu Risseeuw 2019년 5월 23일
Dear Toshinobu Shintai,
Thanks for the reply. The pacing does not solve the problem (because I have the 2017b release which doesnt include the pacing option (yet)). I think it has to do with this fact:
When I run the simulation (inf.) only the stateflow runs idle. Only when I press a certain button, a subsystem (trigger block) is triggered and a control loop starts. When the required value is obtained, the subsystem is untriggered and the controllloop stops.
Then when I stop the simulation, and I open the triggerblock and plot the scope of the controller, the profile looks good, but the time is like 10*10^5 seconds. However, when I run this same controller in a different Simulink model (without trigger block and stateflow) the time is like 0.1 seconds.
It might have something to do with the infinite stoptime and triggered subsystem.
Thanks in advance.
Mathieu Risseeuw
Additional:
I fixed it, with the pace block in the aerospace blockset. Thank you so much.
Mathieu Risseeuw
Now I see your problem.
Because the Simulink time step is absolute,
you cannot change local block time from the base of Simulink.
If you use "To Workspace" block, you can log data exactly when the enabled(triggered) subsystem worked.
But it doesn't contain the local time step.
Please refer to the attached file.
Thank you.
Sorry for delaying my answer.
I'm glad that you solve the problem.
Thank you so much for your time. Have a nice day

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Simulink Functions에 대해 자세히 알아보기

제품

질문:

2019년 5월 22일

댓글:

2019년 5월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by