Skip to content

Expose STARBackend.iswap_rotation_drive_move_y()#1020

Merged
BioCam merged 4 commits intoPyLabRobot:mainfrom
BioCam:expose-iswap_rotation_drive_move_y
Apr 30, 2026
Merged

Expose STARBackend.iswap_rotation_drive_move_y()#1020
BioCam merged 4 commits intoPyLabRobot:mainfrom
BioCam:expose-iswap_rotation_drive_move_y

Conversation

@BioCam
Copy link
Copy Markdown
Collaborator

@BioCam BioCam commented Apr 30, 2026

Tame the iSWAP - Part 7

The center of the rotation drive is the "base of the SCARA part of the iSWAP".

In the previous parts I've exposed requesting the position information of it, then added it's movement in X.

In this PR, I'm adding its movement in Y.

Because the iSWAP is not alone on the rail / its X-coordinate, this is the PR in which I am adding the iSWAP safety features in the Y dimension:

-> from now on you can no longer crash your iSWAP into ...

  • the back of the arm
  • channel_0

Because it is tedious to always think about arm positions I added make_space argument to:

  async def iswap_rotation_drive_move_y(
    self,
    y: float,
    speed: float = 220.0,
    acceleration_level: int = 2,
    current_protection_limiter: int = 7,
    make_space: bool = False,
  )

...adapted from position_channels_in_y_direction's make_space

To make this calculation possible I took the iSWAP channel diameter to be 30.5 mm, as described in the operator manual - see #1011


Please let me know whether you think we should make make_space: bool = False by default; it might help people but does introduce implicit behaviour - though expected behaviour?

Comment on lines +9953 to +9954

iswap_radius = STARBackend.iswap_rotation_drive_diameter / 2
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

rotation_drive_radius?

Comment on lines +9994 to +9996
if not (1 <= acceleration_level <= 2):
raise ValueError(f"acceleration_level must be between 1 and 2, got {acceleration_level}")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this is 6250 steps / s2 or 2 * 6250

so 6250 * 0.046302082 = 289.388 mm/s or twice that?

Copy link
Copy Markdown
Collaborator Author

@BioCam BioCam Apr 30, 2026

Choose a reason for hiding this comment

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

For level 1:
6250 * 0.046302082 = 289.388 mm/s

For level 2 twice that

Is how i understood it

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

cool

@BioCam BioCam merged commit 7756673 into PyLabRobot:main Apr 30, 2026
21 checks passed
@BioCam BioCam deleted the expose-iswap_rotation_drive_move_y branch April 30, 2026 23:38
BioCam added a commit that referenced this pull request May 1, 2026
* expose iswap_rotation_drive_move_y

* shuffle iswap move y next below move x

* Expose `STARBackend.iswap_rotation_drive_move_z()`

Adds the absolute Z-axis sibling to `iswap_rotation_drive_move_x` (#1018)
and `iswap_rotation_drive_move_y` (#1020). Wraps `R0 ZA` and accepts the
rotation-drive plane Z (matching `iswap_rotation_drive_request_z`); the
13 mm offset to the gripper finger plane is applied internally.
`acceleration` is exposed in mm/sec^2.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* clarify `bottom` return (per LFB PLR expectation)

PLR users expect left-front-bottom referencing;

for channels this changes to center-center in x-y but in z people still expect bottom;

since we are referencing the actual rotation drive here and its bottom is 13 mm above the finger_z_plane I have added a short comment to make this clearer

* `make format`

---------

Co-authored-by: Camillo Moschner <camillo.moschner@biocam.guide>
Co-authored-by: Camillo Moschner <122165124+BioCam@users.noreply.github.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
BioCam added a commit that referenced this pull request May 1, 2026
* expose iswap_rotation_drive_move_y

* shuffle iswap move y next below move x

* Expose `STARBackend.iswap_rotation_drive_move_z()`

Adds the absolute Z-axis sibling to `iswap_rotation_drive_move_x` (#1018)
and `iswap_rotation_drive_move_y` (#1020). Wraps `R0 ZA` and accepts the
rotation-drive plane Z (matching `iswap_rotation_drive_request_z`); the
13 mm offset to the gripper finger plane is applied internally.
`acceleration` is exposed in mm/sec^2.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* clarify `bottom` return (per LFB PLR expectation)

PLR users expect left-front-bottom referencing;

for channels this changes to center-center in x-y but in z people still expect bottom;

since we are referencing the actual rotation drive here and its bottom is 13 mm above the finger_z_plane I have added a short comment to make this clearer

* `make format`

* create `iswap_rotation_drive_request_predefined_z_positions`

* create `iswap_rotation_drive_request_predefined_y_positions`

* add iSWAP Y/Z drive conversions and correct pip Y resolution

* tighten iswap_rotation_drive_move_z error messages and document Raises

* create `iswap_rotation_drive_request_predefined_z_positions`

* create `iswap_rotation_drive_request_predefined_y_positions`

* add iSWAP Y/Z drive conversions and correct pip Y resolution

* tighten iswap_rotation_drive_move_z error messages and document Raises

* drop firmware-internal constraints from predefined Y/Z parking-pose docstrings

* reword Z increment-range comment to drop misleading return claim

* decouple iSWAP rotation-drive Y/Z from PIP-channel conversions

* rename increment version to `_` and provide public API in expected mm

* make everything that references rotation drive return rotation drive data

* `make format`

* simplify: compress increment and mm returns into one method

* simplify z conversions

---------

Co-authored-by: Rick Wierenga <rick_wierenga@icloud.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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