An intelligent control strategy is proposed in this paper which suggests the Optimum Power Quality Enhancement (OPQE) of grid-connected hybrid power systems with solar photovoltaic, wind turbines, and battery storage. Unified Power Quality Conditioner with Active and Reactive power (UPQC-PQ) is designed with Atom Search Optimization (ASO) based Fractional-order Proportional Integral Derivative (FOPID) controller in the proposed Hybrid Renewable Energy Sources (HRES) system. The main aim is to regulate voltage while reducing power loss and reducing Total Harmonic Distortion (THD). UPQC-PQ is used to mitigate the Power Quality (PQ) problems such as sag, swell, interruptions, real power, reactive power and THD reductions related to voltage /current by using ASO based FOPID controller. The developed technique is demonstrated in various modes: simultaneous to improve PQ reinforcement and RES power injection, PRES > 0, PRES = 0. The results are then compared to those obtained using previous literature methods such as PI controller, GSA, BBO, GWO, ESA, RFA, and GA and found the proposed approach is efficient. The MATLAB/Simulink work framework is used to create the model.