Automatic MTPA Tracking in IPMSM Drives: Loop Dynamics, Design and Auto-Tuning