K2 flush calculation logic

Hey everyone,

the flushing logic of the K2 seems very weird, and the printer flushes out a lot more filament than needed when loading and changing filaments. Even if you set the amount to 0 in OrcaSlicer, it will still flush multiple times.

The problem is even worse when changing between different materials, e. g. pla and petg. Then, the printer flushes around 6-8 times. I saw some people say there is a fixed flush amount of 100mm or 200mm³, but that might have been changed by now.

Sadly, from my experience, the macro-hijack fix by camaro4life18 doesn´t work on newer firmware versions anymore.

When looking at the console while a print started, i found that the printer seems to use its own flush-logic to calculate the amount:

// flush_volume: 118, nozzle_volume: 183
// flush_len: 125.416667
// different material type

I´m not very experienced with Klipper and couldn´t find the code/macro for this logic, I could imagine it´s not somewhere where you could easily change it.

If anyone has more experience with Klipper and/or knows a fix for this or knows where to find the code that calculates the flush amounts, I would be very thankful for your help.

Thanks in advance ^^