IDEX print states and complex macros

Basic Information:

Printer Model: Custom IDEX
MCU / Printerboard: STM32F407 based
Host / SBC: BTT Pi2
klippy.zip (2.1 MB)

I am using an IDEX printer with an Orbiter Filament sensor. The macros provided by the author work fine with a single extruder printer and have never caused similar problems. I adapted them for two extruders by simply copying them and modifying the copy for the second extruder. This generally works fine, but has recently started causing completely unrecoverable problems when printing in COPY mode. Let’s look at this error log, which happened perfectly fine about 20 minutes before the end of the 8 hour print. Before print, I issued a command SET_GCODE_VARIABLE MACRO=_SENSOR_VARIABLES VARIABLE=disable_runnout VALUE=True

11:56:31  echo: FUCK! 1
11:56:31  echo: Filament runnout is disabled in the sensor config file!
11:56:31  echo: Filament load e1
11:56:31  // Unknown command:"M300"
11:56:31  echo: Filament loading!
11:57:05  echo: Filament load complete!
11:57:05  // Move exceeds maximum extrusion (26.492mm^2 vs 0.640mm^2)
// See the 'max_extrude_cross_section' config option for details
11:57:05  !! Move exceeds maximum extrusion (26.492mm^2 vs 0.640mm^2)

What happened was the filament_sense1 button registered a click, which ran the runnout_init1 macro first and then immediately filament_load1_init1 afterward.

There’s a lot of bizarre things going on here:

  1. Why sensor did triggered in a first place. That’s probably is an impossible to find connection issue and is outside the scope of this topic.
  2. Why did print state suddenly changed from printing duing filament_load1_init1? Neither pause nor cancel were issued after runnout_init1. At least common sense says that they could not have been issued.
  3. Why M118 is not working? Filament loading! is issued from filament_load1 macro, which could be possibly called only from filament_load1_init1, but if filament_load1_init1 was executed, then why there’s no Filament load init e1 in the console?
  4. Where does Move exceeds maximum extrusion comes from? It does not appear when these macros are running when the printer is idle or paused

So my questions are:

  1. Any advice on debugging this?
  2. Can i somehow log executed g-code commands and macros? It seems like klipper doesn’t have that option by default. Is sticking a bunch of print in the code a good idea?
  3. I haven’t found any example configs for filament sensors on multi-extruder printers. Should I try to debug what I have now or would it be better to rewrite these macros from scratch and simplify them?

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.