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

3 views (last 30 days)
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 Comment
Sam
Sam on 19 Apr 2013
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

Sign in to comment.

Answers (2)

Kaustubha Govind
Kaustubha Govind on 22 Apr 2013
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 on 22 Apr 2013
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.

Categories

Find more on Verification, Validation, and Test in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!