Voltage-related power quality issues, including voltage sag, swell, and total harmonic distortion (THD), have become a significant concern in recent times. These issues, particularly harmonics, are known to degrade utility performance and lifespan, necessitating urgent rectification to ensure a high-quality power supply. This is crucial as our generation increasingly depends on electricity for enhanced living standards. Flexible AC transmission system (FACTS) devices are gaining considerable interest as effective solutions to these problems. Among these, the dynamic voltage restorer (DVR) is particularly noteworthy for its potential to reduce power quality disturbances in the distribution network. In this study, we developed a DVR based on an artificial neural network (ANN) controller. The activation function employed was Train LM for the input and hidden layers, and pure linear for the output layer, with the Levenberg Marquardt back propagation (LMBP) serving as the training algorithm. The designed model was then tested to tackle voltage-related power quality problems in the distribution network of Jamal Din Wala (JDW) sugar mills. The comprehensive model featured a three-phase voltage source inverter, a scheme utilizing rotating reference frame theory, and sine pulse width modulation (SPWM) for voltage sag and swell sensing along with insulated gate bipolar transistor (IGBT) switching. We analyzed three types of DVR output defects using MATLAB/Simulink and compared the results of the ANN controller with those of a conventional PI controller. The DVR output was modeled in MATLAB/Simulink for three types of defects and two degrees of voltage sag and swell. The results demonstrated that the DVR effectively mitigated voltage sags and swells in the JDW sugar mills distribution network. Furthermore, during the validation of the proposed ANN, a comparison of results with the conventional PI controller under balanced and unbalanced sags and swells showed a significant improvement. The ANN achieved a voltage restoration of up to 99.8% and a total harmonic distortion of 13.5%, a marked improvement over the PI controller, which achieved 97% voltage restoration and 19.5% total harmonic distortion, respectively.