This is my setup for more control:
start code:
…
;==== set airduct mode ====
{if (overall_chamber_temperature >= 40)}
M145 P1 ; set airduct mode to heating mode for heating
M106 P2 S0 ; turn off auxiliary fan
M106 P10 S255 ; turn on filter fan
{else}
M145 P0 ; set airduct mode to cooling mode for cooling
M106 P2 S255 ; turn on auxiliary fan for cooling
M106 P10 S255 ; turn on auxiliary fan for cooling
M106 P3 S180 ; turn on chamber fan for cooling
;M140 S0 ; stop heatbed from heating
M1002 gcode_claim_action : 29
M191 S0 ; wait for chamber temp
M106 P2 S0 ; turn off auxiliary fan → left Aux
M106 P10 S0 ; turn off auxiliary fan → right Aux
;M142 P6 R30 S40 U0.3 V0.8 ; set PLA/TPU/PETG exhaust chamber autocooling
; — X2D: material-dependent exhaust/chamber autocooling —
{if (min_vitrification_temperature <= 55)}
;PLA/TPU-like: earlier and stronger exhaust
M142 P6 R30 S40 U0.5 V1.0
{elsif (min_vitrification_temperature <= 85)}
;PETG-like: later and softer exhaust
M142 P6 R38 S50 U0.5 V0.8
{else}
;ABS/ASA/PC-like: keep chamber warmer
M142 P6 R45 S60 U0.40 V0.7
{endif}
;===== DEBUG PLACEHOLDERS =====
….
layer change:
;======== X2D layer_change gcode ==========
;===== X2D M142 P1 aux control + chamber safety =====
; update layer progress
M73 L{layer_num+1}
M991 S0 P{layer_num} ;notify layer change
; — X2D: no aux during first no-cooling layers —
; M142 P1 is intentionally not active during first cooling-off layers
{if (layer_num + 1 > close_fan_the_first_x_layers[current_extruder])}
; — low vitrification materials: PLA / TPU-like —
{if (min_vitrification_temperature <= 55)}
M142 P1 R32 S40 U{additional_cooling_fan_speed[current_extruder]/100.0} V{(additional_cooling_fan_speed[current_extruder]+30)/100.0} O50
; — medium vitrification materials: PETG-like —
{elsif (min_vitrification_temperature <= 85)}
M142 P1 R38 S52 U{additional_cooling_fan_speed[current_extruder]/100.0} V{(additional_cooling_fan_speed[current_extruder]+20)/100.0} O62
; — high temp materials: ABS/ASA/PC-like —
{else}
M142 P1 R45 S60 U{additional_cooling_fan_speed[current_extruder]/100.0} V{(additional_cooling_fan_speed[current_extruder]+10)/100.0} O75
{endif}
{endif}
layer change:
….
G1 Y256 F18000
; — X2D: apply M142 P1 aux control for next filament —
; no aux during first no-cooling layers
{if (overall_chamber_temperature < 40)}
{if (layer_num + 1 <= close_fan_the_first_x_layers[next_extruder])}
M106 P2 S0
M106 P10 S0
{else}
; — X2D M142 P1 aux control for next filament —
; U = lower aux level from filament aux fan setting
; V = upper aux level depending on material class
; O = alarm / critical chamber threshold
{if (min_vitrification_temperature <= 55)}
; PLA / TPU-like: earlier, stronger, lower alarm threshold
{if (nozzle_diameter <= 0.25)}
M142 P1 R30 S38 U{additional_cooling_fan_speed[next_extruder]/100.0} V{min(1.0,(additional_cooling_fan_speed[next_extruder]+30)/100.0)} O48
{elsif (nozzle_diameter <= 0.45)}
M142 P1 R32 S40 U{additional_cooling_fan_speed[next_extruder]/100.0} V{min(1.0,(additional_cooling_fan_speed[next_extruder]+30)/100.0)} O50
{else}
M142 P1 R34 S42 U{additional_cooling_fan_speed[next_extruder]/100.0} V{min(1.0,(additional_cooling_fan_speed[next_extruder]+30)/100.0)} O52
{endif}
{elsif (min_vitrification_temperature <= 85)}
; PETG-like: later, softer, higher alarm threshold
{if (nozzle_diameter <= 0.25)}
M142 P1 R36 S48 U{additional_cooling_fan_speed[next_extruder]/100.0} V{min(1.0,(additional_cooling_fan_speed[next_extruder]+20)/100.0)} O58
{elsif (nozzle_diameter <= 0.45)}
M142 P1 R38 S52 U{additional_cooling_fan_speed[next_extruder]/100.0} V{min(1.0,(additional_cooling_fan_speed[next_extruder]+20)/100.0)} O62
{else}
M142 P1 R40 S55 U{additional_cooling_fan_speed[next_extruder]/100.0} V{min(1.0,(additional_cooling_fan_speed[next_extruder]+20)/100.0)} O65
{endif}
{else}
; ABS / ASA / PC-like: keep chamber warmer
{if (nozzle_diameter <= 0.25)}
M142 P1 R42 S56 U{additional_cooling_fan_speed[next_extruder]/100.0} V{min(1.0,(additional_cooling_fan_speed[next_extruder]+10)/100.0)} O70
{elsif (nozzle_diameter <= 0.45)}
M142 P1 R45 S60 U{additional_cooling_fan_speed[next_extruder]/100.0} V{min(1.0,(additional_cooling_fan_speed[next_extruder]+10)/100.0)} O75
{else}
M142 P1 R48 S65 U{additional_cooling_fan_speed[next_extruder]/100.0} V{min(1.0,(additional_cooling_fan_speed[next_extruder]+10)/100.0)} O80
{endif}
{endif}
{endif}
{endif}
;not set fan changing filament
this will get more control over the fans while still having some automated ventilation and alarm settings active.