The power quality (PQ) has been significantly affected by the integration of intermittent non-conventional sources (NCS) into the local distribution system in addition to the adoption of power electronic technologies to regulate non-linear loads. This article combines the H-bridge cascade five-level unified power quality conditioner (5L-UPQC) with the wind power generation system (WPGS), solar photovoltaic power generation system (SPVGS), and battery storage system (BSS) as an effective approach to address PQ problems. The utilization of the Levenberg–Marquardt backpropagation (LMBP)-trained Artificial neural network controller (ANNC) in the UPQC is recommended for generating appropriate reference signals for the converters. This eliminates the requirement for conventional complex conversions, such as abc, dq0, and αβ. Moreover, the artificial neuro-fuzzy interface system (ANFIS) is recommended for achieving a DC-link balance. Football game optimization (FBGO) is utilized to determine the optimal shunt and series filter characteristics. The major objectives of the proposed system are to reduce the current waveform irregularities, resulting in a decrease in the total harmonic distortion (THD), an enhancement in the power factor (PF), the mitigation of supply voltage imbalances and disturbances, and the maintenance of a steady direct-current link capacitor voltage (DLCV), despite the variations in the load, solar irradiation, and wind velocity. The efficiency of the suggested strategy is assessed using four case studies that involve different loads, variable wind velocities, and source voltage balancing conditions. Based on the simulation studies and obtained results, the suggested method significantly decreases the THD to values of 2.91%, 3.63%, 3.75%, and 3.50%. Additionally, it achieves a power factor of unity, which is considerably lower compared to other multilevel schemes that use the traditional symmetrical reference frame (SRF) and instantaneous reactive power (pq) methods. This design has been executed using the MATLAB/Simulink program.