Method for determining the position and/or speed of a rotor of an electric machine by means of a position sensor for sensing a position of said rotor, said position sensor generating a cosinusoidal signal and a sinusoidal signal, implementing - a closed loop comprising a harmonics state observer, - a correction (CORΦ) of a phase shift of said cosinusoidal and sinusoidal generated signals, - a first phase-locked loop, - said harmonics state observer relating said cosinusoidal and sinusoidal generated signals and a value of said rotor position (θ obs) estimated by said first phase-locked loop with said harmonics, - said correction (CORΦ) of a phase shift identifying and correcting the phase shift of said cosinusoidal and sinusoidal generated signals by means of said harmonics determined by said harmonics state observer, - said first phase-locked loop estimating the position and/or speed of said rotor based on said corrected cosinusoidal and sinusoidal signals, characterized in that the determining method implements a second phase-locked loop, - said second phase-locked loop determining said position and/or speed of said rotor by carrying out the following steps: a) the harmonics of said cosinusoidal and sinusoidal generated signals are determined by means of said harmonics state observer of said closed loop comprising said harmonics state observer, said correction (CORΦ) of said phase shift of said cosinusoidal and sinusoidal generated signals, and said first phase-locked loop; b) it is determined whether said harmonics state observer is converging; c) said cosinusoidal and sinusoidal generated signals are continuously corrected (CORH) by updating said determined harmonics when said harmonics state observer is converging; and d) said position and/or speed of said rotor is determined by means of the second phase-locked loop based on said corrected cosinusoidal and sinusoidal signals. - a closed loop comprising a harmonics state observer, - a correction (CORΦ) of a phase shift of said cosinusoidal and sinusoidal generated signals, - a first phase-locked loop, - said harmonics state observer relating said cosinusoidal and sinusoidal generated signals and a value of said rotor position (θ obs) estimated by said first phase-locked loop with said harmonics, - said correction (CORΦ) of a phase shift identifying and correcting the phase shift of said cosinusoidal and sinusoidal generated signals by means of said harmonics determined by said harmonics state observer, - said first phase-locked loop estimating the position and/or speed of said rotor based on said corrected cosinusoidal and sinusoidal signals, characterized in that the determining method implements a second phase-locked loop, - said second phase-locked loop determining said position and/or speed of said rotor by carrying out the following steps: a) the harmonics of said cosinusoidal and sinusoidal generated signals are determined by means of said harmonics state observer of said closed loop comprising said harmonics state observer, said correction (CORΦ) of said phase shift of said cosinusoidal and sinusoidal generated signals, and said first phase-locked loop; b) it is determined whether said harmonics state observer is converging; c) said cosinusoidal and sinusoidal generated signals are continuously corrected (CORH) by updating said determined harmonics when said harmonics state observer is converging; and d) said position and/or speed of said rotor is determined by means of the second phase-locked loop based on said corrected cosinusoidal and sinusoidal signals. a) the harmonics of said cosinusoidal and sinusoidal generated signals are determined by means of said harmonics state observer of said closed loop comprising said harmonics state observer, said correction (CORΦ) of said phase shift of said cosinusoidal and sinusoidal generated signals, and said first phase-locked loop; b) it is determined whether said harmonics state observer is converging; c) said cosinusoidal and sinusoidal generated signals are continuously corrected (CORH) by updating said determined harmonics when said harmonics state observer is converging; and d) said position and/or speed of said rotor is determined by means of the second phase-locked loop based on said corrected cosinusoidal and sinusoidal signals.