Adaptive Flux-Weakening Controller for IPMSM Drives