-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using setSpeed() quickly while the stepper is moving causes position loss/incorrect position #24
Comments
Thanks for the bug report. I have added a similar test case in StepperDemo as number 06 in the master branch. Need to find the root cause, still. |
Looks like there are no steps lost, just it runs to the wrong position. If executing 't M1 06 R' on esp32, then the position after the test is @-5746. Still wondering about the root cause. |
Please check version 0.16.4 in your setup. In my test looks fine. |
It looks like 0.16.4 has fixed it, great work! |
This issue seems to be back with 0.16.5, the position gets wrong with my test code again. On 0.16.4 it keeps the position correctly. |
Right. It's annoying to have a regression in the avr code. Now I have set up a new type of test for avr using simavr. For example executing test sequence 01 from StepperDemo yields not enough steps produced. Same behaviour as on the real HW. Hopefully this way, I have a good basis to make regression tests on something close to real hw. |
I have found a situation in the avr interrupt code, which could lead to lost steps. My test executed under simavr contains the sequence with varying speed. Expectation is to watch the requested amount of L->H-transitions. Locally this is checked. Hope that github actions goes through smoothly, too. |
Tested on 0.16.8, position is kept correctly |
(I am using a TTGO T-Display ESP32 and a TMC5160 SilentStepStick v1.5)
Below is the relevant code that triggers the issue; it just moves the stepper back and forth between 0 and a set position "StepsToNext" when I have a button pressed (the code is in the main loop). When "UseSpeedSwitcher" is on, it changes the speed every 100 milliseconds which causes the position loss. When the speed isn't changed, the stepper returns to the correct position each time.
The text was updated successfully, but these errors were encountered: