Power quality challenges arise when photovoltaic (PV) systems are integrated into power networks. This research work examines the control and mathematical design of an LCL-SR (series resistance) filter for power quality improvement in PV-based sustainable energy systems to meet this difficulty. Power quality may be improved via an LCL filter in grid-connected systems. A non-linear load-connected PV system incorporates a variety of power electronics controllers, including an MPPT controller, battery controller, and inverter current controller, which introduce harmonics into the grid. A passive filter, LCL-SR, is suggested for PV applications that interact with voltage source inverters and the utility grid or electric load to reduce harmonics. A detailed mathematical modeling is presented to design an LCL-SR filter, and its performance is evaluated under different load conditions in terms of THD (Total Harmonics Distortion) and efficiency. LCL-SR filter has 4.32% THD but in the case of LCL filter with parallel R is less THD, which is 3.61%. In terms of efficiency and THD LCL-SR is best among all compared filters which have THD is 4.32% along with an efficiency is 75.95%. The results are compared without a filter, and different configurations of LCL-SR are simulated to show the effectiveness of the proposed filter for PV & residential applications.