Tuning PI controller from Simulink model with an m-file

3 次查看(过去 30 天)
I have a simulink model which simulates the behavior and control of a process. I built a script to change an run the model to evaluate different scenarios and settings. Since different scenarios would require different settings for the optimal controller, I want to tune it from the m-file. I would like to mimic the tuning of the block if you doubleclick on the block and press the 'Tune...' button (because I assume that is how it should be tuned).
This is what I do:
io(1)=linio('model/controlleroutput',1,'input');
io(2)=linio('model/processoutput',1,'openoutput');
linsys = linearize('model',io);
pi = pidtune(linsys,'PI');
That is, I linearize the process I want to control and use that to tune the PI controller. However, I get a different result if I click on the 'Tune...' button. Hence, I'm doing something different.
Can someone tell me what part of the model I should linearize to do what the 'Tune...' button does? As you can read, I'm not really used to the field of control, and the only understanding of 'tuning' that I have is that it sounds reasonable to understand the dynamic behavior of the process before setting the PI settings. But I've no idea what I should linearize to tune it correctly. In my system I have a combination of feedback and feedforward.
Kind regards, Jos
  1 个评论
Jos
Jos 2013-11-15
I found the solution: io(1) should be set to the controller output and io(2) to the controller input (that is, to the output of the block that gives the input to the controller). Now I should try to understand how the linearization exactly works, to see whether it makes sense to tune it in this way.
Regards, Jos

请先登录,再进行评论。

采纳的回答

Arkadiy Turevskiy
Arkadiy Turevskiy 2013-11-19
You are correct, PID Tuner linearizes the model from PID controller output to PID controller input. This is explained in the doc here.

更多回答(0 个)

Community Treasure Hunt

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

Start Hunting!

Translated by