You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the "AccelStepper" library can be improved. This one accumulates in time a software error. It can be interesting to mathematically integrate this one. Where the "AccelStepper" lib makes
unsigned long time = micros();
if (time - _lastStepTime >= _stepInterval)
{
if (_direction == DIRECTION_CW)
{
_currentPos += 1;
}
else
{
_currentPos -= 1;
}
step(_currentPos);
_lastStepTime = time;
return true;
}
I had coded a version with this fix, my lib is much less complete than AccelStepper but takes into account the software error. As a comparison in my lib I did like this . "this->m_ei" is integrate error
We have analyzed the code and you are right, there is definitely an error which stacks with each step because the _lastStepTime is based on the current time instead on the interval and the runSpeed() function is not called on each microsecond.
We are moving away from AccelStepper dependency meanwhile because it is not performant enough and has several issues. Also the linked PR was not merged by that library meaning it is not supported enough.
the "AccelStepper" library can be improved. This one accumulates in time a software error. It can be interesting to mathematically integrate this one. Where the "AccelStepper" lib makes
I had coded a version with this fix, my lib is much less complete than AccelStepper but takes into account the software error. As a comparison in my lib I did like this . "this->m_ei" is integrate error
The text was updated successfully, but these errors were encountered: