Failure analysis of AC motor drives via FPGA-based hardware-in-the-loop simulations