klipper
klipper copied to clipboard
Feature/mixing extruder
Support for mixing (n-in 1-out) nozzles. It uses the sync to stepper/extruder and adjusts the rotation distance for the affected steppers.
Thanks. As high-level feedback, I think it is fine to add a module to facilitate mixing extruders, but I think the code should more closely follow some current Klipper conventions.
Some high-level comments (in no particular order):
- It would be preferable for this PR to be rebased with the gradient support in a separate commit. I'm fine with adding gradient support; having it separate would ease review though.
- It looks like this code adds several debug logging lines - as per our contribution guidelines that should be cleaned up and removed prior to merging ( https://www.klipper3d.org/CONTRIBUTING.html ).
- It's not clear to me why
self.printer.add_object()
call was added to extruder.py . Can you elaborate on that? - This PR adds several new commands. The current convention is to try to introduce fewer commands - using command parameters to allow commands to perform multiple functions if needed. I'd expect there to be just a single
SET_MIXING_EXTRUDER
command (and possibly aSET_MIXING_EXTRUDER_GRADIENT
command with gradient support). - The
toolhead.move()
method is on the "fast path" and I don't think we should incur the overhead of callingsend_event()
in that code path. As a possible alternative, you may be able to add a "gcode move transform" (see klippy/extras/tuning_tower.py as an example). I'm guessing this is only needed for gradient support? - Overriding
G1
in a sample config seems a little dubious to me. I'm not sure it is a good idea to recommend that. - Why does the mixing_extruder config require both
steppers
andextruder_name
? - I think it would be preferable for the user to explicitly specify the "mixing_extruderX" names that are to be used (and allow arbitrary names instead of "mixing_extruder0" through "mixing_extruder15").
Cheers, -Kevin
Ok I will look into points 1, 2 and 4 ...
Regarding 3.: I need to poll the initial rotation distance on the steppers and for that I need to make a method call on the ExtruderStepper (I added the get/set_rotation_distance in extruder.py for that) and this was the way I saw to get to the ExtruderSteppers having only their names.
Regarding 6.: Thanks for the pointer. I hadn't seen the this move_transform possibility and with that I could add the position hook only when needed: when an gradient is active (you are right this is only needed for gradients)
Regarding 6.: The G1 is only a demo how flexible the basic command is (eg. the duet g-code flavor also supports a "G1 Ennn:nnn:nnn..." command: https://docs.duet3d.com/User_manual/Reference/Gcodes) and it make manual testing much easier
Regarding 7.: The extruder_name is the extruder which is controlled by the G0/G1 commands and the steppers are the steppers I sync with the extruder. An alternative solution would be that the first stepper in the list is the extruder by convention.
for the 8.: when I do some reorganization I will probably remove the multiple mixing_extruders altogether since they are only for convenience to hold some presets for mixings and that could also easily be done with gcode macros if required
Thanks.
I need to poll the initial rotation distance on the steppers and for that I need to make a method call on the ExtruderStepper (I added the get/set_rotation_distance in extruder.py for that) and this was the way I saw to get to the ExtruderSteppers having only their names.
I think a simpler way would be to add a get_extruder_stepper()
method call to the extruder.py and extruder_stepper.py .
The extruder_name is the extruder which is controlled by the G0/G1 commands and the steppers are the steppers I sync with the extruder. An alternative solution would be that the first stepper in the list is the extruder by convention.
I'm a little confused on the naming. In Klipper today, an "extruder" is the combination of a "hotend heater" and an "extruder stepper". Given that, wouldn't a "mixing extruder" be the combination of an "extruder" and n "extruder steppers"? Why would a mixing extruder have multiple hotends?
-Kevin
I need to poll the initial rotation distance on the steppers and for that I need to make a method call on the ExtruderStepper (I added the get/set_rotation_distance in extruder.py for that) and this was the way I saw to get to the ExtruderSteppers having only their names.
I think a simpler way would be to add a
get_extruder_stepper()
method call to the extruder.py and extruder_stepper.py .
That would be a solution for the extruder.py . But for the extruder_stepper.py that would not help since they are not registered with the printer as far as I see...
The extruder_name is the extruder which is controlled by the G0/G1 commands and the steppers are the steppers I sync with the extruder. An alternative solution would be that the first stepper in the list is the extruder by convention.
I'm a little confused on the naming. In Klipper today, an "extruder" is the combination of a "hotend heater" and an "extruder stepper". Given that, wouldn't a "mixing extruder" be the combination of an "extruder" and n "extruder steppers"? Why would a mixing extruder have multiple hotends?
exacly so extruder_name is the one extruder (which is used for the sync_to_extruder call target) and the steppers list are extruder steppers (where I set the rotation distance); one of which may be that extruder. Possibly I could figure out the extruder_name from the toolhead ...
But for the extruder_stepper.py that would not help since they are not registered with the printer as far as I see...
All "extras" modules are registered in the printer
object via the config name. For example, printer.lookup_object("extruder_stepper my_extra_stepper")
.
-Kevin
It looks like this GitHub Pull Request has become inactive. If there are any further updates, you can add a comment here or open a new ticket.
Best regards, ~ Your friendly GitIssueBot
PS: I'm just an automated script, not a human being.