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

Good Sensorless axis is homed twice if homing_positive_dir is False #85

Closed
nielsvz opened this issue Nov 4, 2023 · 3 comments
Closed

Comments

@nielsvz
Copy link
Contributor

nielsvz commented Nov 4, 2023

Using the new sensorless feature I noticed that the Y axis of my K3 is homed twice, likely because homing_positive_dir is False and the distance moved is negative.

Original code - homing.py:

if hi.retract_dist:
needs_rehome = False
if any([dist < hi.retract_dist for dist in homing_axis_distances]):
needs_rehome = True

Adding some additional logging to the code:

# X
homing_axis_distances: [69.30625]
hi.retract_dist: 40.0
needs rehome: False
# Y
homing_axis_distances: [-94.00625000000001]
hi.retract_dist: 40.0
needs rehome: True
# Z
homing_axis_distances: [-8.01625]
hi.retract_dist: 0.0

If I convert the dist variable to an absolute value it works as expected (axis is homed only once):

if any([abs(dist) < hi.retract_dist for dist in homing_axis_distances]): 

Homing the axis with the absolute value:

# X
homing_axis_distances: [69.30625]
hi.retract_dist: 40.0
needs rehome: False
# Y
homing_axis_distances: [-92.80312500000001]
hi.retract_dist: 40.0
needs rehome: False
# Z
homing_axis_distances: [-8.03]
hi.retract_dist: 0.0
@lraithel15133
Copy link
Contributor

I can confirm this behavior on my K3 as well

@bwnance
Copy link
Contributor

bwnance commented Nov 6, 2023

ty for this! included in #90

@rogerlz
Copy link
Contributor

rogerlz commented Dec 19, 2023

#90 is merged now.. thanks!

@rogerlz rogerlz closed this as completed Dec 19, 2023
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

4 participants