Analytical design of flux-weakening voltage regulation loop in IPMSM drives