In this paper, a three wire DVR has been implemented using control algorithm based on amplitude adaptive notch filter for mitigation of voltage based power quality problems. The compensation of voltage sag, voltage swell, distortions, and imbalance imposed in the supply voltage due to various reasons is carried out using this series connected devices. The amplitude adaptive notch filter(AANF) offers advantages in extracting components like frequency, angle, and sequence components with very simple and fast responding synchronization scheme. It does not require any phase locked loop(PLL) for estimating phase angle or frequency of input signals. The fundamental positive sequence components(FPSCs) embedded in the measured signals is separated using the control algorithm and then utilized in estimation of three phase reference load voltage. The optimization approach for tuning the PI controller’s gains is proposed in the developed control algorithm. That is nature inspired whale optimization algorithm(WOA) has been used due to its competitiveness compared to conventional optimization algorithm. The WOA provides the appropriate values of proportional integration(PI) controller’s gains within less time as compared to manual tuning of PI controller. The simulation and test performance are discussed to validate the proposed control algorithm in non-ideal AC mains.