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

DS402: Restore operation mode after homing only on explicit request. #262

Merged

Conversation

acolomb
Copy link
Collaborator

@acolomb acolomb commented Aug 12, 2021

This PR is based on #250 to avoid conflicts, thus should be merged after it. If needed I can rebase after merging #250.

Add a new parameter restore_op_mode which defaults to False, and skip changing back to the previous mode unless it is explicitly enabled by passing True. Note that most applications will decide on the needed mode after homing and therefore do not need this behavior, hence the new default.

As explained in #244.

The homing() method will try to manipulate the Home Offset (0x607C)
parameter by default.  That's not the way the parameter is intended to
work.  After a successful homing procedure, the drive should set the
Actual Position (0x6063) to the Home Offset (0x607C) by itself.  By
default that is zero, so the selected reference switch flank will mark
the new zero position.

The library's default behavior here is backwards, and can only work
with absolute position encoders.  The whole point of homing is to find
a physical reference and align the logical coordinate system to it.
Trying to determine the desired offset from the value which an
unreferenced encoder had at the physical reference point actually
destroys that logical alignment.

The functionality of set_new_home=True is trivial to do from the
application, so remove it completely from homing().
Add a new parameter restore_op_mode which defaults to False, and skip
changing back to the previous mode unless it is explicitly enabled by
passing True.  Note that most applications will decide on the needed
mode after homing and therefore do not need this behavior, hence the
new default.
@af-silva af-silva merged commit 7462d0b into christiansandberg:master Aug 16, 2021
@acolomb acolomb deleted the homing-skip-restore-op-mode branch August 16, 2021 20:26
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

Successfully merging this pull request may close these issues.

2 participants