Enhanced Control Algorithms In Permanent Magnet Synchronous Machines