Self-Adaptation of MTPA tracking controller for IPMSM and SynRM drives based on on-line estimation of loop gain