The invention discloses an electric car power-
grid voltage compensation method based on a
virtual synchronous generator algorithm, and the method comprises the following steps: 1), employing the
virtual synchronous generator algorithm for an electric car grid-connected interface, and carrying out the droop control based on P-f and Q-V; 2), obtaining the output frequency w and
phase angle theta of the grid-connected interface through simulating a
mechanical equation of a synchronous generator; 3), employing a
voltage and current double-closed-
loop control strategy based on the dp coordinate
system for an electrical equation part; 4), adding
virtual impedance control at the electrical equation part, wherein the
virtual impedance comprises constant
virtual impedance and transient virtual resistance; obtaining virtual
voltage drop, and taking a
voltage instruction E obtained at step 1) as a voltage ring d-axis instruction ed, wherein eq is equal to zero; respectively calculating the differences between the ed and eq and the virtual voltage drops vvd and vvq, and obtaining a voltage ring output voltage instruction (shown in the description); 5), obtaining a dq-axis modulation
signal of the grid-connected interface through the output of a current ring at step 3), and obtaining a switching
control signal of a converter switching network through coordinate conversion and PWM, so as to drive a switching network.