Reaction-aware autonomous batch synthesis for ZIF-67 crystallization using robotic liquid handling, in situ UVβVis spectroscopy, and adaptive Bayesian optimization
This repository contains the software, analysis workflows, and supporting assets for Axo, a modular autonomous platform for solution-phase batch synthesis. The platform integrates robotic reagent delivery, programmable tool changing, cyclic in situ UVβVis measurements, kinetic model fitting, and reaction-aware Bayesian optimization to co-optimize what formulation to test and how the experiment should be executed.
- Adaptive scheduling:
- Throughput-prioritized exploration: 5-vial batch, 15 min measurement interval
- Measurement-prioritized refinement: 2-vial batch, 5 min measurement interval
- Reaction-aware trigger: Switch modes automatically when early reaction progress exceeds a threshold
- Flexible approval modes: Manual (interactive) or automatic (fully autonomous)
- State persistence: Resume interrupted runs from checkpoints
- Robotic liquid handling: Precise dispensing with single/dual syringe systems
- In situ monitoring: Cyclic UVβVis spectroscopy integrated into the batch synthesis workflow
- Autonomous mixing: Automated mixing and reaction control
- Programmable multi-vial workflows: Batch synthesis and cyclic monitoring across multiple reaction vials
- Gualtieri kinetic fitting: Automated MOF growth curve analysis
- Reaction-progress extraction: Automatic extraction of extent of reaction
Ξ±(t)and nucleation rate constantk_n - Gaussian Process modeling: Uncertainty-aware surrogate models
- Expected Improvement: Efficient exploration-exploitation balance
- Comprehensive logging: Experiment metadata, synthesis recipes, operation logs, reference spectra, and time-resolved UVβVis outputs
- Error handling: Graceful handling of excluded or failed fits (
no_reaction,no_target_feature) - Hardware safety: Homing checks, collision avoidance, safe Z movements
- Configuration management: JSON-based hardware and experiment configs
- System Architecture
- Installation
- Hardware Requirements
- Quick Start
- Usage
- Project Structure
- Documentation
- Testing
The platform is organized into four main abstraction layers:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Experiment Layer β
β High-level workflows, BO orchestration, kinetic analysis β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Deck & Labware Layer β
β Spatial management, well positions, volume tracking β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Tool Layer β
β Single Syringe, Dual Syringe, Spectrometer, Gripper β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Machine Layer β
β G-code execution, motion control, hardware interface β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Communication: HTTP REST API to Duet 3 controller (RepRapFirmware)
- Python: 3.8 or higher
- Hardware: Modified Jubilee 3D printer with Duet 3 controller
- Network: Local network connection to Jubilee (default: 192.168.1.2)
Install required Python packages:
# Core scientific computing
pip install numpy scipy scikit-learn pandas
# Visualization
pip install matplotlib python-ternary
# Optional: Jupyter for notebook interface
pip install jupyter-
Clone the repository:
git clone <repository-url> cd Axo_MOF
-
Install the package (optional, for development):
cd Code pip install -e .
-
Verify installation:
python -c "import numpy, scipy, sklearn, matplotlib; print('β Dependencies OK')"
- Jubilee 3D printer (modified for lab automation)
- Duet 3 controller running RepRapFirmware
- Network connection (Ethernet or WiFi)
- T0: Single syringe (precise liquid dispensing)
- T2: Dual syringe (parallel dispensing)
- T3: Ocean Optics spectrometer (UV-Vis, 200-1100 nm)
- T4: Vacuum gripper (lid handling)
- SLAS-standard microplates (6-slot deck)
- 10-well sample vials (14 mL capacity)
- 2-well precursor reservoirs (60 mL capacity)
optimization with manual approval:
cd Code
python run_bo_optimization.py --new --approval-mode manualFully autonomous (automatic mode transitions):
python run_bo_optimization.py --new --approval-mode automatictraditional BO:
python run_bo_optimization.py --new --phases single --batch-size 5 --max-iterations 20Resume interrupted run:
python run_bo_optimization.py --resumecd Code
jupyter notebook multi_phase_bo_orchestration.ipynbThe notebook provides:
- Step-by-step hardware initialization
- Interactive configuration
- In situ monitoring
- Built-in visualization and analysis
The system runs through two optimization modes:
| Mode | Goal | Batch Size | Measurement Interval (min) | Exploration (xi) |
|---|---|---|---|---|
| Exploration | Broad screening | 5 | 15 | 0.01 |
| Refinement | Focused optimization | 2 | 5 | 0.01 |
Mode Transition Criteria:
- Switch from exploration to refinement when any sample reaches early reaction progress
Ξ±(t1) > 0.5
python run_bo_optimization.py [OPTIONS]
Required (choose one):
--new Start new optimization
--resume Resume from saved state
Multi-Phase Options:
--approval-mode {manual,automatic}
Phase transition approval mode (default: manual)
--phases {multi,single}
Phase configuration (default: multi)
Single-Phase Options (ignored in multi-phase):
--batch-size N Experiments per batch (default: 5)
--max-iterations N Maximum iterations (default: 20)
General Options:
--output-dir DIR Output directory (default: optimization_results)
--operator NAME Operator name (default: Operator)# Start new multi-phase optimization with manual approval
python run_bo_optimization.py --new --approval-mode manual --operator "Alice"
# System will:
# 1. Generate 5 initial samples (maximin sampling)
# 2. Prompt you to load vials
# 3. Run automated synthesis + spectroscopy
# 4. Extract kinetic descriptors using Gualtieri fitting
# 5. Update GP model
# 6. Enter exploration phase (5 vials, 15 min interval)
# 7. Prompt for approval when criteria met
# 8. Transition to refinement phase (2 vials, 5 min interval)
# 9. Converge and report optimal conditionsSee multi_phase_bo_orchestration.ipynb for:
- Interactive hardware setup and calibration
- Configuration with validation
- Progress visualization
- Post-optimization analysis and plotting
Axo_MOF/
βββ Code/
β βββ src/
β β βββ science_jubilee/
β β βββ Machine.py # Core machine controller
β β βββ Experiment.py # High-level experiment workflows
β β βββ tools/ # Tool implementations
β β β βββ Syringe.py
β β β βββ Double_Syringe.py
β β β βββ Oceandirect_axo.py # Spectrometer
β β β βββ Vacuum_Gripper.py
β β βββ labware/ # Labware definitions
β β βββ decks/ # Deck configurations
β β βββ analysis/ # Data analysis modules
β β β βββ gualtieri.py # Kinetic fitting
β β βββ optimization/ # Bayesian optimization
β β β βββ bayesian.py # GP modeling, EI
β β β βββ sampling.py # Initial sampling
β β β βββ phase_config.py # Phase definitions
β β β βββ phase_manager.py # Phase transitions
β β β βββ orchestrator.py # Main BO loop
β β β βββ convergence.py # Stopping criteria
β β β βββ notifications.py # User interface
β β β βββ logging_config.py # Structured logging
β β βββ utils/
β β βββ synthesis_plan.py # Experiment plan generation
β β
β βββ bayesian.ipynb # BO analysis and visualization
β βββ draft_synthesis_plan.json # Example synthesis-plan configuration
β βββ gualtieri.ipynb # Kinetic fitting workflow
β βββ mof_synthesis.ipynb # Manual synthesis workflows
β βββ multi_phase_bo_orchestration.ipynb # Interactive orchestration notebook
β βββ run_bo_optimization.py # Main CLI entry point
β βββ sampling.ipynb # Initial/maximin sampling workflow
|
βββ Dataset/ # Experimental data
β βββ {experiment_name}_{timestamp}/
β βββ references/ # Background/reference spectra
β βββ spectra/ # Time-resolved spectral outputs
β βββ experiment_metadata.json # Experiment-level metadata
β βββ mof_recipes.json # Per-vial synthesis recipes
β βββ operations_log.txt # Chronological robotic execution log
β
βββ README.md # This file
- Quick Start Notebook: Interactive guide for running experiments
- mof_synthesis.ipynb: Manual synthesis workflows and calibration
- bayesian.ipynb: BO analysis and visualization
- gualtieri.ipynb: Spectral analysis and kinetic fitting
- sampling.ipynb: Initial space-filling / maximin sampling
-
Dry run (test communication, no synthesis):
python run_bo_optimization.py --new --phases single --batch-size 1 --max-iterations 1 # Press Ctrl+C when prompted to load vials -
Single iteration (full workflow test):
python run_bo_optimization.py --new --phases single --batch-size 2 --max-iterations 1
-
Multi-phase test:
python run_bo_optimization.py --new --approval-mode manual