Hi,
It is possible to auto-tune the gains in a Simulink model to have the output match the desired output, for a PD (Proportional-Derivative) control system. You can use the Control System Toolbox or the PID auto tuner app to auto-tune the gains of the PD controller by setting the Integral gain to zero.
But for matrix gains, you need to use a custom script that uses optimization to minimise the error between the actual and the desired output. Your objective function can calculate the output for a given set of gain values and measure the deviation from the desired output. This approach allows for more flexibility, for tuning matrix gains element-wise.
- Define your cost function to evaluate the performance of the PD controller for a set of (K_p) and (K_v) values.
- Use optimization functions to find the gain values that minimize your cost function.
In this way you can auto-tune the matrix gains of the PD controller.You can refer the below link for more information on PID auto tuner