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

homing does not work when step is too large #23

Open
aboitor opened this issue Mar 5, 2017 · 3 comments
Open

homing does not work when step is too large #23

aboitor opened this issue Mar 5, 2017 · 3 comments

Comments

@aboitor
Copy link

aboitor commented Mar 5, 2017

I had a set-up where the step size was .053125mm

When I would run G28, homing would seem to work until it reached the endstop, but then the program would hang and there was not output to the steppers anymore. After I reduced the step size by adding more microstepping, the problem went away.

What I think was happening was that it would hit the endstop and then try to backoff with the smaller step size. Maybe due to rounding it would not actually issues any steps. I have not tried any modifications to the code, but I looked at line 698 in gcode-machine-control.cc to get an idea of what might be happening
const float kHomingMM = (backoff) ? 0.5 : 0.05; // TODO: make configurable? const float kBackoffMM = kHomingMM / 10.0; // TODO: make configurable?

@hzeller
Copy link
Owner

hzeller commented Mar 5, 2017

It sounds plausible that it was actually rounded to less than one step, so no steps were emitted (and therefore hang, as it never got out of that again).

@lromor
Copy link
Contributor

lromor commented Jan 3, 2018

@hzeller is this still open? If not, I can try to work on it

@bigguiness
Copy link
Contributor

On my hardware the steps-per-mm are 503.937 or 0.00198 mm/step. With that resolution the 0.5mm moves toward the endstop and 0.05mm moves away work great and the homing is very repeatable. The 0.05mm on my machine is approx 25 motor steps.

On hardware with courser resolution, like aboitor's 0.053125 mm/step, those fixed move steps will of course not work because the motor step size is to close to the backoff step size.

I think we need to either:

  1. Make the homing and backoff step size configurable. This could get complicated on some setups and make the homing very unrepeatable.

or

  1. Use the 0.5/0.05 as a starting point and then check the smaller value against the largest actual motor step size. If the motor step size is less than something like 2-3 times the backoff distance (i.e. 2 or 3 steps), the homing and backoff distances should be increased to ensure that some steps are actually emitted.

Note:
I originally used the 0.5 mm homing step size because of the distance that the buttons on my homing switches can be depressed. With that step size I can be assured that the button will always be detected before it is fully pressed and the machine crashes into the hard stops. The 1/10 smaller backoff allows the axis to move until it is just off the limit.

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