X-in/1-out non mixing extruders problem with `max_extrude_cross_section`

Basic Information:

Printer Model: Zonestar Z9V5-MK4 (non-mixing E4 4to1 extruder)
MCU / Printerboard: stock ZM3E4 V2.1 with clone of STM32 (APM32 F103VET6 by Geehy)
Host / SBC: PC Ubuntu / and the same errors on RPi-4B 8Gb
klippy.log
klippy.log (209.9 KB)

Describe your issue:

Tried to reproduce something similar to X-In/1-Out Non-Mixing Extruder - Automate SuperSlicer & PrusaSlicer Filament Swaps
and after getting stuck for a week in loop of Move exceeds maximum extrusion / Stepper too far in past trying to think what could be better.

Background:

All slicer based on Slic3r (Prusa, Orca, SuperSlicer) if enabled Single extruder multi-material and Wipe tower generate similar G-Code block on filament change ( retract to cool zone, perform ramming to avoid blob on the end, retract to parking position, extrude new material till the hot end) and
to avoid creating blob due too bleeding, they move printhead left-right during material “extruding” from parking position till the hot-end:

G1  X66.200 Y20.260 Z0.3
G4 S0
M220 S100
; CP TOOLCHANGE LOAD
G1 E5.6 F180 ; <= ok, only extruding
G1  X101.200  E19.6 F2000 ; <= problematic, as both extrudes and moves along X
G1  X66.200  E2.8 F2100
; CP TOOLCHANGE WIPE
G1  X126.200  E3.26 F1584
G1  X125.450 Y20.760   E0.049
G1  X66.200  E3.2192
G1  X66.950 Y21.260   E0.049
G1  X125.450  E3.1785
G1  X66.950  F2000

For my understanding Klipper allows “extrude only” moves using max_extrude_only_distance setting, but if the move combines X/Y/Z movement it starts checking max_extrude_cross_section and fails on “unparking” move that combines wiping to prevent bleeding.
This forces disabling max_extrude_cross_section on multi-extruder printer.
And as a result it won’t highlight places where it might be violated, causing Stepper too far in past.

In addition, such conditions causing Stepper too far in past might be not only part of a G-Code itself, but might be caused by high Pressure Advance settings combined with default (0.04s) SMOOTH_TIME and medimum speeds/accelerations (that was solved by both increasing SMOOTH_TIME:

pressure_advance = 0.6
pressure_advance_smooth_time = 0.1

and reducing print speed.

Proposal

  1. make max_extrude_cross_section macro controlable so it might be posible to disabled it by setting high number before tool changing and enabled back after.
  2. is it possible to limit PA compensation to avoid it generating something above board capabilities? and maybe some easy way to debug it? I didn’t find in manual how to plot command graph after PA compensation.

I’m not sure if your conclusions are correct in any sense.
Especially the Stepper too far in past error seems more like a consequence of your code modifications than something related to the items discussed in your post.

@Sineos

the first code is from slicer without modifications (up to macros, but ; CP TOOLCHANGE LOAD section is as-is)
you can see it with lower rates at link above

Blockquote
Due to the long length of 140mm, this process, Klipper may throw a Move exceeds maximum extrusion (##.###mm^2 vs 0.640mm^2) error, or similar.

Regarding PA, attaching log of running:

G28 ; home
G91 ; relative coordinates

SET_PRESSURE_ADVANCE ADVANCE=0.1 SMOOTH_TIME=0.04
G1 X8 E2 F8000

SET_PRESSURE_ADVANCE ADVANCE=0.2 SMOOTH_TIME=0.04
G1 X8 E2 F8000

SET_PRESSURE_ADVANCE ADVANCE=0.3 SMOOTH_TIME=0.04
G1 X8 E2 F8000

SET_PRESSURE_ADVANCE ADVANCE=0.4 SMOOTH_TIME=0.04
G1 X8 E2 F8000

SET_PRESSURE_ADVANCE ADVANCE=0.5 SMOOTH_TIME=0.04
G1 X8 E2 F8000

SET_PRESSURE_ADVANCE ADVANCE=0.6 SMOOTH_TIME=0.04
G1 X8 E2 F8000 ; fails on `Stepper too far in past`

klippy_smooth_0.04.log (151.4 KB)

tried on the same failing line increase smooth to 0.4 and 0.8 and it still fails so maybe this command is too harsh, but on real print, smooth time is what helped me.