Delta 3D printers move differently than the Cartesian machines most G-code tutorials are written for. Their three-arm, circular build geometry means the firmware interprets movement commands through its own kinematic math. If you're running stock G-code or generic slicer output on a delta, you're probably leaving print quality on the table and maybe even risking failed prints or mechanical stress. Writing or tweaking custom G-code scripts for delta printers gives you direct control over how your machine starts, moves, retracts, and finishes every job.
What makes delta printers different when it comes to G-code?
Cartesian printers move along straight X, Y, and Z rails. Delta printers calculate positions using three vertical towers and a system of arms that converge on a central effector. The firmware (usually RepRapFirmware or Marlin in delta mode) converts standard G-code coordinates into tower-specific motor movements behind the scenes.
This means the same G-code line say G1 X50 Y30 Z100 F3000 produces very different physical motion on a delta versus a Cartesian machine. The effector doesn't just move in a straight line across the bed; it follows curved paths near the edges of the circular build area. Understanding this is the foundation of writing scripts that actually work well on your delta.
Why would I need to write custom G-code instead of using my slicer's defaults?
Most slicers generate G-code with Cartesian assumptions baked in. They handle the basics extrusion, travel, retraction fine for general use. But delta-specific tuning usually requires manual edits in these areas:
- Start and end G-code Slicer defaults often use generic homing commands that don't account for delta-specific homing sequences or safe Z-height positioning after homing.
- Auto bed leveling (G29/G32) Delta printers commonly use probe-based calibration routines. Custom scripts let you call the right sequence for your specific setup.
- Travel moves near bed edges The circular printable area means some Cartesian-logic travel paths can send the effector outside safe boundaries, causing binding or crashes.
- Retraction tuning Bowden setups are common on deltas, and they need longer retraction distances with careful acceleration settings to avoid jams.
- Print speed and acceleration profiles Deltas excel at fast movement, but pushing acceleration too high near the periphery can cause layer shifting due to the kinematic math involved.
Where do I put custom G-code scripts on my delta printer?
Custom G-code can be added at three levels. First, directly in your slicer under the Start G-code and End G-code sections (found in printer settings in Cura, PrusaSlicer, or SuperSlicer). Second, in firmware configuration files if you're running RepRapFirmware or compiling Marlin. Third, as standalone .gcode files you run manually useful for calibration routines, maintenance scripts, or test patterns.
If you're working in a shared maker environment, optimizing G-code for multiple printer types is a common challenge, and some communities have started sharing optimized G-code setups for maker-space printers that include delta-specific configurations.
What should a good delta start G-code script include?
A solid start sequence for a delta printer typically covers these steps in order:
- Reset the extruder
G92 E0zeroes the extruder position so the firmware tracks filament correctly from the start. - Home all axes
G28triggers the delta homing routine (all three towers move up to endstops simultaneously). - Set coordinate mode
G90for absolute positioning is standard, though some scripts switch to relative (G91) during purge lines. - Run delta calibration
G32orG30depending on your firmware. Some setups useG29for mesh compensation after initial calibration. - Set safe travel height After homing, move to a known safe Z height (
G1 Z200 F3000) before any XY travel to avoid crashing into the bed. - Heat the bed and nozzle
M190 S60(wait for bed) andM109 S200(wait for nozzle) with temperatures matching your material. - Purge line or nozzle wipe Extrude a small amount at the bed edge to prime the nozzle before the actual print begins.
Example delta start G-code
Here's a practical starting script for a typical delta with a Bowden extruder and RepRapFirmware:
G92 E0 ; reset extruder
G28 ; home all towers
G32 ; run delta auto-calibration
G29 ; mesh bed compensation
G1 Z150 F6000 ; safe travel height
M190 S60 ; wait for bed temp
M109 S200 ; wait for nozzle temp
G91 ; relative positioning
G1 E5 F300 ; retract filament slightly
G1 Z5 F3000 ; lift nozzle
G90 ; absolute positioning
G1 X-50 Y-80 F6000 ; move to purge start
G1 Z0.3 F3000 ; lower to purge height
G1 X50 E15 F1000 ; purge line
G92 E0 ; reset extruder after purge
What does a good delta end G-code look like?
The end script should safely park the printer, cool down components, and prevent oozing. For a delta:
- Retract filament to reduce stringing as the nozzle cools.
- Move the effector to a safe Z height above the print.
- Disable the heaters (
M104 S0for nozzle,M140 S0for bed). - Turn off stepper motors (
M84) so the arms can be moved by hand if needed. - Optionally, move to max Z to get the effector out of the way for print removal.
A simple version looks like this:
G91 ; relative positioning
G1 E-5 F1800 ; retract filament
G1 Z10 F3000 ; lift nozzle
G90 ; absolute positioning
G1 Z max F6000 ; move to top of build volume
M104 S0 ; turn off nozzle
M140 S0 ; turn off bed
M84 ; disable steppers
How do I handle bed probing and calibration G-code for a delta?
Delta calibration is more involved than Cartesian bed leveling because you're compensating for arm length differences, tower position errors, and radius corrections not just a tilted bed. Most delta firmware supports at least two calibration commands:
- G32 Runs the full delta calibration routine. On RepRapFirmware, this uses probe points defined in your
bed.gfile to correct tower angles, arm lengths, and endstop offsets. - G29 Generates a height map for mesh bed compensation. This runs after G32 to handle remaining surface irregularities.
The key rule: always run G32 before G29. G32 fixes the mechanical geometry. G29 compensates for what's left. Running G29 alone on a poorly calibrated delta gives you a warped compensation map that actually makes prints worse.
After any calibration command, your start script should include a safe Z move before any XY travel. Homing leaves the effector at the top of the delta, and moving XY at max Z without first lowering can cause the arms to hit their mechanical limits.
What about retraction settings in delta G-code?
Most delta printers use Bowden extruder setups, where the filament travels through a long PTFE tube before reaching the hot end. This creates a delay between retraction commands and actual pressure relief at the nozzle. Delta-specific retraction considerations include:
- Longer retraction distances Typically 4–8mm for Bowden setups, compared to 1–3mm for direct drive.
- Coasting and wiping These can reduce the retraction needed by easing pressure before the travel move.
- Retraction speed Too fast causes grinding; too slow causes blobs. A good starting point is 40–60mm/s for the retraction move itself.
- Extra restart distance Some setups benefit from a slight extra prime (
G1 E+0.5) after unretracting to compensate for the Bowden lag.
Many makers share their tested retraction scripts and other G-code patterns through community-created G-code patterns that can save hours of trial-and-error tuning.
What common mistakes do people make with delta G-code?
These errors come up regularly in delta printer communities:
- Moving XY at max Z after homing The delta arms can't reach low bed positions from full height. Move Z down first.
- Ignoring firmware differences Marlin, RepRapFirmware, and Klipper each handle delta calibration commands differently. G32 in Marlin doesn't mean the same thing as G32 in RepRapFirmware.
- Using Cartesian safe-Z values A "safe Z" of 10mm makes sense on a Cartesian printer but can be below the printable area on a delta. Use Z values relative to your actual delta height.
- Not updating scripts after hardware changes Changing arm length, effector design, or hot end means your calibration G-code and probe offsets need revisiting.
- Setting feed rates too high for small moves Deltas handle fast long travels well, but short segmented moves (like those from mesh compensation) can stutter if the feed rate exceeds the firmware's look-ahead buffer capacity.
- Forgetting coordinate mode switches Mixing absolute (
G90) and relative (G91) moves without clearly switching back causes unexpected positioning errors.
How can I test custom G-code without damaging my delta?
Before running any new script on a real print, use these safety checks:
- Dry run with no heat Comment out (
;) all temperature commands and extrusion lines. Watch the effector path to make sure nothing crashes. - Use relative extrusion mode Set
M83in your script during testing so extrusion amounts are always incremental and won't cause a runaway long extrusion. - Keep a finger on the power switch Sounds basic, but it's how experienced makers catch dangerous moves on the first pass.
- Start at reduced speed Add an
M220 S50command to run at 50% speed for the first test, then remove it once the script is validated.
If you run into unexpected behavior, checking G-code community forums for troubleshooting errors is one of the fastest ways to find answers from people who've solved the same problem on similar hardware.
Where can I learn more about G-code commands specific to deltas?
The official RepRap wiki has a complete G-code reference that covers every standard command. For delta-specific behavior, your firmware's documentation is the most reliable source RepRapFirmware's docs especially cover the delta kinematics configuration in detail.
When you're documenting your own custom scripts, using clear monospaced formatting in your notes helps you spot errors quickly. If you create visual guides or documentation for your maker group, tools like Source Code Pro work well for displaying G-code in readable format, while something like Roboto keeps your documentation text clean and legible.
Quick checklist before running any custom G-code on your delta
Run through this list every time you write or modify a script:
- ✅ Homing command (
G28) is present and uses your firmware's delta homing routine. - ✅ A safe Z move follows homing before any XY travel.
- ✅ Delta calibration (
G32) runs before mesh compensation (G29). - ✅ Temperature commands use
M109/M190(wait) instead ofM104/M140(no wait) in the start script so the print doesn't begin cold. - ✅ Extruder is zeroed (
G92 E0) after any purge line. - ✅ Coordinate mode (
G90/G91) is explicitly set don't assume the default. - ✅ Retraction distances match your Bowden tube length.
- ✅ End script retracts filament and disables heaters.
- ✅ All feed rates are appropriate for delta kinematics (not copied from a Cartesian machine).
- ✅ You've dry-run the script with extrusion and heating disabled first.
Start with the example scripts above, adjust the temperatures and distances to match your machine, and test small. Delta printers reward careful G-code tuning with some of the fastest, cleanest prints you can get once the script is right.
Maker-Created G-Code Patterns for 3d Printing Projects
G-Code Community Forums: Troubleshooting 3d Print Errors and Fixes
G-Code Optimization Tips for Maker Space 3d Printers
Advanced G-Code Techniques for Multi-Material Printing
How to Create Qr Code Projects Using Maker Codes: a Step-by-Step Guide
Common Maker Codes for Circuit Board Components Explained