Skip to content

Safety Feature: Protect Channels during y-Movement #355

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

BioCam
Copy link
Contributor

@BioCam BioCam commented Jan 10, 2025

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 a y 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...

await lh.backend.move_channel_y(
    y= 496.0,
    channel=2
)

AssertionError: channel_2 y-target must be >= 50.9 and <= 50.9, is 496.0 mm,
  current y-position = 50.9 mm,
  Can you move the neighboring channels to create space for channel_2?

Example 1: channel_0 is tasked to move outside the safe y-range -> triggers...

await lh.backend.move_channel_y(
    y= 640,
    channel=0
)

AssertionError: channel_0 y-target must be >= 68.9 and <= 635, is 640 mm,
  current y-position = 528.6 mm,
  Can you move the neighboring channels to create space for channel_0?

Example 2: channel_0 is tasked to move "through" other channels -> triggers...

await lh.backend.move_channel_y(
    y= 60,
    channel=0
)

AssertionError: channel_0 y-target must be >= 68.9 and <= 635, is 60 mm,
  current y-position = 528.6 mm,
  Can you move the neighboring channels to create space for channel_0?

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?

@rickwierenga rickwierenga merged commit 25c117b into PyLabRobot:main Jan 10, 2025
7 checks passed
@rickwierenga
Copy link
Member

thanks!

@BioCam BioCam deleted the Safety-feature-protect-channels-moving-in-y-dimension branch May 1, 2025 08:29
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