A general and accurate measurement procedure for the detection of power losses variations in permanent magnet synchronous motor drives