Simulink controlling problem, i want to make a action that conteracts the logic that triggers the action.

조회 수: 2 (최근 30일)
Hello,
I need some help with an issue in Simulink, it requires a bit of explanation:
I am doing a project where i am using Simulink in collabroation with another program to run some co-simulation. The run time of the simulation is e.g. 10 seconds with a 0.1 second step. I have built a control system in simulink which activates a given maneuver if certian conditions are met. An example could be:
If X is < -10 add 1 to X.
Now, the issue i have is i want to keep adding the 1 to X in let us say the next 10 steps, even though the conditions are not met (X is not < - 10 anymore) the next time the loop is run. Meaning that after the conditions are met, the logic (if X is < -10 add 1 to X) is ignored and the action is repeated 10 times (10 steps).
I know that the action conteracts the logic that triggers the action and i am wondering if this is even possible?
Hope the issue is clear and that you can help.
Best regards Sam
  댓글 수: 1
Sam
Sam 2013년 4월 19일
Hmm, is there really no one who has an idea if this is possible? I would think this is done often in controls, but i'm not sure.
Is the question not elaborated enough?
Thanks, Sam

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

답변 (2개)

Kaustubha Govind
Kaustubha Govind 2013년 4월 22일
I think this should be possible. How about you use an Enabled Subsystem containing a Counter that outputs "true" for exactly 9 time-steps after it is enabled. The Counter's states must be reset when the subsystem is disabled. The control signal to the enabled subsystem should be an OR condition of (X<-10) and the output of the Counter. The same control signal can also be used in an "if-else" type construct (you could use a Switch block for this) to figure out whether to output (X) or (X+1).

Sysenso Systems
Sysenso Systems 2013년 4월 22일
The simple solution is modifying the condition itself. For you example : If X is < (-10+10) add 1 to X. The same is applicable for your controller model.
If you don't want to modify the condition and you want the co-simulation continue to run, then you might have to change the simulation speed of your model.

카테고리

Help CenterFile Exchange에서 Simulink에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by