qubot-drivers 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. qubot_drivers-0.1.0/.dockerignore +8 -0
  2. qubot_drivers-0.1.0/.github/workflows/publish.yml +43 -0
  3. qubot_drivers-0.1.0/.github/workflows/test.yml +20 -0
  4. qubot_drivers-0.1.0/.gitignore +59 -0
  5. qubot_drivers-0.1.0/CHANGELOG.md +54 -0
  6. qubot_drivers-0.1.0/LICENSE +21 -0
  7. qubot_drivers-0.1.0/PKG-INFO +151 -0
  8. qubot_drivers-0.1.0/README.md +128 -0
  9. qubot_drivers-0.1.0/docs/Sartorius-rLine-technical-user-manual-v1.1.pdf +0 -0
  10. qubot_drivers-0.1.0/pyproject.toml +41 -0
  11. qubot_drivers-0.1.0/skills/qubot-driver/SKILL.md +130 -0
  12. qubot_drivers-0.1.0/skills/qubot-driver/references/examples/claw_machine.py +162 -0
  13. qubot_drivers-0.1.0/skills/qubot-driver/references/examples/dancefloor.py +171 -0
  14. qubot_drivers-0.1.0/skills/qubot-driver/references/examples/eis_qubot.py +169 -0
  15. qubot_drivers-0.1.0/skills/qubot-driver/references/examples/miniqubot.py +138 -0
  16. qubot_drivers-0.1.0/skills/qubot-driver/references/examples/overkill2.py +155 -0
  17. qubot_drivers-0.1.0/skills/qubot-driver/references/examples/photoreactor.py +154 -0
  18. qubot_drivers-0.1.0/skills/qubot-driver/references/examples/pipqubot_mof.py +189 -0
  19. qubot_drivers-0.1.0/skills/qubot-driver/references/examples/pipqubot_xl.py +152 -0
  20. qubot_drivers-0.1.0/skills/qubot-driver/references/examples/syringequbot.py +150 -0
  21. qubot_drivers-0.1.0/skills/qubot-driver/references/labware/vial_rack_2x2.json +12 -0
  22. qubot_drivers-0.1.0/src/qubot/__init__.py +13 -0
  23. qubot_drivers-0.1.0/src/qubot/end_effector/__init__.py +65 -0
  24. qubot_drivers-0.1.0/src/qubot/end_effector/a_axis_capper.py +28 -0
  25. qubot_drivers-0.1.0/src/qubot/end_effector/autosampler_syringe.py +23 -0
  26. qubot_drivers-0.1.0/src/qubot/end_effector/orion_4ch_led.py +86 -0
  27. qubot_drivers-0.1.0/src/qubot/end_effector/parallel_force_actuator.py +311 -0
  28. qubot_drivers-0.1.0/src/qubot/end_effector/rline.py +65 -0
  29. qubot_drivers-0.1.0/src/qubot/end_effector/rline_50_1000.py +24 -0
  30. qubot_drivers-0.1.0/src/qubot/end_effector/rline_50_1000_multistep.py +52 -0
  31. qubot_drivers-0.1.0/src/qubot/end_effector/rline_pace.py +180 -0
  32. qubot_drivers-0.1.0/src/qubot/end_effector/rotating_vacuum_gripper.py +92 -0
  33. qubot_drivers-0.1.0/src/qubot/end_effector/satorius.py +409 -0
  34. qubot_drivers-0.1.0/src/qubot/end_effector/satorius_multistep.py +552 -0
  35. qubot_drivers-0.1.0/src/qubot/end_effector/vacuum_chamber.py +116 -0
  36. qubot_drivers-0.1.0/src/qubot/gantry/__init__.py +48 -0
  37. qubot_drivers-0.1.0/src/qubot/gantry/frame.py +105 -0
  38. qubot_drivers-0.1.0/src/qubot/gantry/grbl.py +749 -0
  39. qubot_drivers-0.1.0/src/qubot/gantry/grbl_ws.py +302 -0
  40. qubot_drivers-0.1.0/src/qubot/gantry/reprap_http.py +483 -0
  41. qubot_drivers-0.1.0/src/qubot/geometry/__init__.py +5 -0
  42. qubot_drivers-0.1.0/src/qubot/geometry/position.py +378 -0
  43. qubot_drivers-0.1.0/src/qubot/labware/__init__.py +13 -0
  44. qubot_drivers-0.1.0/src/qubot/labware/deck.py +79 -0
  45. qubot_drivers-0.1.0/src/qubot/labware/definitions/MEA_cell_MTP.json +56 -0
  46. qubot_drivers-0.1.0/src/qubot/labware/definitions/bioshake.json +323 -0
  47. qubot_drivers-0.1.0/src/qubot/labware/definitions/opentrons_96_tiprack_300ul.json +1020 -0
  48. qubot_drivers-0.1.0/src/qubot/labware/definitions/polyelectric_8_wellplate_30000ul.json +142 -0
  49. qubot_drivers-0.1.0/src/qubot/labware/definitions/polyelectric_96_wellplate_330ul.json +1127 -0
  50. qubot_drivers-0.1.0/src/qubot/labware/definitions/sartorious_96_tiprack_1000ul.json +1130 -0
  51. qubot_drivers-0.1.0/src/qubot/labware/definitions/trash_bin_create.json +43 -0
  52. qubot_drivers-0.1.0/src/qubot/labware/definitions/trash_bin_mof.json +43 -0
  53. qubot_drivers-0.1.0/src/qubot/labware/labware.py +212 -0
  54. qubot_drivers-0.1.0/src/qubot/serialcontroller.py +279 -0
  55. qubot_drivers-0.1.0/tests/test_autosampler_syringe.py +6 -0
  56. qubot_drivers-0.1.0/tests/test_frame.py +59 -0
  57. qubot_drivers-0.1.0/tests/test_imports.py +59 -0
  58. qubot_drivers-0.1.0/tests/test_labware.py +87 -0
  59. qubot_drivers-0.1.0/tests/test_orion_4ch_led.py +15 -0
  60. qubot_drivers-0.1.0/tests/test_parallel_force_actuator.py +48 -0
  61. qubot_drivers-0.1.0/tests/test_rline_pace.py +223 -0
  62. qubot_drivers-0.1.0/tests/test_rotating_vacuum_gripper.py +63 -0
  63. qubot_drivers-0.1.0/tests/test_vacuum_chamber.py +53 -0
  64. qubot_drivers-0.1.0/uv.lock +105 -0
@@ -0,0 +1,8 @@
1
+ .git
2
+ .venv
3
+ **/__pycache__
4
+ **/.pytest_cache
5
+ **/*.pyc
6
+ .env
7
+ **/.env
8
+ !.env.example
@@ -0,0 +1,43 @@
1
+ name: Publish to PyPI
2
+
3
+ # Publishes qubot-drivers when a GitHub release is published.
4
+ # Uses PyPI trusted publishing: no API token is stored in this repository.
5
+ on:
6
+ release:
7
+ types: [published]
8
+
9
+ jobs:
10
+ build:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v4
14
+ - uses: astral-sh/setup-uv@v6
15
+ - name: Test
16
+ run: |
17
+ uv sync --group dev
18
+ uv run pytest -q
19
+ - name: Check the tag matches the package version
20
+ run: |
21
+ version=$(uv run python -c "import tomllib; print(tomllib.load(open('pyproject.toml','rb'))['project']['version'])")
22
+ test "${GITHUB_REF_NAME#v}" = "$version" || { echo "tag $GITHUB_REF_NAME != version $version"; exit 1; }
23
+ - name: Build
24
+ run: uv build
25
+ - uses: actions/upload-artifact@v4
26
+ with:
27
+ name: dist
28
+ path: dist/
29
+
30
+ publish:
31
+ needs: build
32
+ runs-on: ubuntu-latest
33
+ environment:
34
+ name: pypi
35
+ url: https://pypi.org/p/qubot-drivers
36
+ permissions:
37
+ id-token: write
38
+ steps:
39
+ - uses: actions/download-artifact@v4
40
+ with:
41
+ name: dist
42
+ path: dist/
43
+ - uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,20 @@
1
+ name: Test
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ jobs:
9
+ test:
10
+ runs-on: ubuntu-latest
11
+ strategy:
12
+ matrix:
13
+ python-version: ["3.11", "3.12", "3.13"]
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+ - uses: astral-sh/setup-uv@v6
17
+ with:
18
+ python-version: ${{ matrix.python-version }}
19
+ - run: uv sync --group dev
20
+ - run: uv run pytest -q
@@ -0,0 +1,59 @@
1
+ # See https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files for more about ignoring files.
2
+
3
+ # compiled output
4
+ dist
5
+ tmp
6
+ out-tsc
7
+
8
+ # Python
9
+ **/__pycache__/
10
+ *.py[cod]
11
+ *$py.class
12
+
13
+ # Environment variables
14
+ .env
15
+ .env.*
16
+ !.env.example
17
+
18
+ # dependencies
19
+ node_modules
20
+
21
+ # IDEs and editors
22
+ /.idea
23
+ .project
24
+ .classpath
25
+ .c9/
26
+ *.launch
27
+ .settings/
28
+ *.sublime-workspace
29
+
30
+ # IDE - VSCode
31
+ .vscode/*
32
+ !.vscode/settings.json
33
+ !.vscode/tasks.json
34
+ !.vscode/launch.json
35
+ !.vscode/extensions.json
36
+
37
+ # misc
38
+ /.sass-cache
39
+ /connect.lock
40
+ /coverage
41
+ /libpeerconnection.log
42
+ npm-debug.log
43
+ yarn-error.log
44
+ testem.log
45
+ /typings
46
+
47
+ # System Files
48
+ .DS_Store
49
+ Thumbs.db
50
+
51
+ .nx/cache
52
+ .nx/workspace-data
53
+
54
+ # AI tools
55
+ .claude
56
+ .cursor
57
+
58
+ .venv/
59
+ .pytest_cache/
@@ -0,0 +1,54 @@
1
+ # Changelog
2
+
3
+ Driver, geometry, labware, and skill changes are recorded here. A site edge does not append to this file; it pins the qubot version it uses.
4
+
5
+ ## 0.1.0 - 2026-11-26
6
+
7
+ - First PyPI release, `qubot-drivers` 0.1.0. Publishing runs from `.github/workflows/publish.yml` on a GitHub release via PyPI trusted publishing.
8
+ - One package replaces the 18 workspace packages. It is distributed as `qubot-drivers` (`qubot` is taken on PyPI) and imported as `qubot`. One root `pyproject.toml`; code is under `src/qubot/`.
9
+ - Imports: `from qubot.gantry import Frame, GrblHALController, GrblWSController, RepRapHTTPController` and `from qubot.end_effector import Capper, RotatingVacuumGripper, Chamber, LedBoard, ParallelFingers, narrow_z, RLineModel`, loaded on first use. The rLine pipettes are modules: `from qubot.end_effector import rline_50_1000, rline_50_1000_multistep`. Defining modules such as `qubot.gantry.grbl` still import. `qubot.geometry` and `qubot.edgekit` are unchanged. Old names such as `gantry_005`, `rline_50_1000`, and `qubot_geometry` are gone.
10
+ - No machine settings in the package. Each edge imports the drivers and configures them in its own code. Gantry frames `001` to `009`, their command lists, and effector calibration moved to starting-point PUDA `driver.py` files in `skills/qubot-driver/references/examples/`, one per machine (`claw_machine.py`, `dancefloor.py`, …). Each has the constants, a `Driver` that takes ports from `main.py`, `shutdown`/`estop` hooks, and basic `home`/`move_*`/`get_position` commands.
11
+ - `qubot.gantry.Frame` is constructed by the edge. Effector calibration is a constructor argument: `Capper`, `RotatingVacuumGripper`, `Chamber`, `ParallelFingers(corrections=, calibration_factor=)`, and the multistep pipette's `step_resolution` and `response_time_s` (no longer defaulted). `AXIS` and `PORT_ENV` constants are gone; axis and port env names are edge wiring.
12
+ - `qubot.labware` holds `StandardLabware`, `Deck`, and the bundled definitions (moved out of `qubot.geometry`, which now has only `Position`). Edges add or override labware with folders of `<name>.json` (`search_paths` / `Deck(labware_paths=...)`), `StandardLabware.from_file`, or `from_definition`. `Deck.from_frame(frame)` uses the frame's grid. A missing well now raises `KeyError` in `get_height`.
13
+ - `qubot.edgekit` is removed; required `Config` fields in the edge's `main.py` stop an edge without a filled `.env`.
14
+ - Contracts are gone. The build guide (`docs/building-an-edge.md`) and the checklist that replaced `CONTRACT.md` are now the agent skill `skills/qubot-driver/SKILL.md`. `check_contract.py`, `vendor_edge.py`, `attach_toolhead.py`, and `qubot.edgekit.load_contract` are removed. An edge depends on a pinned `qubot` instead of a vendored copy.
15
+ - `MODULARIZATION.md` is merged into the README's Design section. `scripts/accept_host_env.py` is removed; the skill says to copy the user's `.env` and `chmod 600` it.
16
+ - Gantries share one copy of each transport. `001` and `003` now get the `grbl.py` that `005` to `009` used, which adds `halt()` and the `apply_safe_z` keyword on `move_relative`. Nothing else changed in it.
17
+ - The two rLine bodies share `rline.py`. `rline-50-1000-multistep` keeps its own controller in `satorius_multistep.py` and pacing in `rline_pace.py`.
18
+ - `families/` is removed; its transports are the package modules. The rLine manual moved to `docs/`.
19
+ - `requires-python` is `>=3.11`; the previous `qubot-edgekit` already needed `tomllib`.
20
+
21
+ ## 2026-11-25
22
+
23
+ - `rline-50-1000-multistep`: 50-1000 µL rLine body that splits a requested aspirate or dispense speed across a faster preset. Step resolution and response time are the calibrated inputs, defaulting to 10 steps and 1.03 s. `rline-50-1000` is unchanged.
24
+
25
+ ## 2026-11-24
26
+
27
+ - `rotating-vacuum-gripper`: claw vacuum cup and yaw servo on the gantry port. Intermediate yaw uses linear interpolation between the three calibrated pulses.
28
+ - Gantry `005` homes Z, then X, then Y, and can feed-hold with realtime `!` without taking the command lock. `move_relative` accepts `apply_safe_z`.
29
+ - `vacuum-chamber`: dancefloor valve and lid waypoints. Loading X=−118 stays outside gantry `006` until the −119 versus −116 limit is confirmed. Gantry `006` can feed-hold the same way.
30
+ - Gantry `007` can feed-hold without taking the command lock. `move_relative` accepts `apply_safe_z`. The PESCador pipette reuses `rline-50-1000`.
31
+ - `orion-4ch-led`: four-channel LED line on one 9600 baud port. The reply is not parsed. Gantry `008` can feed-hold without taking the command lock.
32
+ - `parallel-force-actuator`: four serial actuators. Force-threshold stops stay disabled until an edge contract names the threshold unit. Gantry `009` can feed-hold without taking the command lock.
33
+
34
+ ## 2026-11-23
35
+
36
+ `main` keeps gantries, end effectors, transport families, geometry, and the edge kit. Finished edges are not stored on `main`. The previous edge tree remains on `legacy-edges`. A site edge is one directory under that site's `edges/`. [docs/building-an-edge.md](docs/building-an-edge.md) is the build reference.
37
+
38
+ ### Gantries
39
+
40
+ - `001-1unit-grbl-serial`: Integrated as miniqubot.
41
+ - `002-1unit-reprap-http`: Integrated as capper, then syringequbot.
42
+ - `003-2unit-grbl-serial`: Integrated as pipqubot-mof.
43
+ - `004-4unit-reprap-http`: Integrated as pipqubot-xl.
44
+ - `005-8unit-grblhal-serial`: New frame from the gantry limits file. Intended name: Claw machine (Pick-and-place). Size is 2 by 4 units. No previous edge.
45
+ - `006-1unit-grblhal-serial`: New frame from the gantry limits file. Intended name: Dancefloor (Vacuum chamber). No previous edge.
46
+ - `007-2unit-grblhal-serial`: New frame from the gantry limits file. Intended name: Overkill2 (Liquid handling - pipette gantry). No previous edge.
47
+ - `008-1unit-grblhal-serial`: New frame from the gantry limits file. Intended name: Photoreactor (UV qubot). No previous edge. X −300 to 300 is flagged for correction. A 1-unit frame may travel at most 300 mm on X, and that range spans 600 mm. The uploaded value is unchanged.
48
+ - `009-1unit-grblhal-serial`: New frame from the gantry limits file. Intended name: EIS Qubot (Electrochemical station). No previous edge. X −300 to 300 is flagged for correction. A 1-unit frame may travel at most 300 mm on X, and that range spans 600 mm. Z −300 to 300 is the same uploaded figure and is flagged with X. The uploaded values are unchanged.
49
+
50
+ ### End effectors
51
+
52
+ - `rline-50-1000`: Integrated as pipqubot-mof, then pipqubot-xl.
53
+ - `a-axis-capper`: Integrated as pipqubot-xl.
54
+ - `autosampler-syringe`: Integrated as syringequbot.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025-2026 PUDAP
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,151 @@
1
+ Metadata-Version: 2.5
2
+ Name: qubot-drivers
3
+ Version: 0.1.0
4
+ Summary: Qubot gantry and end-effector drivers for PUDA edges.
5
+ Project-URL: Homepage, https://docs.puda.co
6
+ Project-URL: Repository, https://github.com/PUDAP/qubot
7
+ Project-URL: Changelog, https://github.com/PUDAP/qubot/blob/main/CHANGELOG.md
8
+ Author: PUDAP
9
+ License-Expression: MIT
10
+ License-File: LICENSE
11
+ Keywords: gantry,grbl,grblhal,lab automation,pipette,puda,qubot,reprap
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Science/Research
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3 :: Only
17
+ Classifier: Topic :: Scientific/Engineering
18
+ Classifier: Topic :: System :: Hardware :: Hardware Drivers
19
+ Requires-Python: >=3.11
20
+ Requires-Dist: pyserial~=3.5
21
+ Requires-Dist: websocket-client>=1.8.0
22
+ Description-Content-Type: text/markdown
23
+
24
+ # qubot
25
+
26
+ One Python package with the gantry and end-effector drivers for building a PUDA qubot edge. It is published as `qubot-drivers` and imported as `qubot`:
27
+
28
+ ```bash
29
+ pip install qubot-drivers # or: uv add qubot-drivers
30
+ ```
31
+
32
+ It holds no machine settings: each edge imports the drivers it needs and configures them in its own code. Nothing in this repository is a running edge. Agents start from the [qubot-driver skill](https://github.com/PUDAP/qubot/blob/main/skills/qubot-driver/SKILL.md). The [design](#design) section explains the split. Changes are recorded in [CHANGELOG.md](https://github.com/PUDAP/qubot/blob/main/CHANGELOG.md).
33
+
34
+ - No `MACHINE_ID`, NATS servers, host addresses, serial-device paths, frame limits, calibration, container config, or `.env`. A site edge's `.env.example` stays placeholders.
35
+ - Code lives in `src/qubot/`. One `pyproject.toml` at the root; gantries and end effectors are modules, not separate packages.
36
+ - `qubot.gantry` has the controllers (`GrblHALController`, `GrblWSController`, `RepRapHTTPController`), shared by every gantry, and `Frame`, which holds one machine's axes, hardware limits, default deck, and optional home order and firmware checks. It refuses limits outside the frame.
37
+ - `qubot.end_effector` has one driver per toolhead (`RotatingVacuumGripper`, `Chamber`, …). Calibration (servo pulses, waypoints, delays, force corrections, pipette pacing) is a constructor argument, and bad values raise.
38
+ - `qubot.geometry` has `Position`. `qubot.labware` has `StandardLabware` and `Deck`, a few bundled labware definitions, and lets each edge add its own definitions (see [Labware](#labware)).
39
+ - The [qubot-driver skill](https://github.com/PUDAP/qubot/blob/main/skills/qubot-driver/SKILL.md#reference-drivers) has a starting-point `driver.py` for each known machine, with the values from the machines built so far.
40
+ - Finished edges are not stored on `main`. For an edge built before the qubot modularization and the monorepo restructuring, use the `legacy-edges` branch.
41
+
42
+ A qubot edge's `driver.py` imports what it carries and configures it:
43
+
44
+ ```python
45
+ from puda import command, safety
46
+
47
+ from qubot.end_effector import RotatingVacuumGripper
48
+ from qubot.gantry import Frame, GrblHALController
49
+ from qubot.geometry import Position
50
+
51
+ FRAME = Frame(axes=("X", "Y", "Z"),
52
+ hardware_limits={"X": (0, 830), "Y": (-280, 0), "Z": (-240, 0)},
53
+ default_deck={"rows": 4, "cols": 8}, home_order=("Z", "X", "Y"))
54
+ GRIPPER = RotatingVacuumGripper(axis="C", yaw_pulses=[(0, 14), (-90, 124), (-180, 244)],
55
+ rotation_min_z_mm=-5, vacuum_on_delay_s=3, vacuum_off_delay_s=3)
56
+
57
+
58
+ class Driver:
59
+ """Claw machine: 8-unit grblHAL pick-and-place gantry with a rotating vacuum gripper."""
60
+
61
+ def __init__(self, gantry_port: str) -> None:
62
+ self._gantry = GrblHALController(port_name=gantry_port)
63
+ self._gantry.connect()
64
+ FRAME.apply_axis_limits(self._gantry)
65
+
66
+ def estop(self) -> bool:
67
+ self._gantry.halt()
68
+ return True
69
+
70
+ @command
71
+ @safety(summary="Collision risk from gantry motion.", hazards=["collision"], confirm=True)
72
+ def move_absolute(self, x: float | None = None, y: float | None = None, z: float | None = None) -> dict:
73
+ """Move to an absolute position in mm."""
74
+ return self._gantry.move_absolute(Position(x=x, y=y, z=z)).to_dict()
75
+ ```
76
+
77
+ ## Design
78
+
79
+ A qubot is one gantry plus the end effectors mounted on it, and that combination changes. The syringequbot frame (`002-1unit-reprap-http`) was the capper first; mounting the capper again is an import in that edge's `driver.py`, not a copy of another edge. So qubot stores only drivers that can be mixed, and each edge in the site monorepo picks and configures its own.
80
+
81
+ ```mermaid
82
+ flowchart TB
83
+ subgraph sources [qubot]
84
+ transport["qubot.gantry:<br/>grbl, grbl_ws, reprap_http controllers"]
85
+ gantry["qubot.gantry.Frame:<br/>axes, limit checks, deck slots"]
86
+ effector["qubot.end_effector.name:<br/>protocol, takes calibration as arguments"]
87
+ geometry["qubot.geometry, qubot.labware:<br/>Position, Deck, labware definitions"]
88
+ end
89
+ config["edge driver.py:<br/>Frame and calibration constants, Driver with @command and @safety"]
90
+ transport --> config
91
+ gantry --> config
92
+ effector --> config
93
+ geometry --> config
94
+ subgraph built [site monorepo edges]
95
+ module["edge main.py:<br/>Config with MACHINE_ID, NATS, ports"]
96
+ edge["edge:<br/>directory name, pinned qubot-drivers, local .env"]
97
+ module --> edge
98
+ end
99
+ config --> module
100
+ ```
101
+
102
+ ## Supported hardware
103
+
104
+ ### Gantry controllers
105
+
106
+ | Controller | Import | Firmware and link | Used on |
107
+ |---|---|---|---|
108
+ | `GrblHALController` | `from qubot.gantry import GrblHALController` | GRBL 1.1 and grblHAL over USB serial. Feed-hold with realtime `!`. | miniqubot, pipqubot-mof, claw-machine, dancefloor, overkill2, photoreactor, eis-qubot |
109
+ | `GrblWSController` | `from qubot.gantry import GrblWSController` | GRBL over WebSocket (`ws://<host>:81`). | grblHAL gantries with a network board |
110
+ | `RepRapHTTPController` | `from qubot.gantry import RepRapHTTPController` | RepRapFirmware over HTTP (`rr_gcode`, `rr_status`). Supports `set_pin`. | syringequbot, pipqubot-xl |
111
+
112
+ Each controller is paired with a `Frame` (`from qubot.gantry import Frame`) that holds the machine's axes, travel, and deck. The defining modules (`qubot.gantry.grbl`, …) still work as import paths; the short form is preferred.
113
+
114
+ ### End effectors
115
+
116
+ | End effector | Import | What it is | Link | Used on |
117
+ |---|---|---|---|---|
118
+ | Sartorius rLine 50-1000 µL | `from qubot.end_effector import rline_50_1000`, then `rline_50_1000.connect(port)` | Pipette, 2.5 µL/step, six preset speeds. | Serial | pipqubot-mof, pipqubot-xl |
119
+ | Sartorius rLine 50-1000 µL, multistep | `from qubot.end_effector import rline_50_1000_multistep` | Same pipette, with any aspirate/dispense speed up to 1120 µL/s made from paced preset moves. | Serial | overkill2 |
120
+ | A-axis capper | `from qubot.end_effector import Capper` | Capping tool driven by gantry axis A. | Gantry axis | pipqubot-xl |
121
+ | Autosampler syringe | `from qubot.end_effector import narrow_z` | Passive syringe; narrows Z travel by its length. Liquid handling is on a separate pump edge. | None | syringequbot |
122
+ | Rotating vacuum gripper | `from qubot.end_effector import RotatingVacuumGripper` | Vacuum cup (coolant valve) and yaw servo (spindle PWM). | Gantry GRBL port | claw-machine |
123
+ | Vacuum chamber | `from qubot.end_effector import Chamber` | Chamber valve and lid waypoints, with closed/vented interlocks. | Gantry GRBL port | dancefloor |
124
+ | Orion 4-channel LED | `from qubot.end_effector import LedBoard` | Four-channel UV LED board, write-only line protocol. | Serial, 9600 baud | photoreactor |
125
+ | Parallel force actuators | `from qubot.end_effector import ParallelFingers` | Linear actuators with force sensing, one port each. | Serial, 115200 baud | eis-qubot |
126
+
127
+ The two rLine pipettes are imported as modules because both define `connect` and `SatoriusController`. Lower-level pieces: `qubot.end_effector.satorius` / `satorius_multistep` (`SatoriusController`), `RLineModel` and `RLINE_SPECS` (rLine 5-200, 50-1000, 100-5000 µL spec table, `from qubot.end_effector import RLineModel`), and `qubot.serialcontroller` (`SerialController` base).
128
+
129
+ ## Labware
130
+
131
+ ```python
132
+ from qubot.labware import Deck, StandardLabware
133
+
134
+ deck = Deck.from_frame(FRAME, labware_paths=[Path(__file__).parent / "labware"])
135
+ deck.load_labware("A1", "opentrons_96_tiprack_300ul") # bundled
136
+ deck.load_labware("B1", "my_reservoir") # edges/<one-qubot>/labware/my_reservoir.json
137
+ deck.load_labware("A2", StandardLabware.from_definition("probe_block", definition_dict))
138
+ ```
139
+
140
+ Definitions are Opentrons-style JSON (`wells`, `ordering`, `dimensions`) plus `insert_depth`. Loading by name searches the edge's `labware_paths` first, then the bundled `qubot/labware/definitions/`, so an edge can add new labware or override a bundled one without changing qubot. `get_available_labware(paths)` lists both. Bundled: `opentrons_96_tiprack_300ul`, `sartorious_96_tiprack_1000ul`, `polyelectric_96_wellplate_330ul`, `polyelectric_8_wellplate_30000ul`, `bioshake`, `MEA_cell_MTP`, `trash_bin_mof`, `trash_bin_create`.
141
+
142
+ ## Build a site edge
143
+
144
+ Follow the [qubot-driver skill](https://github.com/PUDAP/qubot/blob/main/skills/qubot-driver/SKILL.md): answer its edge checklist, scaffold from [edge-python-template](https://github.com/PUDAP/edge-python-template), pin `qubot-drivers` (a release, or `qubot-drivers @ git+https://github.com/PUDAP/qubot@<ref>`), and start `driver.py` from the matching reference driver. The edge lives in the site monorepo's `edges/`, not in this repository. Build only when that machine is allowed to move.
145
+
146
+ ## Offline checks
147
+
148
+ ```bash
149
+ uv sync --group dev
150
+ uv run pytest
151
+ ```
@@ -0,0 +1,128 @@
1
+ # qubot
2
+
3
+ One Python package with the gantry and end-effector drivers for building a PUDA qubot edge. It is published as `qubot-drivers` and imported as `qubot`:
4
+
5
+ ```bash
6
+ pip install qubot-drivers # or: uv add qubot-drivers
7
+ ```
8
+
9
+ It holds no machine settings: each edge imports the drivers it needs and configures them in its own code. Nothing in this repository is a running edge. Agents start from the [qubot-driver skill](https://github.com/PUDAP/qubot/blob/main/skills/qubot-driver/SKILL.md). The [design](#design) section explains the split. Changes are recorded in [CHANGELOG.md](https://github.com/PUDAP/qubot/blob/main/CHANGELOG.md).
10
+
11
+ - No `MACHINE_ID`, NATS servers, host addresses, serial-device paths, frame limits, calibration, container config, or `.env`. A site edge's `.env.example` stays placeholders.
12
+ - Code lives in `src/qubot/`. One `pyproject.toml` at the root; gantries and end effectors are modules, not separate packages.
13
+ - `qubot.gantry` has the controllers (`GrblHALController`, `GrblWSController`, `RepRapHTTPController`), shared by every gantry, and `Frame`, which holds one machine's axes, hardware limits, default deck, and optional home order and firmware checks. It refuses limits outside the frame.
14
+ - `qubot.end_effector` has one driver per toolhead (`RotatingVacuumGripper`, `Chamber`, …). Calibration (servo pulses, waypoints, delays, force corrections, pipette pacing) is a constructor argument, and bad values raise.
15
+ - `qubot.geometry` has `Position`. `qubot.labware` has `StandardLabware` and `Deck`, a few bundled labware definitions, and lets each edge add its own definitions (see [Labware](#labware)).
16
+ - The [qubot-driver skill](https://github.com/PUDAP/qubot/blob/main/skills/qubot-driver/SKILL.md#reference-drivers) has a starting-point `driver.py` for each known machine, with the values from the machines built so far.
17
+ - Finished edges are not stored on `main`. For an edge built before the qubot modularization and the monorepo restructuring, use the `legacy-edges` branch.
18
+
19
+ A qubot edge's `driver.py` imports what it carries and configures it:
20
+
21
+ ```python
22
+ from puda import command, safety
23
+
24
+ from qubot.end_effector import RotatingVacuumGripper
25
+ from qubot.gantry import Frame, GrblHALController
26
+ from qubot.geometry import Position
27
+
28
+ FRAME = Frame(axes=("X", "Y", "Z"),
29
+ hardware_limits={"X": (0, 830), "Y": (-280, 0), "Z": (-240, 0)},
30
+ default_deck={"rows": 4, "cols": 8}, home_order=("Z", "X", "Y"))
31
+ GRIPPER = RotatingVacuumGripper(axis="C", yaw_pulses=[(0, 14), (-90, 124), (-180, 244)],
32
+ rotation_min_z_mm=-5, vacuum_on_delay_s=3, vacuum_off_delay_s=3)
33
+
34
+
35
+ class Driver:
36
+ """Claw machine: 8-unit grblHAL pick-and-place gantry with a rotating vacuum gripper."""
37
+
38
+ def __init__(self, gantry_port: str) -> None:
39
+ self._gantry = GrblHALController(port_name=gantry_port)
40
+ self._gantry.connect()
41
+ FRAME.apply_axis_limits(self._gantry)
42
+
43
+ def estop(self) -> bool:
44
+ self._gantry.halt()
45
+ return True
46
+
47
+ @command
48
+ @safety(summary="Collision risk from gantry motion.", hazards=["collision"], confirm=True)
49
+ def move_absolute(self, x: float | None = None, y: float | None = None, z: float | None = None) -> dict:
50
+ """Move to an absolute position in mm."""
51
+ return self._gantry.move_absolute(Position(x=x, y=y, z=z)).to_dict()
52
+ ```
53
+
54
+ ## Design
55
+
56
+ A qubot is one gantry plus the end effectors mounted on it, and that combination changes. The syringequbot frame (`002-1unit-reprap-http`) was the capper first; mounting the capper again is an import in that edge's `driver.py`, not a copy of another edge. So qubot stores only drivers that can be mixed, and each edge in the site monorepo picks and configures its own.
57
+
58
+ ```mermaid
59
+ flowchart TB
60
+ subgraph sources [qubot]
61
+ transport["qubot.gantry:<br/>grbl, grbl_ws, reprap_http controllers"]
62
+ gantry["qubot.gantry.Frame:<br/>axes, limit checks, deck slots"]
63
+ effector["qubot.end_effector.name:<br/>protocol, takes calibration as arguments"]
64
+ geometry["qubot.geometry, qubot.labware:<br/>Position, Deck, labware definitions"]
65
+ end
66
+ config["edge driver.py:<br/>Frame and calibration constants, Driver with @command and @safety"]
67
+ transport --> config
68
+ gantry --> config
69
+ effector --> config
70
+ geometry --> config
71
+ subgraph built [site monorepo edges]
72
+ module["edge main.py:<br/>Config with MACHINE_ID, NATS, ports"]
73
+ edge["edge:<br/>directory name, pinned qubot-drivers, local .env"]
74
+ module --> edge
75
+ end
76
+ config --> module
77
+ ```
78
+
79
+ ## Supported hardware
80
+
81
+ ### Gantry controllers
82
+
83
+ | Controller | Import | Firmware and link | Used on |
84
+ |---|---|---|---|
85
+ | `GrblHALController` | `from qubot.gantry import GrblHALController` | GRBL 1.1 and grblHAL over USB serial. Feed-hold with realtime `!`. | miniqubot, pipqubot-mof, claw-machine, dancefloor, overkill2, photoreactor, eis-qubot |
86
+ | `GrblWSController` | `from qubot.gantry import GrblWSController` | GRBL over WebSocket (`ws://<host>:81`). | grblHAL gantries with a network board |
87
+ | `RepRapHTTPController` | `from qubot.gantry import RepRapHTTPController` | RepRapFirmware over HTTP (`rr_gcode`, `rr_status`). Supports `set_pin`. | syringequbot, pipqubot-xl |
88
+
89
+ Each controller is paired with a `Frame` (`from qubot.gantry import Frame`) that holds the machine's axes, travel, and deck. The defining modules (`qubot.gantry.grbl`, …) still work as import paths; the short form is preferred.
90
+
91
+ ### End effectors
92
+
93
+ | End effector | Import | What it is | Link | Used on |
94
+ |---|---|---|---|---|
95
+ | Sartorius rLine 50-1000 µL | `from qubot.end_effector import rline_50_1000`, then `rline_50_1000.connect(port)` | Pipette, 2.5 µL/step, six preset speeds. | Serial | pipqubot-mof, pipqubot-xl |
96
+ | Sartorius rLine 50-1000 µL, multistep | `from qubot.end_effector import rline_50_1000_multistep` | Same pipette, with any aspirate/dispense speed up to 1120 µL/s made from paced preset moves. | Serial | overkill2 |
97
+ | A-axis capper | `from qubot.end_effector import Capper` | Capping tool driven by gantry axis A. | Gantry axis | pipqubot-xl |
98
+ | Autosampler syringe | `from qubot.end_effector import narrow_z` | Passive syringe; narrows Z travel by its length. Liquid handling is on a separate pump edge. | None | syringequbot |
99
+ | Rotating vacuum gripper | `from qubot.end_effector import RotatingVacuumGripper` | Vacuum cup (coolant valve) and yaw servo (spindle PWM). | Gantry GRBL port | claw-machine |
100
+ | Vacuum chamber | `from qubot.end_effector import Chamber` | Chamber valve and lid waypoints, with closed/vented interlocks. | Gantry GRBL port | dancefloor |
101
+ | Orion 4-channel LED | `from qubot.end_effector import LedBoard` | Four-channel UV LED board, write-only line protocol. | Serial, 9600 baud | photoreactor |
102
+ | Parallel force actuators | `from qubot.end_effector import ParallelFingers` | Linear actuators with force sensing, one port each. | Serial, 115200 baud | eis-qubot |
103
+
104
+ The two rLine pipettes are imported as modules because both define `connect` and `SatoriusController`. Lower-level pieces: `qubot.end_effector.satorius` / `satorius_multistep` (`SatoriusController`), `RLineModel` and `RLINE_SPECS` (rLine 5-200, 50-1000, 100-5000 µL spec table, `from qubot.end_effector import RLineModel`), and `qubot.serialcontroller` (`SerialController` base).
105
+
106
+ ## Labware
107
+
108
+ ```python
109
+ from qubot.labware import Deck, StandardLabware
110
+
111
+ deck = Deck.from_frame(FRAME, labware_paths=[Path(__file__).parent / "labware"])
112
+ deck.load_labware("A1", "opentrons_96_tiprack_300ul") # bundled
113
+ deck.load_labware("B1", "my_reservoir") # edges/<one-qubot>/labware/my_reservoir.json
114
+ deck.load_labware("A2", StandardLabware.from_definition("probe_block", definition_dict))
115
+ ```
116
+
117
+ Definitions are Opentrons-style JSON (`wells`, `ordering`, `dimensions`) plus `insert_depth`. Loading by name searches the edge's `labware_paths` first, then the bundled `qubot/labware/definitions/`, so an edge can add new labware or override a bundled one without changing qubot. `get_available_labware(paths)` lists both. Bundled: `opentrons_96_tiprack_300ul`, `sartorious_96_tiprack_1000ul`, `polyelectric_96_wellplate_330ul`, `polyelectric_8_wellplate_30000ul`, `bioshake`, `MEA_cell_MTP`, `trash_bin_mof`, `trash_bin_create`.
118
+
119
+ ## Build a site edge
120
+
121
+ Follow the [qubot-driver skill](https://github.com/PUDAP/qubot/blob/main/skills/qubot-driver/SKILL.md): answer its edge checklist, scaffold from [edge-python-template](https://github.com/PUDAP/edge-python-template), pin `qubot-drivers` (a release, or `qubot-drivers @ git+https://github.com/PUDAP/qubot@<ref>`), and start `driver.py` from the matching reference driver. The edge lives in the site monorepo's `edges/`, not in this repository. Build only when that machine is allowed to move.
122
+
123
+ ## Offline checks
124
+
125
+ ```bash
126
+ uv sync --group dev
127
+ uv run pytest
128
+ ```
@@ -0,0 +1,41 @@
1
+ [project]
2
+ name = "qubot-drivers"
3
+ version = "0.1.0"
4
+ description = "Qubot gantry and end-effector drivers for PUDA edges."
5
+ readme = "README.md"
6
+ license = "MIT"
7
+ license-files = ["LICENSE"]
8
+ authors = [{ name = "PUDAP" }]
9
+ keywords = ["puda", "qubot", "gantry", "grbl", "grblhal", "reprap", "lab automation", "pipette"]
10
+ classifiers = [
11
+ "Development Status :: 3 - Alpha",
12
+ "Intended Audience :: Science/Research",
13
+ "Operating System :: OS Independent",
14
+ "Programming Language :: Python :: 3",
15
+ "Programming Language :: Python :: 3 :: Only",
16
+ "Topic :: Scientific/Engineering",
17
+ "Topic :: System :: Hardware :: Hardware Drivers",
18
+ ]
19
+ requires-python = ">=3.11"
20
+ dependencies = [
21
+ "pyserial~=3.5",
22
+ "websocket-client>=1.8.0",
23
+ ]
24
+
25
+ [project.urls]
26
+ Homepage = "https://docs.puda.co"
27
+ Repository = "https://github.com/PUDAP/qubot"
28
+ Changelog = "https://github.com/PUDAP/qubot/blob/main/CHANGELOG.md"
29
+
30
+ [build-system]
31
+ requires = ["hatchling>=1.26"]
32
+ build-backend = "hatchling.build"
33
+
34
+ [tool.hatch.build.targets.wheel]
35
+ packages = ["src/qubot"]
36
+
37
+ [dependency-groups]
38
+ dev = ["pytest>=9.0.2"]
39
+
40
+ [tool.pytest.ini_options]
41
+ testpaths = ["tests"]