Skip to content

Conversation

@acolomb
Copy link
Member

@acolomb acolomb commented Aug 2, 2021

The BaseNode402.homing() method tries to enter state SWITCHED ON upon entry. That's unnecessary, the application should handle these transitions. But more importantly, it actually fails in many cases, namely if the previous state is SWITCH ON DISABLED, the default power-up state of most devices. There is an automatic way to reach OPERATION ENABLED over multiple intermediate steps, but the library does not know how to reach SWITCHED ON from any other state than OPERATION ENABLED or READY TO SWITCH ON.

In addition, setting the op_mode property will already change to SWITCHED ON only if coming from OPERATION ENABLED (which is usually a good idea to avoid unexpected movement).

Note that switching the operation mode to HOMING is actually safe in any power state.

The BaseNode402.homing() method tries to enter state SWITCHED ON upon
entry.  That's unnecessary, the application should handle these
transitions.  But more importantly, it actually fails in many cases,
namely if the previous state is SWITCH ON DISABLED, the default
power-up state of most devices.  There is an automatic way to reach
OPERATION ENABLED over multiple intermediate steps, but the library
does not know how to reach SWITCHED ON from any other state than
OPERATION ENABLED or READY TO SWITCH ON.  In addition, setting the
op_mode property will already change to SWITCHED ON only if coming
from OPERATION ENABLED (which is usually a good idea to avoid
unexpected movement).

Note that switching the operation mode to HOMING is actually safe in
any power state.
@af-silva af-silva merged commit 4b95870 into canopen-python:master Aug 16, 2021
@acolomb acolomb mentioned this pull request Aug 16, 2021
@acolomb acolomb deleted the homing-avoid-switched-on branch August 17, 2021 12:21
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