Combine two controllers in ODE45 environment
Show older comments
Hi,
Please I need idea on how to implement the following problem on MATLAB.
My aim is to stabilize a plant using two dynamic controllers. Only one controller is implemented at a time. The controller to be implemented is depended on a logic variable q = 1 or q = 0.
If q = 0, controller 1 is implemented and if q = 1, controller 2 is implemented.
The controller output is given by:
u = q* K2(x) + (1 - q) * K1(x).
K1 and K2 are dynamic controllers. so they are solved using ODE45.
By default controller 1 will be triggered at the start of the program until output variable is less than 5. and the second controller is triggered.
The main challenge:
The last output of controller 1 (The output just before controller 2 is triggered) should be used as the initial condition of controller 2 when controller 2 is triggered.
6 Comments
Sam Chak
on 7 Jun 2022
"The last output of controller 1 should be used as the initial condition of controller 2 when controller 2 is triggered."
This implies that your K2 dynamic controller has function like this:
. Please clarify.
Davide Masiello
on 7 Jun 2022
It is possible to solve this using event location functions, but you need to share all the details of you problem.
Telema Harry
on 7 Jun 2022
Telema Harry
on 7 Jun 2022
Yes @Telema Harry
Thanks for clarifying the matter. I think I understand that the dynamics is something like
, where
, in order to preserve the continuity of the control action. Actually, I'm thinking, "if this is a state-space, where do I put
?"
Telema Harry
on 7 Jun 2022
Accepted Answer
More Answers (0)
Categories
Find more on State-Space Control Design in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
