This paper proposes a power system network modeled using a microgrid, integrated with wind and solar photovoltaic (PV) resources, along with the battery energy storage system (BESS) connected to the three-phase grid feeding the linear and nonlinear load. The simulation is carried out with unit vector and instantaneous reactive power control algorithm for series and shunt active power filter respectively. The power quality improvement is analyzed for the voltage sag, swell, and harmonics for system with load variation and without load variation. The performance analysis is based on voltage & current THD, voltage & current RMS, and power and power factor analysis. The THD for comparison is represented in form of bar chart to show the effective performance of control algorithm proposed using PWM method and hysteresis controller.