In the present paper, the flower pollination algorithm (FPA) is employed for tuning the controller parameters of a doubly fed induction generator (DFIG) in a wind energy system. These parameters are then compared with those generated by the genetic algorithm (GA) and the proportional-integral (PI) (initial design) controllers. Performance analysis of the DFIG is carried out in dynamic mode in two case studies. The first case study is carried out with no failure, the second one is subject to a short circuit in the electrical network. In this latter case study, a break occurs in the rotor circuit and disconnects the DFIG from the power grid. This gives rise to an excessive current in the rotor circuit which in turn influences the converters AC/DC/AC and makes the IGBT very sensitive. The GA and the FPA are used to tune the PI controllers with the purpose of improving the quality of a power supply should electrical disturbances occur. The results show that by applying an optimal PI controller design to a DFIG using the FPA the performance of the DFIG system can be improved in the event of disturbances. When the PI controller tuning using the GA and the initial control system design is compared with the DFIG using the optimized design, a significant decrease in the overshoot of the rotor current and the DC-link voltage is observed.