Welcome to the world of bioprinting. In this document, we will explain how to craft your own G-code file for use in your BIO X.
BIO X (Build 1) | BIO X (Build 2) |
![]() | ![]() |
Refer to this article | Refer to the "G-code guide for the BIO X (Build 2)" article |
As an alternative to inputting a 3D model and letting the BIO X slice it into the toolpath, the user can directly input a toolpath in G-code format. This feature is meant for more advanced users who want to either tune their print files for optimal performance or to craft their own structure from scratch with full control over all parameters.
G-code is a low-level command format used for CNC machines and 3D printers. The G-code describes the movement of the machine and has special commands for functions like tool changes.
Here are the steps you should follow to write your own G-code.
1. Giving your bioprinter some context
Before you start giving your printer coordinates to move to, you should define an absolute plane of reference for the movements, a relative plane of reference for extrusion, and define that you are referring to a position in units of millimeters.
The G-code pre-structure should contain the following commands:
Command | Parameters | Description |
---|---|---|
G90 | - | Defines absolute coordinates. |
G21 | - | Set the position units to mm. |
M83 | - | Use relative distances for extrusion. |
2. Developing the code structure
There are three main types of G-code commands:
- T commands define the tool to be used, either the printheads or the photocuring modules.
- G commands refer to positioning control.
- M commands are advanced function command
2.a. T commands
Command | Parameters | Description |
---|---|---|
T | {0-2 / 10-11} | Changing tools
|
2.b. G commands
The coordinate system of the BIO X is centered on the calibration position. The latter corresponding to the (X0,Y0,Z0) position.
Command | Parameters | Description |
---|---|---|
G0 | Xnnn Ynnn Znnn Fnnn | Absolute travel move command
|
G1 | Xnnn Ynnn Znnn Ennn Fnnn | Absolute move command
|
G4 | Snnn Pnnn | Pause command
|
G7 | Xnnn Ynnn Znnn Ennn Fnnn | Relative move command Note: This commands works the same as G1 but uses relative moves instead.
|
G92 | Xnnn Ynnn Znnn | Set position
|
2.c. M Commands
The following list of commands can be used in G-code files for the BIO X. Unknown commands or incorrect parameters might be ignored by the software.
Extrusion and pressure
Pneumatic, temperature-controlled and thermoplastic printheads are concerned by the following commands.
The BIO X interface can help you set a pressure without the need to include these commands in your G-code.
Command | Parameters | Description |
---|---|---|
M750 | Tn Pnnn | Start material extrusion Note: This is a dual command, the machine sets the pressure and extrudes material. If P parameter is omitted, the currently set pressure for the active tool is used.
|
M751 | Tn | Stop material extrusion Note: It is recommended that an M750 command is followed by an M751command for the same printhead before an M750 command for another printhead is sent.
|
M773 | Tn Pnnn | Set printhead pressure Note: It is recommended to set the pressure (using M773) and activate the wanted printhead using the T command before attempting to extrude with this command. Unlike command M750, M773 does not trigger extrusion.
|
Temperature
Command | Parameters | Description |
---|---|---|
M771 | Tn Pnnn | Turn on printhead temperature control
|
M801 | Snnn | Turns on the printbed temperature control
|
M800 | - | Turns off the printbed temperature control |
Photocrosslinking and lights
Command | Parameters | Description |
---|---|---|
M805 | Tn Pnnn | Turn on/off photocuring modules
|
M810 | Rnnn Ennn Bnnn Wnnn | Set the color of the chamber lights
|
Electromagnetic droplet (EMD) printhead
Command | Parameters | Description |
---|---|---|
M2065 | Tn Snnn | Set open time Note: EMD printhead controls an electromagnetic valve in a cyclic fashion. The valve open time in each cycle defines the amount of ink that will be dispensed.
|
M2067 | Tn Snnn | Set cycle time Note: The cycle time (period) defines the dispensing frequency (= 1/period)
|
M750 | Tx Py Dz | Setting up a continuous extrusion Note: This commands prompts the instrument to extrude material from printhead "x" at pressure "y" during "z" milliseconds.
|
Syringe pump printhead
Command | Parameters | Description |
---|---|---|
M2032 | Tn Sy | Set extrusion rate
|
M2045 | Tn E/R | Set syringe move direction Note: Sets the syringe move to either extrude or retract direction.
|
M2047 | Tn E/R | Full extrusion/retraction Note: Either fully extrude or fully retract the syringe.
|
M2051 | Tn Vnnn | Volumetric control of extrusion
|
HD camera toolhead
Command | Parameters | Description |
---|---|---|
C0 | filename.png | Acquiring an image Note: C0 command takes an image using the HD Camera Toolhead. Follow with a code like “filename.png” to save the image with a specific file name. |
Other commands
Command | Parameters | Description |
---|---|---|
M400 | - | Finish all moves Note: Pauses until all commands up till this point are executed. |
M823 | Pnnn | Safe park in a position
|
3. Insert end commands
End your G-code with the following commands:
>>> G1 Z30; lower printbed
>>> M84; disable motors
4. G-code example
The following code prints a small square (20 mm x 20 mm) centered around (X0;Y0) at 1200 mm/min using printhead 1:
>>>G90;
>>>G21;
>>>>M83;
>>>T0;
>>>G1 Z0.4 F4800;
>>>G1 X10 Y10 F1200;
>>>G1 X-10 E1;
>>>G1 Y-10 E1;
>>>G1 X10 E1;
>>>G1 Y10 E1;
>>>G1 Z30;
>>>M84;
5. File formats
The BIO X can handle several g-code file formats, .gcode and pp.gcode (or .stl.gcode). The pp.gcode is a processed file and is what the printer will execute, a .gcode file will be further processed and outputted as a .pp.gcode file before being executed.
A .pp.gcode file allows more control when crafting code as it will not be altered. A .gcode file, on the other hand, offers some more convenience like being able to set speed and UV curing in the GUI.
There is one key difference between the two formats: the numbering of printheads.
- In pp.gcode mode printheads are numbered [1,3].
- In .gcode mode printheads are numbered [0,2].
Note: Using pp.gcode or stl.gcode files can result in damage to the bioprinter. Please contact support@cellink.com if you need assistance with g-code programming.