Gel Printing: Pre-sliced and Custom Toolpath
Overview
This guide walks you through printing gels using a pre-sliced model or direct toolpaths with a syringe extruder on a Science Jubilee machine.
Before You Begin
- Clear any items off the build plate.
- Ensure the Z-Offset is calibrated for your syringe.
from science_jubilee.Machine import Machine
from science_jubilee.tools.SyringeExtruder import SyringeExtruder
m = Machine(address="192.168.1.2")To home the machine (if needed):
# m.home_all()Tool Setup
Ensure your tool's index and name match your Duet config.g setup.
syringe_index = 10000 # Match your tool index
syringe_config = "10cc_syringe" # Predefined config
syringe_name = "Syringe"
syringe = SyringeExtruder(
index=syringe_index,
name=syringe_name,
config=syringe_config
)
m.load_tool(syringe)Ask a lab assistant for help prepping the F-127 gel.
Printing a Pre-Sliced Model
Pick Up the Syringe Tool
m.pickup_tool(syringe)Prime the Nozzle
This step ensures material is flowing before printing.
m.move_to(z=25) # Raise bed for clearance
syringe.move_extrude(e=1) # Repeat until gel starts flowingLoad and Print G-code
Helper functions to load and execute .gcode:
def load_gcode(file_path):
try:
lines = []
with open(file_path, 'r') as file:
for line in file:
lines.append(line.strip())
return lines
except FileNotFoundError:
print(f"File '{file_path}' not found.")
return None
except Exception as e:
print(f"An error occurred: {e}")
return None
def print_gcode(gcode):
for line in gcode:
if line and not line.startswith(';'):
print(line)
m.gcode(line)Start printing:
Note: If you're using a glass plate, remove it while homing and return it before printing begins.
gcode = load_gcode("cylinder-20mm.gcode")
print_gcode(gcode)After Printing
m.park_tool()The default slice may not print optimally. Tune speed, layer height, and extrusion settings using your own slicer and refer to the
README.md.
Custom Toolpath Printing
You can directly script syringe toolpaths for custom prints.
Test Cube with Raised Edge
This prints a simple raised-edge cube using manual extrusion.
m.pickup_tool(syringe_0)Set print parameters:
z = 0
layer_height = 0.2
z_off = 0
start_x = 150
start_y = 150
side_length = 20
m.move_to(x=start_x, y=start_y, z=z)Print each layer of the cube:
for layer in range(40):
syringe_0.move_extrude(x=start_x + side_length, y=start_y, z=z, multiplier=1)
syringe_0.move_extrude(x=start_x + side_length, y=start_y - side_length, z=z + z_off, multiplier=1)
syringe_0.move_extrude(x=start_x, y=start_y - side_length, z=z + z_off, multiplier=1)
syringe_0.move_extrude(x=start_x, y=start_y, z=z, multiplier=1)
z += layer_height
z_off += 0.1