A novel technique for MTPA/MTPF control of interior permanent magnet synconous machine and its extension to simultaneous rotor power extraction