You can use the Simulink Control Design PID Tuner to tune PID gains automatically in a Simulink model ...
www.mathworks.com