Stator fault detection for multi-phase machines with multiple reference frames transformation