Vector control of ac machines