jschuh / klipper-macros

A collection of useful macros for the Klipper 3D printer firmware
GNU General Public License v3.0
967 stars 173 forks source link

[ENHANCEMENT] Better Params Control for Load/Unload filament #78

Closed fire1ce closed 1 year ago

fire1ce commented 1 year ago

Hey @jschuh thanks for your work!

I would like to ask if it's possible to add the ability to set the following (example provided at the bottom) parameters for the Load/Unload filament? The issue I have is that I can't set the desired parameters as default values right now, and when using KlipperScreen, it's a pain to enter the values via the "macros" menu, since it already has "load" and "unload" menus built-in which will execute the macro with the "minimum" calculated parameters.

Example for globals.cfg (part of them already exists)

# Length (in mm) of filament to load (bowden tubes will be longer).
variable_load_length: 90.0
# Filament loading speed (in mm/m).
variable_load_speed: 300
# Length (in mm) of filament to unload.
variable_unload_length: 90.0
# Filament unloading speed (in mm/m).
variable_unload_speed: 300
# Length (in mm) of the filament loading that feeds at priming speed.
variable_load_priming_length: 25.0
# Default minimum temperature for LOAD_FILAMENT and UNLOAD_FILAMENT.
variable_load_unload_temperature: 220
jschuh commented 1 year ago

I'm not sure I understand the request. Are you asking for two additional parameters for unloading speed and length? If so, I guess I'm not clear on what value there is in having them different for unloading versus loading. Or maybe I'm missing something?

fire1ce commented 1 year ago

@jschuh about the differents for unloading/loading is not critical. the value that im realy missing is "variable load unload temperature" that i can predefined as a default. right now it usses the minimum temp + 5. is that posable to add?

jschuh commented 1 year ago

Let me think about it. It would be easy enough to add, but my concern is that it doesn't really make sense for multi-extruder setups and that the number of config parameters keeps growing unbounded.

fire1ce commented 1 year ago

Let me think about it. It would be easy enough to add, but my concern is that it doesn't really make sense for multi-extruder setups and that the number of config parameters keeps growing unbounded.

Sure. By the way, you can maintain the same logic with the minimum temperature. For example, if the default temperature is set to 0 (below the minimum) in globals.cfg, it will execute the same logic as it does now. If the value in the overriding config is above the minimum temperature, then it will use that value.

jschuh commented 1 year ago

Yes, that's how all the options that derive their defaults from config settings work. The issue in this specific case is that it introduces a potential discontinuity between having a single global option versus behavior derived from per-extruder settings.

jschuh commented 1 year ago

I decided to land it as 8c13bd30a5aeb839ff1d76fcbccf087c682058bf along with some other changes today.

fire1ce commented 1 year ago

thanks. much appreciated!