Electric power consistency is one of the essential variables in the social and economic growth of a smart city. In contrast, innovative energy sources and intelligent electricity networks are the primary components in making a city smart. This study describes an artificial neural network (ANN)- based controller for increasing power supply consistency by employing a dynamic voltage restorer. The optimisation approach particle swarm optimisation (PSO) is also discussed in this work, used to compute the maximum power point tracking (MPPT) of wind/photovoltaic hybrid power systems. The proposed PSO and ANN techniques can detect load, wind velocity, and solar irradiation fluctuations to optimise generating device power output, allowing hybrid power systems to function steadily, safely, and economically. This paper predicts and compares results with two cases using PSO and ANN to show the greater robustness and comparability of microgrid hybrid energies, namely photovoltaic and wind power. The simulation results show that the ANN-based controller with the PSO technique gives better performance as compared to the fuzzy controller. Further, the simulation results show that the converter can follow the hybrid system's maximum power point.