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

Motor direction reverse not working: solution #3

Open
lazyan opened this issue Nov 2, 2020 · 2 comments
Open

Motor direction reverse not working: solution #3

lazyan opened this issue Nov 2, 2020 · 2 comments

Comments

@lazyan
Copy link
Contributor

lazyan commented Nov 2, 2020

Tried this version of firmware and found motor reverse direction setting isn't working at all.
But it's easy to make it work, Just add this line in stepper.c (after line "st.step_outbits = 0;"):

st.exec_block->direction_bits = st.exec_block->direction_bits ^ dir_port_invert_mask;

It also reasonable to comment these lines as they are not used:
...
DIRECTION_PORT = (DIRECTION_PORT & ~DIRECTION_MASK) | (st.dir_outbits & DIRECTION_MASK);
...
st.dir_outbits = st.exec_block->direction_bits ^ dir_port_invert_mask;
...
DIRECTION_PORT = (DIRECTION_PORT & ~DIRECTION_MASK) | dir_port_invert_mask;

@melyux
Copy link

melyux commented Oct 15, 2021

So this reverses every single motor's direction?

@GernotA
Copy link

GernotA commented Nov 3, 2022

I just tested the original firmware and it worked without any issues - eg $3=2 inverts Y -axis

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

No branches or pull requests

3 participants