there are two model files. one is for optimization and other is for final use after optimization. you have to run the 'Main_ImperialistCompetitveAlgorithm.m file for optimization. you also can change the range of the optimization of the parameters by changing [varmin] and [varmax] matrix in the 'Main_ImperialistCompetitveAlgorithm.m' file.
After you got the optimized value of PI parameters just put these in the 'dc_motor_speed_controller_final' model and see the speed response of the motor.There is a signal builder used as the reference speed time graph of the motor,three signals are there.the second signal is used for optimization purpose.if you want to change the reference signal for optimization then you have to change the costfunction also. the [n] matrix and [input] matrix have to be changed and also index will be changed.see the costfunction for details.the cost function is made of assemble of the total integral error,settling time,rise time,overshoot.priority are given to these parameters.like-rise time and settling time are considered as of higher priority. you can change the costfunction if needed.
Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.