-
Notifications
You must be signed in to change notification settings - Fork 228
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
A4988, SyncDriver, not turning CCW #53
Comments
same issue for me |
I see that you are using SyncDriver. I would suggest to try and isolate the problem by running just one of the steppers individually:
The first thing that came to mind though, is a possible wiring issue. If there is a strong pull-up (or short) somewhere, the pin won't be able to go down to 0V. This is easy to check if you either run without wiring connected or if you try a simple sketch to set the pin to LOW and see what happens. |
So after some more testing, it looks like SyncDriver has an issue when using acceleration; I do not recommend using it in combination with LINEAR_SPEED. The estimation of time to complete the move is most likely broken because of the integer math. I plan to address it after #40 For now you can either use MultiDriver (which will result in one motor finishing sooner than the other, but you can use acceleration) or SyncDriver with CONSTANT_SPEED mode (which will sync the motors but won't work with high-load or high speeds). |
I think I found the problem. In the BasicStepperDriver.cpp, line 114.
So when you pass a native
Here you added
Changing code like this did the trick, but I am not sure if it will cause any other problems. So far I tested on the DRV8825 and it works fine. |
Nice find. I think you actually found a new issue (the initial move works fine but altering course has the bug). I think alterMove() should only accept changes in the direction that it's going anyway. Thanks for the PR, I'll take a look at it later. |
The fix may have to be more subtle: alterMove() was intended to add/remove steps in the current direction. So if you original move is -500 and you call alterMove(100), it would be like having called move(-600). This is not what should happen when you call move(100) - I think the expectation is that the value gets combined with the original so in effect you would have move(-400). So in that case passing the same steps value from move to alterMove is indeed incorrect... |
Oh so you didn't design alterMove() for being able to change the direction in the middle of one operation? |
And also there is another issue in SyncDriver. It called startMove twice in one action, which doubled the movement. I commited the change along with the fix to issue #53. |
I was also facing the same issue with the sync driver. After applying the fix @laurb9 #53 by @POPOBE97 , I get to move the motors with acceleration .
Here when this code One more thing i noticed that when i turn off acceleration profile by executing this code
(not included in above code) please look into it. |
The acceleration profile is disabled by simply not calling I suspect constant speed won't work well with #65 because |
As @POPOBE97 observed, SyncDriver calls `startMove()` twice and the second call is interpreted as a request to alter course which breaks both positive and negative movements in different ways.
I think the revert above should resolve this issue. |
Hi,
I am facing the issue that the stepmotor is not turning CCW, when using negative values in SyncDriver.controller.rotate/move. When measuring the DIR pin of the motor, the pin is not set to 0V.
Anyone who also faced the same issue?
Regards,
Sybren
The text was updated successfully, but these errors were encountered: