Skip to content

Mbp 247 position recovery improvements - #25

Merged
federrg merged 36 commits into
masterfrom
MBP-247-position-recovery-improvements
Jun 22, 2026
Merged

federrg merged 36 commits into
masterfrom
MBP-247-position-recovery-improvements

Conversation

@federrg

@federrg federrg commented Jun 22, 2026 •

Copy link
Copy Markdown
Member

Same as old PR
#17

Incorporate eRestoreWithoutHome in RESTORE_POSITIONS() action.
Check that BUSY bit is false, before the check of the DONE bit
is made.
Make the timestamping a one-liner, instead of an action.
MC_SetPosition is replaced by MC_Home, thus it sets the home position
to actual position and the calibration flag.
Changed solution to loop using the iCurrentAxis index, and
incrementing if position restore was properly executed or if axis was
not initialized properly or if axis was not homed before power failure.
Changed encoder reference to be constants, for better
readability.
Always restore position despite an axis not being initilized or
homed during shutdown.
For incremental encoders the moving status of the axis cannot
be determined before a power failure, therefore the position
of the axis is sampled every 5 seconds with a difference
limit of 0.001 mm. These values can be changed.
Cleanup of the execution logic for restore position
action.
Change to correct naming for TON-timers and time.
MBP-247: Adjust execution logic to match E_RestorePosition changes.
The following function blocks have been changed to fb's
fbReadEncRefSys: MC_ReadParameter;
fbSetHomePosition: MC_Home;
fbSetPosition: MC_SetPosition;
fbWritePositionBias: MC_WriteParameter;

To adhere to the solution handling each axis separeatly.
The following afb is still kept as is, as these values needs to be stored
as persistent before shutdown.

afbReadPositionBias: ARRAY [1..GVL_APP.nAXIS_NUM] OF MC_ReadParameter;
Included more steps into the eRestorePositions enum
to handle each edge case for an encoder separatly.
Added error handling for the fbs as well as a retry counter.
Uses encoder reference system to decide restore type.
Keeps only the check for whether restore is needed.

@szilard-ess szilard-ess left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

No changes besides the rename, my approve still stands.

@federrg
federrg merged commit 87d07ac into master Jun 22, 2026
2 checks passed
@federrg
federrg deleted the MBP-247-position-recovery-improvements branch June 22, 2026 14:09
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.

3 participants