Skip to content

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:

  1. Overview What you will accomplish (e.g., “3D gel printing with a syringe extruder”) and when to use this pattern.

  2. Initial Setup How to connect to the machine (Machine(address=...)), home axes, and clear the build area. Unsafe operations are clearly marked.

  3. Hardware / Tool Preparation Any physical steps needed (loading syringes, placing plates, checking config.g tool indices) alongside the matching Python setup code.

  4. Calibration & Safety-Critical Steps Guided procedures for things like Z-offset calibration, with explicit comments to go slowly and avoid collisions.

  5. Core Script The main code that performs the task: printing, moving, pipetting, or running G-code.

  6. 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 explore Deck, Labware, Well, and Location objects.

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 .gcode file from disk, filter comments, and send commands line-by-line via Machine.gcode() with basic error handling.

  • Inline G-code for Fine Control Mix high-level move_to / move calls 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

  1. Start in simulation (when possible). Replace your Machine(...) constructor with Machine(simulated=True) to get familiar with the script flow.

  2. Adapt parameters to your setup. Always update:

    • address or connection details
    • tool_index, tool_name, and config values
    • coordinates (e.g., x, y, z) and file paths
  3. 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

    python
    from science_jubilee.Machine import Machine
    from science_jubilee.tools.SyringeExtruder import SyringeExtruder
  • Keyword arguments for clarity

    python
    m = Machine(address="192.168.1.2", deck_config="standard_deck")
  • Small, reusable helper functions

    For example, helpers like load_gcode() and print_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.

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