Firstly introduced the p-q harmonic detecting algorithm ,A modified method of harmonic detecting is proposed,through theoretical analysis deduced the new method of the base wave voltage detection,And then let the fundamental wave voltage involved in the harmonic detecting operation process,in this way can avoid the influence of harmonic voltage to the computing result ,Finally a simulation of this new method is carried out,The simulation results shows that even in the power grid voltage imbalance or distortion,This algorithm also can accurately detect the harmonic current.the improved algorithms Make up for the deficiency of the traditional algorithm ,make the actual harmonic detection results more faster and better.