With the continuous development of microgrid, the inverter under traditional PID control is difficult to meet the power quality requirements of microgrid. In order to improve the anti-interference ability and transient response speed of the output voltage of Isolated AC microgrid inverter, a dynamic compensation control structure combining linear quadratic optimal control and disturbance residual generator is proposed in this paper. Firstly, the quadratic optimal controller is established based on the inverter model. Secondly, the residual generator is established to observe the residual value of the disturbed system. Then, the dynamic compensation controller is designed according to the superposition principle, and a control signal opposite to the influence caused by the disturbance is output at the output of the controller. The disturbance signals can cancel each other without knowing the specific disturbance form. Finally, the experiments of load switching, three-phase imbalance and nonlinear load are designed on MATLAB/Simulink simulation software to verify the effectiveness of the control strategy proposed in this paper.