Skip to content

PeristalticPumps

Description

Represents a set of peristaltic pumps attached to the Jubilee system.

Each pump can be individually calibrated based on its steps per milliliter setting. This class assumes a dedicated motion axis (e.g., 'E') for the pumps.

Note: Due to Duet firmware axis definition limitations, a PumpDispenser tool is often required alongside this class to fully control pump usage.

Extends the base Tool class.

Constructor

python
PeristalticPumps(
    n_pumps: int,
    steps_per_ml: Union[float, int, list],
    tool_axis: str = "E",
    name: str = "dispenser_pumps"
)
ParameterTypeDescription
n_pumpsintNumber of pumps being used.
steps_per_mlfloat, int, or listCalibration: motor steps needed to dispense 1 mL. (One value or per-pump list)
tool_axisstrMotion axis defined in Duet configuration (default: 'E').
namestrName of the tool for identification purposes (default: 'dispenser_pumps').

Key Properties

PropertyTypeDescription
tool_axisstrMachine axis assigned to the pump array.
n_pumpsintNumber of installed pumps.
namestrName of the tool.
steps_per_mlList[float]Calibration values for each pump.

Important Methods

MethodReturnsDescription
post_load()NoneAutomatically configures the pump calibration into the machine (G-code M92).
pump(volume)NoneDispense a specified volume of liquid, either equally or customized per pump.
from_config(config_file, path)PeristalticPumpsInstantiate a pump object from a JSON configuration file.

Method Details

post_load()

python
post_load()

After loading the tool onto the machine, this method sends a G-code command to set the correct steps per mL calibration for each pump.

  • G-code: M92 <axis><steps>:<steps>:...
  • Typically auto-called after tool loading.

pump()

python
pump(volume: Union[int, float, list])

Dispenses a desired amount of liquid through the pumps.

ParameterTypeDescription
volumeint, float, or listVolume (in mL) to dispense. Single number applies equally to all pumps; list allows specifying per-pump volumes.

Safety: Pump movement is simple extrusion and won't crash the deck, but check flow rates carefully for delicate samples.

from_config()

python
@classmethod
from_config(config_file: str, path: str)

Loads a pump configuration directly from a JSON file.

The JSON should include fields such as:

json
{
  "n_pumps": 3,
  "steps_per_ml": [1250, 1245, 1260],
  "tool_axis": "E",
  "name": "my_pumps"
}

Example usage:

python
pumps = PeristalticPumps.from_config("my_pump_config.json")

Usage Flow Example

python
from science_jubilee.tools import PeristalticPumps

# Load pumps from config file
pumps = PeristalticPumps.from_config("my_pump_config.json")

# Attach to machine
m.load_tool(pumps)
m.pickup_tool(pumps)

# Dispense 5mL equally from all pumps
pumps.pump(volume=5)

# Dispense different volumes per pump
pumps.pump(volume=[5, 10, 7])

Important Notes

  • The pump system assumes that axis control is free of mechanical crash risks (no X/Y movement involved).
  • Steps per mL must be calibrated manually using weight/volume measurements for accuracy.
  • Uneven volume distribution is allowed if volume is provided as a list.
  • G-code is sent directly (G1) for volumetric control; no motion planning is needed.
  • Be careful if redefining tool_axis in nonstandard setups (like multiple pump banks).

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