This article <span>addresses a variety of power quality concerns, including voltage sag and swell, surges, harmonics, and so on, utilizing a dynamic voltage restorer (DVR). The proposed controller for DVR is proportional plus integral (PI) controller. Two methods are used for tuning the parameters of PI controller, trial and error and intelligent optimal method. The utilized optimal method is particle swarm optimization (PSO) method. Results depicted that DVR using PI controller tuned by PSO has improved performance than PI controller tuned by trial and error in term of rise time, maximum overshoot and settling time, as well as total harmonic distortion (THD). These improvements are applicable for voltage sag and swell conditions.</span>