Simulink Limit Integral Saturation Limit Dynamic Input

10 views (last 30 days)
Hello.
I would like to find out if there is a way to use a variable input computed within a given Simulink session as a limit integral saturation limit in the Simulink integrator block. The limit integral block parameters allows entering a variable name or a constant. The block entry can import a vector present on the workstpace, though it's not capable of reading a variable that is dynamically being computed at the same simulation execution frame as the limit integrator.
I have tried to incorporate a unit delay or memory block in the integrator input to delay the integrator and allow the computed limit integral saturation variable to be computed prior being read by the integrator block. Unfortunately the integrator fails to execute unless the saturation variable has been already computed and available in the workspace.
I'd appreciate it if someone can assist me with this issue.
Thanks! Nima

Accepted Answer

Kaustubha Govind
Kaustubha Govind on 14 Jun 2012
As you have found out, the Limited Integrator block from the Simulink Library only takes the saturation limits as a parameter, and not as an input signal. I would recommend that you read this blog post to understand why you cannot change the saturation limit parameter based on the output of another block.
However, it should be reasonable straightforward to create your own custom block using S-functions to do what you need. There is an existing S-function block demo that you can modify to achieve what you need. Please type "msfcndemo_limintm" at the MATLAB prompt to open up the demo. Now, double click on the blue box in the model to see the MATLAB code corresponding to the S-function. You simply need to increase the number of inputs to 3, and use the inputs instead of the parameters for limits in the Derivative method.
  2 Comments
Nima Forghani
Nima Forghani on 14 Jun 2012
Thank you so so much Kuastubha!
The customized S-function works for passing through in-session variables to the integrator as limit inputs.
cheers
Nima
Ankur
Ankur on 10 Aug 2024
Hello Nima,
Can you please let me know how using Level 2 M Function you moditied integrator saturation limits during simulation?

Sign in to comment.

More Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!