Photovoltaic (PV) systems are crucial to the production of electricity for a newly established community in Egypt, especially in grid-tied systems. Power quality (PQ) issues appear as a result of PV connection with the power grid (PG). PQ problems cause the PG to experience faults and harmonics, which affect consumers. A series compensator dynamic voltage restorer (DVR) is the most affordable option for resolving the abovementioned PQ problems. To address PQ difficulties, this paper describes a grid-tied PV combined with a DVR that uses a rotating dq reference frame (dqRF) controller. The main goal of this study is to apply and construct an effective PI controller for a DVR to mitigate PQ problems. The artificial rabbits optimization (ARO) is used to obtain the best tune of the PI controller. The obtained results are compared with five optimization techniques (L-SHADE, CMAES, WOA, PSO, and GWO) to show its impact and effectiveness. Additionally, Lyapunov’s function is used to analyze and evaluate the proposed controller stability. Also, a mathematical analysis of the investigated PV, boost converter, and rotating dqRF control is performed. Two fault test scenarios are examined to confirm the efficacy of the suggested control approach. The parameters’ (voltage, current, and power) waveforms for the suggested system are improved, and the system is kept running continuously under fault periods, which improves the performance of the system. Moreover, the findings demonstrate that the presented design successfully keeps the voltage at the required level with low THD% values at the load side according to the IEEE standards and displays a clear enhancement in voltage waveforms. The MATLAB/SIMULINK software is used to confirm the proposed system’s performance.