A method implemented in a speed controller to detect a loss of one phase, two phases or three phases in a three-phase permanent-magnet synchronous motor, running or stopped at rest, said controller executing a control in closed loop operation, said method comprising:
- determining, with the speed controller, a reference flux current as a function of a reference torque current, said reference torque current being calculated from a reference speed applied to the motor and a measurement of the speed or the position carried out on the motor;
- applying, with the speed controller, the reference flux current to inject currents over various phases of the motor wherein the reference flux current is decremented according to a control ramp until its value is zero;
- and
- measuring, with the speed controller, the currents over at least two phases and determining the loss of one phase, of two phases or of three phases from these measured currents.