Examples
This section collects end-to-end, copy-pasteable examples for common Science Jubilee workflows — from basic machine setup to full protocols like gel printing.
Examples are written for scientists first and assume only minimal Python experience. Each one shows exactly what to import, what order to run cells in, and where to be careful with the physical machine.
How example pages are structured
Every example follows the same pattern so you can skim quickly and run it in a notebook or .py script:
Overview What you will accomplish (e.g., “3D gel printing with a syringe extruder”) and when to use this pattern.
Initial Setup How to connect to the machine (
Machine(address=...)), home axes, and clear the build area. Unsafe operations are clearly marked.Hardware / Tool Preparation Any physical steps needed (loading syringes, placing plates, checking
config.gtool indices) alongside the matching Python setup code.Calibration & Safety-Critical Steps Guided procedures for things like Z-offset calibration, with explicit comments to go slowly and avoid collisions.
Core Script The main code that performs the task: printing, moving, pipetting, or running G-code.
Cleanup Parking tools, moving to a safe Z, and any post-run checks.
Where appropriate, we call out simulation options (Machine(simulated=True)) so you can test without hardware.
WARNING
Always read an example all the way through before running it on a real machine, and adapt coordinates, tool indices, and file names to your own setup.
Example catalog
Getting started
These examples are ideal for your first session with a Jubilee machine.
Basic Machine Setup & Homing Connect to a Jubilee, home axes, inspect
configured_axes, and verify motion with small test moves.Deck & Labware Walkthrough Load a
deck_config, place a test plate, and exploreDeck,Labware,Well, andLocationobjects.
Tooling & extrusion
Examples that use specific tools such as syringe extruders or other end effectors.
Gel Printing with Syringe Extruder Full workflow for 3D gel printing: load a syringe tool, calibrate Z offset, prime the nozzle, stream G-code, and park the tool safely.
Custom Extrusion Toolpaths Scripted extrusion paths (e.g., raised test cubes) using high-level motion commands instead of pre-generated G-code.
G-code and advanced control
Examples for users who want more control or need to debug motion.
Streaming G-code from a File Load a
.gcodefile from disk, filter comments, and send commands line-by-line viaMachine.gcode()with basic error handling.Inline G-code for Fine Control Mix high-level
move_to/movecalls with direct G-code for commands that are not yet wrapped in the Python API.
Simulation and testing
Examples to help you develop safely without hardware.
Running in Simulated Mode Use
Machine(simulated=True)to test scripts, log commands, and prototype protocols with no physical motion.Dry-Run a Protocol Execute a full script in simulation, record moves and tool changes, and review them before using a real machine.
(Additional examples will appear here as they are added to the knowledge base.)
How to use these examples
Start in simulation (when possible). Replace your
Machine(...)constructor withMachine(simulated=True)to get familiar with the script flow.Adapt parameters to your setup. Always update:
addressor connection detailstool_index,tool_name, andconfigvalues- coordinates (e.g.,
x,y,z) and file paths
Run code in small chunks. Especially around Z-axis moves and tool pickup: run one or two lines, confirm behavior, then continue.
TIP
If you are not sure which example to start with, begin with Basic Machine Setup & Homing, then try Deck & Labware Walkthrough, and only then move on to specialized examples like gel printing.
Conventions in example code
Across all example pages, you will see a few consistent patterns:
Explicit imports
pythonfrom science_jubilee.Machine import Machine from science_jubilee.tools.SyringeExtruder import SyringeExtruderKeyword arguments for clarity
pythonm = Machine(address="192.168.1.2", deck_config="standard_deck")Small, reusable helper functions
For example, helpers like
load_gcode()andprint_gcode()are defined within the example so you can copy them into your own scripts.
INFO
If you have an example workflow that others might benefit from, consider contributing a new page following this structure and adding it to the catalog above.