A self-compensating control strategy for harmonic parameters based on the crown porcupine optimization algorithm is proposed for the single-phase rectifier and two-phase inverter operation mode of the bidirectional converter. In order to improve the response speed of the inverter voltage, the instantaneous expressions of the phase angle coefficient and amplitude coefficient of the dc-side voltage doubling fluctuation are derived, and the third harmonic is calculated based on the crown porcupine optimization algorithm according to the Proportional Integral (PI) + Quasi-Proportional Resonance (QPR) double closed-loop control method and injected into the input voltage of the inverter side to offset the influence of the bus-doubling fluctuation on the output voltage of the two-phase inverters of B and C so that the total harmonic content of the two-phase output voltages of the two-phase inverters of B and C can be reduced. The total harmonic content of the B and C inverter output voltages is reduced. The effective control of the control method for single-phase rectifier two-phase inverter mode is verified through simulation. Finally, the effectiveness of the control strategy is verified by experimenting with a 15 kW LCL-type bi-directional converter prototype.