Safety Feature: Protect Channels during y-Movement #355
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.
Hi everyone,
This is an anti-crash PLR Safety Feature for channel movements in the y-dimension.
Problem Statement
Currently
STAR.move_channel_y(channel: int, y: float)
simply requests the machine to move a channel with a specified index to ay
position, regardless of whether another channel might be in the way.PLR users are forced to humanly memorise where each channel is in the y-position if they wanted to avoid crashes.
As a result, crashes of one channel into another are very likely to occur.
PR Content
I have added a couple of lines of code to
STAR.move_channel_y(channel: int, y: float)
which calculate the neighbouring channels' y-positions and the safe y-space (i.e. 6 - 635 mm in y-dimension) and raises an error if the target y-value does not fall into the safe y-range.Example 0: channel_2 is surrounded by channels (i.e. there is a 9mm distance to them) -> triggers...
Example 1: channel_0 is tasked to move outside the safe y-range -> triggers...
Example 2: channel_0 is tasked to move "through" other channels -> triggers...
Next steps
I have added an assertion error if the channel is asked to move to the y-position that it already is in... I am not sure whether this is needed (I'm leaning towards removing it) but wanted to ask you for your opinion on this?