Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update minimum temperature logic to defer to slicer during printing #7

Merged

Conversation

kieraneglin
Copy link
Contributor

@kieraneglin kieraneglin commented Aug 2, 2023

Issue:

There are two main things this PR addresses:

  1. When printing with two different-temperature filaments (eg: PLA and PETG for easy support removal), HH waits until the higher of the two temperatures is reached before forming the tip or unloading the filament. This could result in a bad tip forming and wastes time during a swap
  2. If your min_temp_extruder is set to something higher than your printing temp, min_temp_extruder will be set as your new printing temp during the swap. You could just set min_temp_extruder lower, but I have mine set at 230 to work for PLA, PETG, TPU, ABS, and nylon since this allows me to remove filament without knowing/caring what kind it is. But during a print we should defer to the slicer's temps instead

Fix Description:

See code comments, but at a high level:

  1. Updates _set_above_min_temp to defer to the slicer when printing and renames to better reflect new behaviour
    • NOTE: if a target temp is explicitly specified, we do still respect that. This is useful for when you pause, set the temp manually, and then resume.
    • NOTE: this change does place more trust in the slicer, but I think that's reasonable. Just in case, we do still use Klipper's can_extrude as a safeguard
  2. Updates _load_extruder to ensure the target temp has been reached before attempting a load. This should be unneeded in practice, but better safe than sorry!

GitHub Issues Resolved:

None

extras/mmu.py Outdated Show resolved Hide resolved
extras/mmu.py Outdated Show resolved Hide resolved
@moggieuk
Copy link
Owner

moggieuk commented Aug 3, 2023

Thank you! This seems to make sense and looks correct but I'm going to need to wait until I'm reunited with my printer in about 10 days to test / experiment...

@kieraneglin
Copy link
Contributor Author

@moggieuk updating to say that I've had time to test this with many prints and it's working as I'd expect! Loads from PLA (210º) to PETG (255º) and back are working well with no downtime to wait for heating

@moggieuk
Copy link
Owner

This looks good. Can you help me with two things so I can merge easily:

  1. Resolve the conflict -- I added a restoration of sync state a little differently than other of your suggestions.
  2. Did you solve the "a heater turns off during a pause" case?

@kieraneglin
Copy link
Contributor Author

@moggieuk

  1. Resolved!
  2. I have - def _pause() stores self.paused_extruder_temp which is passed to _ensure_safe_extruder_temperature in the MMU_RESUME macro. Within _ensure_safe_extruder_temperature, there's logic that will run if an override is set and the printer is currently printing or paused. That logic will respect the temp override and wait for the target temperature before continuing

@moggieuk moggieuk merged commit 059fac7 into moggieuk:main Aug 23, 2023
@bakatrouble
Copy link
Contributor

#13
Seems to be related

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants