Skip to content

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.

ParameterTypeDescription
portstr (optional)Serial port for connection (currently unused, placeholder).
baudrateint (optional)Baudrate for serial communication (default 115200).
addressstr (optional)IP address of the Jubilee controller.
deck_configstr (optional)Name of the deck configuration file to load.
simulatedbool (optional)If True, simulates behavior without actual machine connection.

Key Properties

PropertyTypeDescription
configured_axeslistList of machine axes ('X', 'Y', 'Z', 'U', etc.).
configured_toolsdictMapping of tool indices to tool names.
active_tool_indexintCurrent active tool index (-1 if none).
tool_z_offsetsdictTool-specific Z-offsets.
axis_limitslistAxis limit ranges (min, max) for X, Y, Z, U.
deckDeckThe currently loaded Deck configuration.
positionlistCurrent X, Y, Z machine coordinates.

Important Decorators

DecoratorPurpose
@machine_homedEnsures machine is homed before running a command.
@requires_deckEnsures a deck is loaded before running a command.
@requires_safe_zEnsures Z axis is raised to a safe height before certain actions.

Important Methods

MethodReturnsDescription
connect()NoneConnects to the machine via HTTP.
home_all()NoneHomes all primary axes (X, Y, Z, U).
move_to(x, y, z, ...)NoneMoves to an absolute X/Y/Z coordinate.
move(dx, dy, dz, ...)NoneMoves relative to the current position.
pickup_tool(tool_id)NonePicks up a specific tool (index, name, or Tool object).
park_tool()NoneParks the current tool.
gcode(cmd)strSends a raw G-Code command.
load_labware(labware_filename, slot, ...)LabwareLoads and attaches labware into the deck.
reset()NoneResets and reconnects to the machine controller.
dwell(t)NonePauses 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.

Pre-release documentation · Internal research use only · Not authorized for redistribution.