{ "cells": [ { "cell_type": "markdown", "id": "ebfb8e75", "metadata": {}, "source": [ "# CoRe gripper tool centres\n", "\n", "![Every channel pair probing both CoRe gripper tools](img/core_gripper_tool_centers.png)\n", "\n", "Each neighbouring pair probes both CoRe gripper tools from inside: three walls per tool, a circle\n", "through them, its centre against the model. Two channels on the same tool should agree." ] }, { "cell_type": "markdown", "id": "9da91a0f", "metadata": {}, "source": [ "## Setup\n", "\n", "Every channel needs a conductive tip." ] }, { "cell_type": "code", "execution_count": null, "id": "51299903", "metadata": {}, "outputs": [], "source": [ "import asyncio\n", "\n", "from pylabrobot.hamilton.star import STAR\n", "from pylabrobot.resources import hamilton_96_tiprack_50uL, hamilton_tip_carrier_L5\n", "\n", "star = STAR()\n", "await star.setup()\n", "\n", "tip_carrier = hamilton_tip_carrier_L5(name=\"tip_carrier\")\n", "tip_carrier[0] = hamilton_96_tiprack_50uL(name=\"tip_rack_50ul\")\n", "star.deck.assign_child_resource(tip_carrier, track=32)" ] }, { "cell_type": "markdown", "id": "c23aed04", "metadata": {}, "source": [ "## Tool tops\n", "\n", "The stop discs of channels 0 and 1 find both tops at once, before any tip goes on." ] }, { "cell_type": "code", "execution_count": null, "id": "4a91f83c", "metadata": {}, "outputs": [], "source": [ "back_tool = star.get_resource(\"STAR_deck_core_grippers_back\")\n", "front_tool = star.get_resource(\"STAR_deck_core_grippers_front\")\n", "back_top = back_tool.get_location_wrt(other=star.deck, x=\"c\", y=\"c\", z=\"t\")\n", "front_top = front_tool.get_location_wrt(other=star.deck, x=\"c\", y=\"c\", z=\"t\")\n", "\n", "# channel 0 over the back tool's rim, channel 1 over the front tool's\n", "await star.pipettes.move_to_safe_z()\n", "await star.pipettes.move_to_xy_positions(\n", " x=back_top.x + 2.5,\n", " ys={0: back_top.y, 1: front_top.y},\n", " make_space=True,\n", ")\n", "\n", "\n", "async def probe_top(channel, top):\n", " return await star.pipettes.probe_z_using_clld(\n", " channel=channel,\n", " search_start_position=top.z + 6.0,\n", " search_end_position=top.z - 1.0,\n", " allow_without_tip=True,\n", " post_detection_distance=4.0,\n", " )\n", "\n", "\n", "back_z, front_z = await asyncio.gather(\n", " probe_top(channel=0, top=back_top),\n", " probe_top(channel=1, top=front_top),\n", ")\n", "await star.pipettes.move_to_safe_z()\n", "\n", "if back_z is None or front_z is None:\n", " raise RuntimeError(\"a tool top was not found\")\n", "modelled_z_top = round((back_z + front_z) / 2, 2)" ] }, { "cell_type": "markdown", "id": "cae9a480", "metadata": {}, "source": [ "## Every pair\n", "\n", "`front_channel - 1` probes the back tool, `front_channel` the front one." ] }, { "cell_type": "code", "execution_count": null, "id": "86505f00", "metadata": {}, "outputs": [], "source": [ "tip_rack = star.get_resource(\"tip_rack_50ul\")\n", "all_channels = list(range(star.pipettes.num_channels))\n", "await star.pipettes.pick_up_tips(tip_spots=tip_rack.column(0), use_channels=all_channels)\n", "\n", "results = {}\n", "for front_channel in all_channels[1:]:\n", " centers = await star.diagnostics.probe_core_gripper_tool_centers(\n", " front_channel=front_channel,\n", " modelled_z_top=modelled_z_top,\n", " )\n", " results[front_channel] = centers\n", "\n", "await star.pipettes.return_tips()" ] }, { "cell_type": "markdown", "id": "4b7ce962", "metadata": {}, "source": [ "## Result\n", "\n", "Each channel's offset from the modelled centre, in mm:" ] }, { "cell_type": "code", "execution_count": null, "id": "553463a4", "metadata": {}, "outputs": [], "source": [ "for front_channel, centers in results.items():\n", " back_channel = front_channel - 1\n", " for channel, tool, model in (\n", " (back_channel, \"back\", back_top),\n", " (front_channel, \"front\", front_top),\n", " ):\n", " dx = centers[channel].x - model.x\n", " dy = centers[channel].y - model.y\n", " print(f\"channel {channel}, {tool} tool: dX {dx:+.2f}, dY {dy:+.2f}\")" ] }, { "cell_type": "markdown", "id": "c2d1ee3e", "metadata": {}, "source": [ "A channel that is off shows on both tools; a tool that is off shows for every channel. A tip's\n", "runout adds to its channel's offset: take a fresh tip per pair to average it out. Align an off\n", "channel by hand with [the adjustment procedure](../hardware/adjusting-robot.md)." ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "name": "python" } }, "nbformat": 4, "nbformat_minor": 5 }