In order to constantly improve the output characteristics of wind turbines, the HIL (Hardware In the Loop) experimental platform of wind turbines is built to optimize control. According to the product parameters of 1.5 MW direct-drive PMSG (Permanent Magnet Synchronous wind Generator) of Dongfang Electric Corporation (DEC), the simulation model of wind turbine is built in RTDS (Real Time Digital Simulator), and optimised by comparing with the wind speed-power curve of products, the simulation model of wind turbine with engineering accuracy can be obtained. Base on the engineering model and actual controller of products, the HIL experimental platform of wind turbines is built to optimise control. In the case of unbalanced or asymmetrical grid voltage, in order to make the wind turbine output be stable, the DDSOGI-PLL (direct Decoupling Double Second-Order Generalized Integral Phase-Locked Loop) is proposed to improve the performance of PLL, the active/reactive current decoupling algorithm based on positive and negative sequence voltage orientation respectively is proposed to eliminate the negative sequence current to maintain a constant output power. The effectiveness of algorithm is verified by the HIL experimental platform, the active power output of wind turbine remains constant, the grid-connected adaptability of wind turbines is improved significantly.