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

Implement two phase homing cycle with slow second approach #690

Merged
merged 8 commits into from
Jul 4, 2024

Conversation

patryk3211
Copy link
Contributor

As the title says, this pull request implements a two phase homing cycle. The first phase approaches limit switches at the rapid homing feed rate and backs off. The second phase approaches limit switches at homing seek feed rate and then pulls off into the final position. This code is not tested yet, I'll get around to it tomorrow.

@Paciente8159 Paciente8159 added needs: testing needs: testing core: config core: configuration files needs: awaiting review Awaiting review labels Jul 2, 2024
@patryk3211
Copy link
Contributor Author

After testing the new homing cycle for a while it seems to be performing fine. It also seems to give better accuracy on my machine though this is just based on my observation with no objective measurements.

@patryk3211 patryk3211 marked this pull request as ready for review July 2, 2024 15:05
@patryk3211
Copy link
Contributor Author

I just noticed that the homing offset now gets applied twice, fixing it.

@patryk3211
Copy link
Contributor Author

Should be fine now, final pull off moves until it no longer contacts the switches (like in the short cycle) and the kinematics moves the axis rest of the way.

@Paciente8159
Copy link
Owner

Should be fine now, final pull off moves until it no longer contacts the switches (like in the short cycle) and the kinematics moves the axis rest of the way.

Thanks. I will try to test it and review it tomorrow

Copy link
Owner

@Paciente8159 Paciente8159 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current default behavior of µCNC is:
Rapid approach -> Slow pull off

The modification this proposes to do is a long homing cycle
Rapid approach -> Rapid pull off -> Slow approach -> Slow pull off

The new option should reflect that.

Tested the code
This is working but it's causing issues with the option ENABLE_XY_SIMULTANEOUS_HOMING

With this option enabled the axis locking on retraction is not working correctly.

uCNC/cnc_config.h Show resolved Hide resolved
uCNC/src/core/motion_control.c Show resolved Hide resolved
@Paciente8159 Paciente8159 added needs: improvements needs: some feature needs improvements and removed needs: awaiting review Awaiting review labels Jul 3, 2024
 - By default the short homing cycle is used
 - Fixed simultaneous xy homing locking up in long cycle
Copy link
Owner

@Paciente8159 Paciente8159 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After testing with several options enabled the code seemed to work correctly.
I'm still not comfortable with the modification on the io_control.c file and potential unintended effects that may arise. I will have to look at the code with a bit more time and run some debugging.
There is also a typo on the motion_control.c file but does not cause any issue.

I liked your idea as it introduces a code compression opportunity. I've come up with a slightly different code implementation that works without modifying io_control and can make code even smaller and simpler to read.

I'm going to give the green light to this PR and then adjust it accordingly with the comments above.

Thanks for the PR.

@Paciente8159 Paciente8159 merged commit 1467182 into Paciente8159:master Jul 4, 2024
19 checks passed
@patryk3211 patryk3211 deleted the long_homing_cycle branch July 5, 2024 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core: config core: configuration files needs: improvements needs: some feature needs improvements needs: testing needs: testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants