---
title: Tutorial 7 Retraction
description: Mastering pressure control to prevent stringing.
---
Tutorial 7 Retraction
1. Lesson Header
- Lesson Number: 7
- Level: Beginner
- Title: Retraction
- Estimated Duration: 15 Minutes
- Prerequisites: Lesson 4 (Extrusion Basics)
- What You Will Build: A "Two Towers" test that doesn't look like a spiderweb.
2. Concept Introduction
The Ooze Problem.
When you stop pushing the E motor, plastic doesn't stop coming out immediately. The nozzle is under pressure, like a garden hose. If you just move the nozzle to a new location, that pressure will leak out as a thin string of plastic.
The Solution: Retraction.
We must actively pull the filament back to relieve the pressure before moving.
- Retract: Pull filament back (Negative E).
- Travel: Move to new spot.
- Prime (Un-retract): Push filament forward (Positive E) to restart flow.
3. Machine State Explanation
Bowden vs. Direct Drive
- Direct Drive: Motor is on the print head. Requires small retraction (0.5mm - 1.0mm).
- Bowden: Motor is on the frame, pushing through a tube. The tube acts like a spring. Requires large retraction (3.0mm - 6.0mm).
For these tutorials, we will use a safe middle ground of 2.0mm.
4. Command Breakdown
Retract (G1 E-2)
Assuming Relative Extrusion (M83), this pulls 2mm of filament back.
- Syntax: G1 E-2 F2400
- Speed: Retraction needs to be fast! (F2400 = 40mm/s).
Prime (G1 E2)
Pushes the filament back to the nozzle tip.
- Syntax: G1 E2 F2400
- Must match: If you retracted 2mm, you must prime 2mm.
5. Minimal Working Example
Move from Point A to Point B without leaking.
M83 ; Relative E
; Draw line at A
G1 X10 Y10 E1
; RETRACT
G1 E-2 F2400
; TRAVEL (Fast move, no extrusion)
G0 X50 Y50 F3000
; PRIME
G1 E2 F2400
; Draw line at B
G1 X60 Y50 E1
6. Visual Representation
Interactive preview is available in the interactive reader.
7. Build Exercise
Task: Write a program that prints two small dots (extrusions) 50mm apart.
1. Extrude 2mm at X20.
2. Retract.
3. Move to X70.
4. Prime.
5. Extrude 2mm at X70.
...
Solution:
G21
G90
M83
G28
G0 Z0.3
G0 X20 Y20
; Dot 1
G1 E2 F200 ; Extrude a blob
G1 E-2 F2400 ; Retract
; Travel
G0 X70 Y20 F3000
; Dot 2
G1 E2 F2400 ; Prime
G1 E2 F200 ; Extrude a blob
8. Deep Insight Section
Z-Hop (Lift Z)
Sometimes retraction isn't enough. If the nozzle drags across the print, it leaves a scar.
"Z-Hop" means lifting the nozzle (e.g., G1 Z0.5) during the travel move.
Standard Sequence:
1. Retract (E-2)
2. Lift (Z+0.2)
3. Move (X... Y...)
4. Drop (Z-0.2)
5. Prime (E2)
9. Common Failure Modes
- The "Hammering" Extruder: If you retract too fast or too much, the filament might grind or the motor might skip steps (clicking sound).
- Clogs: If you retract too far (e.g., 10mm), you might pull molten plastic up into the "cold zone" of the heatsink, where it solidifies and jams the printer.
10. Real-World Application
Retraction Towers
To tune a printer, we print a tower with two pillars.
- At height Z=0 to Z=5, use 0.5mm retraction.
- At height Z=5 to Z=10, use 1.0mm retraction.
- ...
We inspect the result. The height where the stringing disappears is the perfect setting.
11. Final Clean Version
Save this as lesson7.gcode.
; Lesson 7 - The Stringing Test
; Setup
G21
G90
M83
G28
; Heat (Manual)
; Start
G0 Z0.3
G0 X40 Y40
; --- Pillar 1 ---
G1 F1500
G1 X50 Y40 E2 ; Base
G1 X50 Y50 E2
G1 X40 Y50 E2
G1 X40 Y40 E2
; --- RETRACT & MOVE ---
G1 E-3 F2400 ; Retract 3mm
G0 X80 Y40 F5000 ; Fast Travel
; --- PRIMING ---
G1 E3 F2400 ; Prime 3mm
; --- Pillar 2 ---
G1 F1500
G1 X90 Y40 E2
G1 X90 Y50 E2
G1 X80 Y50 E2
G1 X80 Y40 E2
; Finish
G0 Z10
G0 X0 Y200
12. Stretch Challenge
Challenge: Implement a "Wipe" motion.
Instead of just retracting, move the nozzle inwards (into the part) by 2mm while retracting, then travel. This wipes the nozzle tip on the printed part to clean it.
Answer Key:
; ... finish printing outer wall at X40 Y40
G1 X42 Y42 E-2 F2400 ; Move IN 2mm while Retracting
G0 X80 Y40 ; Travel