Skip to content

Conversation

@konradhermsdorf
Copy link

Keep pending AL-Control-Event flag in ESCvar so a state-change request does not need to be serviced immediately. Also add an acknowledge-parameter to the pre_state_change()-callback which may be negated by the routine in order to postpone a state-change to the next run of the slave handler.

When AL-control request is asserted by master, the according AL-event flag is set by the ESC. The according AL-Event flag is cleared on reading the AL-Control register right at the top of ESC_state(); so the routine only ran once per AL-Control-Request. With the ESCvar.ALcontrol_pending flag, a not yet finished state-change allows running the state-change logic again until the state-change gets acknowledged by the pre_state_change() callback.

This approach allows SOES to service other requests (e.g. mailbox) while a state-change is pending.

Why ist this needed?
A slave that needs some time to become (Pre-)Operational, e.g. one that needs to accelerate a rotating mass before entering PreOp needs to be able to delay a state change without setting the ALerror bit

@CLAassistant
Copy link

CLAassistant commented Sep 23, 2025

CLA assistant check
All committers have signed the CLA.

@konradhermsdorf konradhermsdorf force-pushed the feature/delayed-state-change branch from 4423446 to accee8e Compare September 25, 2025 06:27
Keep pending AL-Control-Event flag in ESCvar so a state-change request
does not need to be serviced immediately. Also add an
acknowledge-parameter to the pre_state_change()-callback which may be
negated by the routine in order to postpone a state-change to the next
run of the slave handler.

When AL-control request is asserted by master, the according AL-event
flag is set by the ESC. The according AL-Event flag is cleared on
reading the AL-Control register right at the top of ESC_state(); so the
routine only ran once per AL-Control-Request. With the
ESCvar.ALcontrol_pending flag, a not yet finished state-change allows
running the state-change logic again until the state-change gets
acknowledged by the pre_state_change() callback.

This approach allows SOES to service other requests (e.g. mailbox) while
a state-change is pending.
@konradhermsdorf konradhermsdorf force-pushed the feature/delayed-state-change branch from accee8e to 529dd02 Compare September 25, 2025 06:29
@konradhermsdorf
Copy link
Author

@hefloryd do you need further information?

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