Clear Filters
Clear Filters

Need MATLAB code for tuning of multiple PI controllers in Simulink

32 views (last 30 days)
I have a complex Microgrid topology with multiple PI controllers employed for droop control and DC bus voltage control. I need a matlab code to run in order to tune the individual PI controllers present in the system using optimization algorithms (PSO,GA, DE). Steps to implement the same would be highly appreciated. I dont have transfer function based models used in the system thus, everysystem considered is to be considered as an open loop component based system (PV, BESS).
  3 Comments
Sam Chak
Sam Chak on 5 Dec 2023
Isn't it considered a good practice in engineering to first comprehend the desired behavior of a system through nominal mathematical modeling and analysis, and subsequently assemble the components in accordance with specifications (such as saturation limits, rates of change, etc.) that may yield the desired behavior?
I find it perplexing to consider randomly selecting components for constructing a complex Microgrid without a thorough grasp of the mathematical models that describe each component of the Microgrid system. Could this not lead to a potential disaster when the switch is flipped?
For instance, when aspiring to build a supercar capable of reaching a top speed of 300 mph within a minute, it seems imperative to identify an engine that can feasibly generate the required horsepower for achieving the desired top speed. This requires a mathematical modeling of the engine's performance attributes.
Sam Chak
Sam Chak on 5 Dec 2023
Moreover, the process of tuning a controller with the aid of a model is generally acknowledged as being more straightforward to implement compared to tuning a controller in the absence of a model. If, indeed, acquiring the mathematical model poses a genuine challenge, one may resort to techniques such as Model-Free Adaptive Control (MFAC), Iterative Learning Control (ILC), and the contemporary Reinforcement Learning Control (RLC).

Sign in to comment.

Answers (1)

Arkadiy Turevskiy
Arkadiy Turevskiy on 11 Jan 2024
Edited: Arkadiy Turevskiy on 11 Jan 2024
There are a couple of options you could explore.
  1. Tune each inidividual PI controller. You can use closed-loop PID autotuner blockfor this. Theblock will automatically compute system frequency response at a few frequency points and will use that to come up with PI gains. The downside of this approach is that it tunes one PI controller at a time, so if they are coupled, tuning might be tricky.
  2. Another approach is to use optimization methods as you mentioned. For this, you can try Response Optimizer app in Simulink Design Optimization. Specify design requirements for your system response, specify PI gains to tune, and leave it to optimization agorithm to try to tune your gains. Please check out examples here, and documentation here.
HTH
  1 Comment
Jordan Olson
Jordan Olson on 11 Jan 2024
Edited: Jordan Olson on 11 Jan 2024
@Sarthak Mohanty Another option is to use a reinforcement learning agent as the "optimizer" to tune the gains of your controllers. We have an example that shows how you can do this: Tune PI Controller Using Reinforcement Learning

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!