Skip to content

Add mixing extruder support#4566

Closed
matyay wants to merge 17 commits into
Klipper3d:masterfrom
matyay:mixingextruder
Closed

Add mixing extruder support#4566
matyay wants to merge 17 commits into
Klipper3d:masterfrom
matyay:mixingextruder

Conversation

@matyay

@matyay matyay commented Aug 7, 2021

Copy link
Copy Markdown

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 <gruberp@googlemail.com>
Signed-off-by: Peter Gruber <gruberp@googlemail.com>
Signed-off-by: Peter Gruber <gruberp@googlemail.com>
Initial documentation for the mixingextruder section. Also documents
the available additional g-codes.

Signed-off-by: Peter Gruber <gruberp@googlemail.com>
Signed-off-by: Peter Gruber <gruberp@googlemail.com>
Signed-off-by: Peter Gruber <gruberp@googlemail.com>
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 <gruberp@googlemail.com>
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 <gruberp@googlemail.com>
Also make some small improvements and code cleanups.


Signed-off-by: Peter Gruber <gruberp@googlemail.com>
Signed-off-by: Peter Gruber <gruberp@googlemail.com>
Signed-off-by: Maciej Kurc <mkurc1234@gmail.com>
…ng extruder

Signed-off-by: Maciej Kurc <mkurc1234@gmail.com>
Signed-off-by: Maciej Kurc <mkurc1234@gmail.com>
matyay added 2 commits August 7, 2021 20:08
Signed-off-by: Maciej Kurc <mkurc1234@gmail.com>
Signed-off-by: Maciej Kurc <mkurc1234@gmail.com>
@binarylefmart

binarylefmart commented Aug 9, 2021

Copy link
Copy Markdown

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

matyay commented Aug 9, 2021

Copy link
Copy Markdown
Author

@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
Copy Markdown

https://paste.ofcode.org/DkdYWRHdGPKkvVExP2xxix

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

…er status

Signed-off-by: Maciej Kurc <mkurc1234@gmail.com>
@matyay

matyay commented Aug 10, 2021

Copy link
Copy Markdown
Author

@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
Copy Markdown

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

@binarylefmart

Copy link
Copy Markdown

PrtScr capture
PrtScr capture_2
PrtScr capture_3

@matyay

matyay commented Aug 10, 2021

Copy link
Copy Markdown
Author

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

… example config

Signed-off-by: Maciej Kurc <mkurc1234@gmail.com>
@binarylefmart

Copy link
Copy Markdown

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

@KevinOConnor

Copy link
Copy Markdown
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
Copy Markdown
Collaborator

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

-Kevin

@ETE-Design

Copy link
Copy Markdown

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
Copy Markdown
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

matyay commented Jan 11, 2022

Copy link
Copy Markdown
Author

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
Copy Markdown

@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
Copy Markdown
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
Copy Markdown

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