The nature and behavior of capacitors, transformers, inductors, active compensators, and non-linear loads can produce power resonance. Unfortunately, the presence of a resonance phenomenon can have a negative impact on system stability and lead to catastrophic power system failures. Therefore, even when using modern or conventional techniques to enhance total harmonic distortion (THD) or improve input power factor (IPF), it is necessary to avoid resonance. An active power compensation circuit (APCC) is proposed and designed to function with two categories of linear/non-linear loads. The APCC has been implemented and regulated using an adjusted pulse width modulation technique. The aim of the suggested APCC is to minimize AC side distortions, improve the IPF, and mitigate harmonics resonance at the same time. The simulation results demonstrate that the proposed APCC investigates the aim function of this study by absorbing harmonics, correcting IPF, and eliminating resonance problems under both transient and steady-state operating conditions. The supply voltage and current THD values for the first power circuit type are reduced by 96.7 % and 96.3 %, respectively, at α=30°. Meanwhile, for the second power circuit, the THD is reduced by 91.92 % and 90.4 %. Also, the IPF changed for the first and second power circuits from 0.72 and 0.86 to almost unity. These results demonstrated the effective performance of the APCC circuit and controller in reducing power harmonics, eliminating power resonance, and modifying power factors.