The LCL-type grid-connected inverters based on digital control will produce control delay which cannot be ignored, resulting in the system presents characteristics of non-minimum phase. However, the active damping methods which are used to suppress LCL resonance are influenced by control delay, the phase-frequency curve of open loop gain is greatly changed. In the weak grid with wide variation of grid impedance, the robustness of system will be seriously reduced. Starting from the characteristics of the loop open gain of the system, a method of loop lag compensation is proposed in this paper, the compensation parameters of the lag link are reasonably designed, and the robustness of the system is analyzed in detail in the weak grid. The analysis results show that this strategy can separate the frequency of damping dividing and the frequency of first loop through, and can ensure that the system well adapts the weak grid. Finally, the correctness of the theoretical analysis and the effectiveness of the strategy are verified by the simulation model.