Constant power operation of a PMSM drive taking into account the stator resistance and the nonlinear inductance