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
PeristalticPumps(
n_pumps: int,
steps_per_ml: Union[float, int, list],
tool_axis: str = "E",
name: str = "dispenser_pumps"
)| Parameter | Type | Description |
|---|---|---|
n_pumps | int | Number of pumps being used. |
steps_per_ml | float, int, or list | Calibration: motor steps needed to dispense 1 mL. (One value or per-pump list) |
tool_axis | str | Motion axis defined in Duet configuration (default: 'E'). |
name | str | Name of the tool for identification purposes (default: 'dispenser_pumps'). |
Key Properties
| Property | Type | Description |
|---|---|---|
tool_axis | str | Machine axis assigned to the pump array. |
n_pumps | int | Number of installed pumps. |
name | str | Name of the tool. |
steps_per_ml | List[float] | Calibration values for each pump. |
Important Methods
| Method | Returns | Description |
|---|---|---|
post_load() | None | Automatically configures the pump calibration into the machine (G-code M92). |
pump(volume) | None | Dispense a specified volume of liquid, either equally or customized per pump. |
from_config(config_file, path) | PeristalticPumps | Instantiate a pump object from a JSON configuration file. |
Method Details
post_load()
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()
pump(volume: Union[int, float, list])Dispenses a desired amount of liquid through the pumps.
| Parameter | Type | Description |
|---|---|---|
volume | int, float, or list | Volume (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()
@classmethod
from_config(config_file: str, path: str)Loads a pump configuration directly from a JSON file.
The JSON should include fields such as:
{
"n_pumps": 3,
"steps_per_ml": [1250, 1245, 1260],
"tool_axis": "E",
"name": "my_pumps"
}Example usage:
pumps = PeristalticPumps.from_config("my_pump_config.json")Usage Flow Example
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
volumeis provided as a list. - G-code is sent directly (
G1) for volumetric control; no motion planning is needed. - Be careful if redefining
tool_axisin nonstandard setups (like multiple pump banks).