Highly distorted waveforms cause the phase lag detection logic to break down. (Specifically, there's a solution discontinuity when peaks switch from local maxima to global maxima.) That makes the back-emf lag goal seek fail to converge.
The "proper" solution is to find the "fundamental sine wave" component of the current waveform prior to finding the peak to determine phase lag.
Highly distorted waveforms cause the phase lag detection logic to break down. (Specifically, there's a solution discontinuity when peaks switch from local maxima to global maxima.) That makes the back-emf lag goal seek fail to converge.
The "proper" solution is to find the "fundamental sine wave" component of the current waveform prior to finding the peak to determine phase lag.