Skip to content
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

fix(stacker): motor movement profile step detection #499

Open
wants to merge 4 commits into
base: edge
Choose a base branch
from

Conversation

ahiuchingau
Copy link
Contributor

This PR adds a test for the movement profile used in the Flex Stacker and fixes a motion bug.

I found a delay in motion control; when the motor speed is set to take exactly one step each time the motor timer ticks, the first tick wouldn't cause a step. It's because the bitwise comparison doesn't work very well while we're at the step boundary.

By setting the step flag to (static_cast<uint64_t>(1) << radix) - 1;, we can make sure we're taking a step right when it happens.

The longer I look at this math, the more confused I get. So apologies in advance if none of this makes sense.

Copy link
Member

@sfoster1 sfoster1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh that's a great idea, nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants