TGit-Tech / GRBL-28byj-48

Grbl ver 1.1f.20170131 with XYZ Unipolar Stepper Support (28byj-48)
Other
89 stars 44 forks source link

Motor direction reverse not working: solution #3

Open lazyan opened 3 years ago

lazyan commented 3 years ago

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 commented 2 years ago

So this reverses every single motor's direction?

GernotA commented 1 year ago

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