February 4, 2026
Description
Dmitry made a great model and supplied the Marco code for Klipper. I just made it work for the AI3M bed!
For macro setup, look back at Dmitry post.
Note: You may need to take off the bed to get it on.
[gcode_macro WIPE]
description: Wipe nozzle on silicone comb (center-based + zigzag)
# Comb parameters
variable_comb_x: 100. ; X center of the comb
variable_comb_y: 223. ; Y center of the comb
variable_comb_z: 4.00 ; Z when touching the comb
# General parameters
variable_comb_z_lift: 5.0 ; Nozzle lift before/after wiping
variable_comb_width: 40.0 ; Full width of the comb (mm)
variable_comb_cycles_1: 4 ; Number of cycles in the first pass
variable_comb_cycles_2: 3 ; Number of zigzags in the second pass
variable_comb_offset_y: 1.0 ; Y offset for the second pass
variable_comb_zigzag_shift: 1.5 ; X shift for each zigzag step
# Return to specified position
variable_return_x: 100.0
variable_return_y: 20.0
gcode:
{% set half_width = comb_width / 2 %}
{% set zigzag_shift = comb_zigzag_shift %}
G90 ; Absolute coordinates
G1 Z{comb_z_lift} F3000 ; Lift nozzle before moving
G1 X{comb_x} Y{comb_y} F6000 ; Center of the comb
G1 Z{comb_z} F3000 ; Contact with the comb
; First straight pass
G91 ; Relative coordinates
{% for i in range(comb_cycles_1) %}
G1 X{half_width} F4500
G1 X-{half_width * 2} F4500
G1 X{half_width} F4500
{% endfor %}
; Lift slightly and move Y offset
G1 Z0.3 Y{comb_offset_y} F3000
; Second pass — zigzag along X with a slight shift
{% for i in range(comb_cycles_2) %}
G1 X{half_width + (zigzag_shift * i)} F4500
G1 X-{(half_width + (zigzag_shift * i)) * 2} F4500
G1 X{half_width + (zigzag_shift * i)} F4500
{% endfor %}
; Lift and return
G90
G1 Z{comb_z_lift} F3000
G1 X{return_x} Y{return_y} F6000
G4 P500License:
Creative Commons — Attribution — Noncommercial — Share Alike
7