• Models
  • Contests
  • Slicer
  • Login
  • Start Here
    thingiverse-iconprintables-iconcults3d-iconmakerworld-iconmyminifactory-icon

    3D GO

    3D ModelsContestsCollectionsSaved ModelsOn a mobile device?

3D GO

Privacy Policy
Adaptive purge for any 3D printer using slicer variables 3D Printer File Image 1
Adaptive purge for any 3D printer using slicer variables 3D Printer File Thumbnail 1

Adaptive purge for any 3D printer using slicer variables

TeachingTech avatarTeachingTech

October 11, 2024

printables-icon
DescriptionCommentsTags

Description

Overview

Based on KAMP by kyleisah: https://github.com/kyleisah/Klipper-Adaptive-Meshing-Purging

Part of KAMP is to adapt various printer functions to suit each individual print, rather than a global constant. For example only ABL probing the region of the print instead of the whole bed. Relevant here is KAMP adding an extruder purge next to the model, rather than always in the same location on the bed. It works very well but is only available as a Klipper plugin.

The aim of this gcode is to add adaptive purge for any 3D printer, using the variables available natively to the slicer.

The technique is covered in detail in this video: 

 

Compatibility

The output of this technique is plain gcode, so it should be compatible with any 3D printer. The repeated use of G92 E0.0 makes it compatible with either relative or absolute extrusion without any other changes.

The examples given here are immediately compatible with PrusaSlicer, Orca Slicer, Super Slicer and Bambu Studio. Unfortunately Cura does not provide the variables required and is currently incompatible.

 

How it works

The slicer provides variables to track the footprint of the first layer. We can access these and then position our purge extrusion next to the object.

The two most useful variables are first_layer_print_min and first_layer_print_max. Each of these provides an X and Y coordinate, that are accessed by adding either a 0 (for x) or 1 (for Y) in [square brackets] after the variable name. Curly brackets surround the entire variable.

For example, the x position of the minimum corner (front left) is referenced as follows:

{first_layer_print_min[0]}

and the y position position for the same corner as follows:

{first_layer_print_min[1]}

We can then add or subtract values from these points to offset our extrusion as desired:

 

Where to insert the gcode

For most printers, the adaptive purge sequence should occur just after the final gcode command for the nozzle to reach printing temperature. This is usually an M109 S command.

Before (with previous purge sequence):

After (with adaptive purge):

As shown in the video, other printers with elaborate start gcode sequences can be trickier, but the same rule of thumb applies. Study the gcode preview after slicing to hone in on the correct location.

For Klipper printers only, like KAMP, the max_extrude_cross_section value in your printer.cfg needs to be raised to at least 2.5. This is found in the [extruder] section.

 

Advantages

The following list was created for the original KAMP implementation of adaptive purge. This version is simpler but has the additional benefit of the purge line showing in the gcode preview.

Customisation

KAMP uses a script to store purge variables, but here they are hard coded into the gcode sequence. Those that you will most likely want to tweak are as follows.

Position of the purge line relative to the first layer corner - By default this is 10mm. Change to another value throughout the sequence.

Feedrate of the purge. If the flow rate is too much for your 3D printer, reduce the F value as shown to slow the purge extrusion.

Retraction distance and speed. Alter the value after E for distance (must be a negative value) and the value after F for speed to match what you normally use for that printer. Alternatively substitute G10 for this entire line if you use firmware retraction.

 

Variations

Multiple variations are included to demonstrate positioning of the purge line in various locations reative to the model. A variation is also include which extrudes a triangle pattern.

License:

Creative Commons — Attribution

Related Models

#3DBenchy - The jolly 3D printing torture-test by CreativeTools.se preview image

#3DBenchy - The jolly 3D printing torture-test by CreativeTools.se

CreativeTools profile image

CreativeTools

90,837

Important information sign for 3D printers / Wichtiges Hinweisschild für 3D-Drucker :) preview image

Important information sign for 3D printers / Wichtiges Hinweisschild für 3D-Drucker :)

Pat_S profile image

Pat_S

sign: don't touch my 3d printer preview image

sign: don't touch my 3d printer

Izzodesign74 profile image

Izzodesign74

556

Self-Watering Planter (Small) preview image

Self-Watering Planter (Small)

parallelgoods profile image

parallelgoods

73,107

X, Y and Z calibration tool for IDEX / dual extruder / dual color 3D printers preview image

X, Y and Z calibration tool for IDEX / dual extruder / dual color 3D printers

Voxel3D_NL profile image

Voxel3D_NL

202

Gift Box preview image

Gift Box

roby85r profile image

roby85r

1,498

All In One 3D Printer test preview image

All In One 3D Printer test

majda107 profile image

majda107

64,459

axes calibrage cube-xyz for 3d printers preview image

axes calibrage cube-xyz for 3d printers

H- printed profile image

H- printed

9

7