How to automatically update the parameters values (basically gains) in the Simulink model each time a MATLAB script file is run calculating these gains parameters values?

2 views (last 30 days)
Dear colleagues, I have established a script file that calculates the controller gain values of 3 x 3 multivariable controller, 15 different gains have been designed for such controller. The model of the controller has been also built in the Simulink in order to simulate the controller responses of the whole system and to see whether the system under the controller is well behaved, this requires me to calibrate the 15 gains values to reach the best response and needs a lot of calibrations. The problem is that I have to enter manually to the Simulink model the new values of the gains calculated by the script file each time I calculate new gains values which takes long time and exposed to many mistakes before I finally run the Simulink model. Is there any way or procedure that I link the script file with the simulation model so that the gain values are automatically updated in the Simulink avoiding entering them manually each time I run the script file?

Answers (1)

Mandar Patwardhan
Mandar Patwardhan on 26 Jun 2017
I understand that you are using a script to manually tune the gain blocks in a Simulink model in order to calibrate and check the controller responses. This can be done by using the Gain-Scheduled PID Controllers. The following example shows how to implement gain-scheduled control in a Simulink® model using a family of PID controllers. The PID controllers are tuned for a series of steady-state operating points of the plant, which is highly nonlinear.
Another approach to tune the PID controllers in a Simulink Model programmatically is to use the slTuner interface. Refer to the following link for more information.
Last but not the least, you can consider using the systune or looptune functions to automatically tune control systems modeled in Simulink. Refer to the following link which shows the example to use these functions.
  1 Comment
Basim Touqan
Basim Touqan on 26 Jun 2017
Dear Mandar,Thank you for your answer, but the controller I am using is not PID, it is a controller for multivariable ( 3 inputs - 3 output ) system called least effort controller which is new theory, in this theory I am avoiding using integrators. In this control strategy I am using 15 different gains. Each time i use different values in the script file parameters, the resultant is 15 different values for the gains of the simulator. The problem is I have to enter them manually then run the simulation and see the new responses whether they are well behaved ones. How can I get a connection between the results in the work space so the simulator can automatically update its gains avoiding the manual update

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!