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

Add mixing extruder support #4566

Closed
wants to merge 17 commits into from
Closed

Conversation

matyay
Copy link

@matyay matyay commented Aug 7, 2021

This PR adds support for color mixing extruders. It is a continuation of #3920 with fixed bugs and added features.

It especially adds automatic retraction processing for mixing extruders as it requires special handling to be done correctly.

konsumverweigerer and others added 13 commits August 7, 2021 19:15
Supported G-codes are:

M163 Sx Pa:b:..:h, M164 Sx
     - set ratios for virtual mixing extruders
M567 Px Ea:b:..:h
     - set mixing for virtual mixing extruders
G1 Ea:b:..:h
     - extrude with mixing (allowed when mixingextruder is active)

ACTIVATE_EXTRUDER EXTRUDER=mixingextruder<x>
MIXING_STATUS EXTRUDER=mixingextruder<x>


Signed-off-by: Peter Gruber <[email protected]>
Initial documentation for the mixingextruder section. Also documents
the available additional g-codes.

Signed-off-by: Peter Gruber <[email protected]>
Add some basic g-code to control mixing and gradients. These commands
have comprehensive names and can be used to implement all flavors
(marlin, reprap) of the standard mixing g-codes M163-M166, M567 via
g-code macros. Samples for that are provided.


Signed-off-by: Peter Gruber <[email protected]>
Slicers usually produce g-codes to preheat tools/extruders before usage.
This will have undesire effects when multiple extruders share a heater.


Signed-off-by: Peter Gruber <[email protected]>
Also make some small improvements and code cleanups.


Signed-off-by: Peter Gruber <[email protected]>
@binarylefmart
Copy link

binarylefmart commented Aug 9, 2021

Hi @matyay, i tested the Branch but when i put the sample macro on my printer.cfg, this kill my mcu communication, have nothing on klippy.log.
Do you have an idea ?

@matyay
Copy link
Author

matyay commented Aug 9, 2021

@binarylefmart Hmm, Can you attach your config and klippy.log? When does the communication with MCU breaks? right from the beginning or when you issue some commands?

@binarylefmart
Copy link

https://paste.ofcode.org/DkdYWRHdGPKkvVExP2xxix

here is the file,it's weird it is like klipper lost the serial or have wrong script.

@matyay
Copy link
Author

matyay commented Aug 10, 2021

@binarylefmart I've pushed a fix. The original mixing extruder code returned a function object in its status. That probably caused the errors in your log:

  File "/usr/lib/python2.7/json/encoder.py", line 184, in default
    raise TypeError(repr(o) + " is not JSON serializable")
TypeError: <function <lambda> at 0x743c2130> is not JSON serializable

@binarylefmart
Copy link

always have the same issue, and have one too when i enable the extended g1 line.

@binarylefmart
Copy link

PrtScr capture
PrtScr capture_2
PrtScr capture_3

@matyay
Copy link
Author

matyay commented Aug 10, 2021

@binarylefmart Yeay, try removing the extended_g1 option completely. It shouldn't be there.

@binarylefmart
Copy link

When i remove it like i said, have the mcu issue

@KevinOConnor
Copy link
Collaborator

Thanks. My high-level feedback at this time is that we need to implement some architectural changes to Klipper's treatment of extruder stepper motors before we can add enhancements in this area. Currently the klipper extruder config section defines the parameters to a hotend, a heater, a temperature sensor, and an extruder stepper motor. I think we need a more clear abstraction so that it is possible to better control "extruder stepper motors". That work should improve future mixing extruder support as it would not require the user to define multiple dummy "extruder" sections.

-Kevin

@KevinOConnor KevinOConnor added the other work first Topic waiting for other changes to complete label Aug 31, 2021
@KevinOConnor
Copy link
Collaborator

FYI, this architectural work also effects #4489, #4082, and #3920.

-Kevin

@ETE-Design
Copy link

Thanks. My high-level feedback at this time is that we need to implement some architectural changes to Klipper's treatment of extruder stepper motors before we can add enhancements in this area. Currently the klipper extruder config section defines the parameters to a hotend, a heater, a temperature sensor, and an extruder stepper motor. I think we need a more clear abstraction so that it is possible to better control "extruder stepper motors". That work should improve future mixing extruder support as it would not require the user to define multiple dummy "extruder" sections.

-Kevin

Is this something you will work on in the feature?

@KevinOConnor KevinOConnor removed the other work first Topic waiting for other changes to complete label Jan 8, 2022
@KevinOConnor
Copy link
Collaborator

Thanks. I'm not sure what the state of this PR is. If there is still interest in this topic then the PR will need to be updated and a reviewer will need to volunteer to review it ( https://www.klipper3d.org/CONTRIBUTING.html ). Unfortunately, due to time constraints on my side it is unlikely I will be reviewing this PR.

A good place to discuss this PR, get testers, and engage a reviewer is on the Klipper Discourse server ( https://www.klipper3d.org/Contact.html ).

-Kevin

@matyay
Copy link
Author

matyay commented Jan 11, 2022

Hi, I'm willing to continue the work on this feature but I'm short on time right now. Besides that I need to do some work on my 3D printer which has the mixing hotend, otherwise I won't be able to test the code.

@ETE-Design
Copy link

@matyay Good to hear that your back, and can work on again mabye in a not so far away future... Really would like to have this feature added to Klipper

@KevinOConnor
Copy link
Collaborator

FYI, #5143 makes it possible to call SET_EXTRUDER_STEP_DISTANCE on extruder_stepper objects, which may make it possible to implement mixing extruders via extruder_stepper objects.

-Kevin

@github-actions
Copy link

Unfortunately a reviewer has not assigned themselves to this GitHub Pull Request and it is therefore being closed. It is a good idea to move further discussion to the Klipper Discourse server. Reviewers can reach out on that forum to let you know if they are interested and when they are available.

Best regards,
~ Your friendly GitIssueBot

PS: I'm just an automated script, not a human being.

@github-actions github-actions bot closed this Mar 14, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Mar 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants