Based on the traditional ip-iq harmonic detection theory, the accuracy of harmonic detection is easily affected by the phase-locked loop (PLL) output phase error, and the single low-pass filter (LPF) detection accuracy and filtering effect cannot be simultaneously. In this paper, an improved harmonic detection method based on the second-order generalized integrator-frequency locked loop (SOGI-FLL) technique is proposed to generate sine and cosine signals with the same frequency as the grid voltage; The traditional low-pass filter and average filter are used in series to improve the response speed and accuracy. Through theoretical analysis of the improved harmonic detection method and simulation in MATLAB environment, the theory and simulation results prove the effectiveness of the improved method.