Usage of 2 switches for homing

More
6 years 3 weeks ago #185497 by mydani
Hi guys,

in a simple open loop stepper driven cnc machine w/o encoders on the axis,I want to home in the following manner:
* run in one direction until switch 1 is active (that's a mechanical switch)
* run slowly in the other direction until switch 2 is active (that's a high precision sensor reacting on a pin in the drive gear)

With encoder I would simply set home_use_index and be done...

But what can I do w/o encoder, especially on the HAL side of things?
Is it possible to have a 2-step homing, one macro for a rough homing (move until switch is active) and then manually start the "real" homing using the signals from the drive gear? Or maybe some fake encoder reset to 0 so home_use_index is possible?

This is similar to this thread:
forum.linuxcnc.org/49-basic-configuratio...is-when-homed#184723

But as I do not have any encoders I cannot fall back to the solution of this thread.

Best regards,
Daniel

Please Log in to join the conversation.

More
6 years 3 weeks ago #185504 by mydani
I found a solution for this, a little comp was all it needed.
Sorry to bother :)

Please Log in to join the conversation.

More
6 years 3 weeks ago #185509 by tommylight
A bit more info on the solution would be nice for the next guy who might need this.

Please Log in to join the conversation.

More
6 years 3 weeks ago #185512 by mydani
Hi Tommy,

I will upload the comp to this thread tomorrow, after I cleaned up my code a bit. :side:

Please Log in to join the conversation.

More
6 years 3 weeks ago #185513 by tommylight
That would be great, thank you.

Please Log in to join the conversation.

More
6 years 3 weeks ago #185586 by mydani
There you go, here's the home_index_stepdirlink to the comp . While I was at it, also added my changer components, and an oiler component which oils based on the way the guides have made (e.g. after 20 meters start the oiling cycle).

Regards,
Daniel

Please Log in to join the conversation.

Time to create page: 0.236 seconds
Powered by Kunena Forum