Online MTPA Operation of IPMSM Based on Dual-Loop Control in Polar Coordinates