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

Fix race condition in homing behaviour #710

Merged
merged 5 commits into from
Sep 7, 2022
Merged

Fix race condition in homing behaviour #710

merged 5 commits into from
Sep 7, 2022

Conversation

Wetmelon
Copy link
Collaborator

@Wetmelon Wetmelon commented Sep 6, 2022

  • Sets input_pos and pos_setpoint = 0.0 after moving to the final homed position

  • Add a 1ms delay to after set_linear_count(0) to allow pos_estimate to update so that we don't reset input_pos when transitioning back into closed loop

  • Add to change log

Tested by user with industrial robot with optical homing switches.
image

image

controller_.config_.control_mode = stored_control_mode;
controller_.config_.input_mode = stored_input_mode;
// Force encoder estimate to update
osDelay(1);
Copy link
Member

Choose a reason for hiding this comment

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

We have wait_for_control_iteration() which would be fitting here

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Since this is legacy homing and it was tested with osDelay, I think I'd rather just keep it

@Wetmelon Wetmelon merged commit fb70a83 into devel Sep 7, 2022
@Wetmelon Wetmelon deleted the hotfix/homing_fix branch September 7, 2022 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants