Mbp 247 position recovery improvements - #25
Merged
Merged
Conversation
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
approved these changes
Jun 22, 2026
szilard-ess
left a comment
Collaborator
There was a problem hiding this comment.
No changes besides the rename, my approve still stands.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Same as old PR
#17