rcarlyle / StepperSim

Simulates stepper motor driver systems
MIT License
100 stars 11 forks source link

Model stops working at high speeds due to waveform distortion #11

Open rcarlyle opened 9 years ago

rcarlyle commented 9 years ago

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.