This project proposes the Unified Power Quality Conditioner (UPQC) to mitigate the power quality problems existed in the grid and the harmonics penetrated by the non-linear loads. The UPQC is supported by the Photovoltaic (PV) and Battery Energy Storage System (BESS) in this work. Generally, the PV system supplies the active power to the load. However, if the PV is unable to supply the power then the BESS activates and provides power especially during the longer term voltage interruption. The standalone PV-UPQC system is less reliable compared to a hybrid PV-BESS system because of its instability and high environment dependency. Therefore, BESS will improve the voltage support capability continuously in the longer term, reduce the complexity of the DC-link voltage regulation algorithm, and keep producing clean energy. The phase synchronization operation of the UPQC controller is directed by a self-tuning filter (STF) integrated with the unit vector generator (UVG) technique. Implementation of STF will make sure the UPQC can successfully operate under unbalanced and distorted grid voltage conditions. Thus, the requirement of a phase-locked loop (PLL) is omitted and the STF-UVG is utilized to produce the synchronization phases for the series and shunt active power filter (APF) compensator in UPQC controller. Finally, the proposed STF-UVG method is compared with the conventional synchronous references frame (SRF-PLL) method based UPQC to show the significance of the proposed technique. Several case studies are further considered to validate the study in MATLAB-Simulink software.