Due to the use of nonlinear high-power power electronic equipment such as frequency converter, the harmonic content of marine electric propulsion system is higher. In order to ensure the APF works normally under the condition of three-phase unbalance, grid distortion or harmonic pollution, PLL with high performance needs to detect the phase and frequency of the positive sequence component of the voltage base frequency of the power grid quickly and accurately. Traditional p-q and ip-iq detection algorithms based on instantaneous reactive power theory, The harmonic suppression ability of PLL based on synchronous reference frame (SFR-PLL) is poor, which can not meet the requirements. A software phase locked loop algorithm with double generalized second order integrators (DSOGI-PLL) is proposed. The simulation results show that the method can avoid the influence of negative sequence component in voltage and has strong tracking effect on harmonic detection.