Title: Analysis of a motor-generator system containing a speed loop, current limit loop, and position control loop