Machine
Description
Represents the Jubilee hardware interface controller. Handles motion commands, connection management, tool control, deck loading, labware loading, and state caching. Communicates with the machine primarily over HTTP (or serial simulation mode).
Constructor
python
Machine(
port: str = None,
baudrate: int = 115200,
address: str = None,
deck_config: str = None,
simulated: bool = False,
)Initializes the Machine object, sets up communication channels, and optionally loads a deck.
| Parameter | Type | Description |
|---|---|---|
port | str (optional) | Serial port for connection (currently unused, placeholder). |
baudrate | int (optional) | Baudrate for serial communication (default 115200). |
address | str (optional) | IP address of the Jubilee controller. |
deck_config | str (optional) | Name of the deck configuration file to load. |
simulated | bool (optional) | If True, simulates behavior without actual machine connection. |
Key Properties
| Property | Type | Description |
|---|---|---|
configured_axes | list | List of machine axes ('X', 'Y', 'Z', 'U', etc.). |
configured_tools | dict | Mapping of tool indices to tool names. |
active_tool_index | int | Current active tool index (-1 if none). |
tool_z_offsets | dict | Tool-specific Z-offsets. |
axis_limits | list | Axis limit ranges (min, max) for X, Y, Z, U. |
deck | Deck | The currently loaded Deck configuration. |
position | list | Current X, Y, Z machine coordinates. |
Important Decorators
| Decorator | Purpose |
|---|---|
@machine_homed | Ensures machine is homed before running a command. |
@requires_deck | Ensures a deck is loaded before running a command. |
@requires_safe_z | Ensures Z axis is raised to a safe height before certain actions. |
Important Methods
| Method | Returns | Description |
|---|---|---|
connect() | None | Connects to the machine via HTTP. |
home_all() | None | Homes all primary axes (X, Y, Z, U). |
move_to(x, y, z, ...) | None | Moves to an absolute X/Y/Z coordinate. |
move(dx, dy, dz, ...) | None | Moves relative to the current position. |
pickup_tool(tool_id) | None | Picks up a specific tool (index, name, or Tool object). |
park_tool() | None | Parks the current tool. |
gcode(cmd) | str | Sends a raw G-Code command. |
load_labware(labware_filename, slot, ...) | Labware | Loads and attaches labware into the deck. |
reset() | None | Resets and reconnects to the machine controller. |
dwell(t) | None | Pauses machine movement for a specified time. |
Short Example
python
# Connect and initialize
m = Machine(address="192.168.1.2", deck_config="standard_deck")
# Home the machine
m.home_all()
# Load a labware and physically install it
m.load_labware("falcon_96_wellplate_360ul_flat", slot=1)
# Move to a safe Z height
m.move_to(z=150)
# Park tool after operations
m.park_tool()Important Notes
- Connection Handling: If HTTP connection fails, fallback attempts are automatically retried.
- Safe Movement: Most movement operations automatically handle safe Z behavior to avoid labware collisions.
- Caching: Machine properties like axes, tools, and tool offsets are cached after connection for speed.
- Simulated Mode: Useful for testing without real hardware.
- Keyboard Interrupts: May leave machine in inconsistent tool state (needs future improvement).
- G-code Interface: Most low-level motion is controlled by sending G-Code strings to the Duet controller.