; Ooze-compensation based on heater standby time evaluated by 'state.upTime' ; works for dual extrusion and assumes that the standby temps are close or equal to print temps ; config.g specifies global variables global tool0_primed = false ; tool is 'off' global tool1_primed = false global tool0_ooze_temp = 180 ; only if current temp is higher than ooze_temp, we will see oozing global tool1_ooze_temp = 180 global standby_duration = 0 ; only works when there is exactly one tool in standby (mixing tools or >2 tools need different times) global tool0_ooze_factor = nn.nn ; varies depending on nozzle diameter (maybe add variation later, based on {heat.heaters[#].active - tool#_ooze_temp}) global tool1_ooze_factor = mm.mm ; tfree#.g sets the starting time for standby duration (can we assume it was used before and is on print temp?) if heat.heaters[#].current is >= global.tool#_ooze_temp set global.standby_duration = state.upTime ; this tool will ooze, so let the count begin ; tpre# checks for primed_status if global.tool#_primed = false set global.tool#_primed = true ; maybe add some priming extrusion here ; tpost#.g checks if it was selected before (primed?) then calculates the extra ooze-compensation M116 P# ; wait for temp rising to print temp if global.tool#_primed = true ; maybe some extra smart calculation based on M307 cooldown time can take place here? ; simple calculation when standby_temp = print_temp (for shortest tool changes) var extra-retraction = (tool#_ooze_factor * (state.upTime - standby_duration)) G1 E(extra-retraction)F(tools[#].retraction.unretractSpeed) echo "Tool # got Ooze compensation of:" echo extra-retraction set global.standby_duration = 0