This paper presents a state of charge (SOC) based control strategy for virtual synchronous generator (VSG) when connecting to the grid. The VSG is operated in voltage source mode, the output frequency of VSG is calculated by considering the virtual inertial and the power reference together. The power reference is acquired by adding the SOC control module and the frequency control module, the proportion of each module is determined by applying a weight coefficient, if the SOC control module is in the majority, the VSG is more inclined to maintain the SOC, otherwise the VSG is more inclined to stable the frequency. Considering the dynamic response and stability of control system the select range for the weight coefficient is designed. Simulation results are presented in order to validate the proposed approach.