This paper proposes a speed control of switched reluctance motor supplied by photovoltaic system. The proposed design of the speed controller is formulated as an optimization problem. Ant colony optimization (ACO) algorithm is employed to search for the optimal proportional integral (PI) parameters of the proposed controller by minimizing the time domain objective function. The behavior of the proposed ACO has been estimated with the behavior of genetic algorithm (GA) in order to prove the superior efficiency of the proposed ACO in tuning PI controller over GA. Also, the behavior of the proposed controller has been estimated with respect to the change of load torque, variable reference speed, ambient temperature and radiation. Simulation results confirm the better behavior of the optimized PI controller based on ACO compared with optimized PI controller based on GA over a wide range of operating conditions.List of symbols N r and N s Number of rotor and stator poles, respectively qNumber of phases C rThe commutation ratio b s and b r The stator and rotor pole arc, respectively I and VModule output current and voltage I c and V c Cell output current and voltage I ph and V ph