Real-time digital simulation and experimental verification of a D-STATCOM interfaced with a digital controller