In wind energy conversion system (WECS) at wind speed above rated, the pitch angle is controlled to keep the generated output fixed so also the speed and the frequency. The model is built as a discrete model of WECS connected to Grid including a Line to Ground (LG) fault in Grid. A Proportional-Integral (PI) controller with gain K p and K i is used in pitch angle control loop. The proportional gain K p and integral gain K i are tuned through Particle Swarm Optimization (PSO) and Pattern Search (PS) algorithms. A comparison of two different objective functions with its weight adjustment is presented. The performances of the algorithms in designing the optimal controller are compared. The analysis indicates the superiority of PSO over PS and takes less time to achieve the minimum error criteria. The controller designed using PSO minimizing the proposed objective function has better settling time as regards wind turbine speed response, compared to the other. The control action is validated in real time using OPAL-RT taking different cases of random wind speed, gust and gust with random wind speed and Line to Ground fault.