As the penetration of distributed generators like wind turbines increasing, more and more negative influences are reflected on power systems such as the balance of reactive power, the voltage quality and voltage stability. In order to improve the power system stability and voltage quality, energy storage system is valued more and more. In this paper virtual synchronous generator (VSG) control method used in the energy storage system is proposed. The proposed method, which includes the electrical part, the excitation part and the mechanical part of the synchronous generator, makes the convertor imitate a synchronous generator’s behavior. In the paper, the P-Q closed loops are respectively added to the virtual stator current control, and the convertor’s output current references can be obtained. The active power and reactive power can be controlled independently by using the PQ closed loop control. At last, a simulation model built in MATLAB/Simulink and the simulation results are presented to verify this control method. The effect of the PQ closed loop control will be shown as well. Finally, the VSG method is verified to improve the system’s stability.