-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
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
Mixing Extruder Feature #3655
Mixing Extruder Feature #3655
Conversation
8df81dc
to
4a1feb7
Compare
@thinkyhead this is exactly the type of PR that does not fit on a RC as not every change can be encapsulated inside an |
@jbrazio This is not intended to be merged at this time. It's an exhibit. Sorry for the confusion.
AFAIK every change is in fact "encapsulated." With the feature off, Marlin should behave as usual. There might be one or two stylistic patches piggybacking here. |
You're right, but a fully encapsulated change don't mess with existing code for instance, this one does a lot of rework on |
The only "rework" I can see is the code in |
No please ! It's ok, I only frown a bit for RC but you already clarified that. |
In the long run, as with other features, it would be nice to encapsulate. But that might mean a bigger binary. |
bf8e844
to
f103012
Compare
f103012
to
70b0ff2
Compare
70b0ff2
to
b459bd0
Compare
0d366c5
to
1c41799
Compare
The |
7e6644d
to
29e3e38
Compare
Hola a Todos. Gracias. |
There is no colour mixing support in Marlin yet. And also very few Spanish |
Sorry for not translate. So I can not use it? .o There any solution? Canbiando plate or marlin ..... |
I know there are is at least one Marlin fork that had done it but I can't |
This can be http://www.marlinkimbra.it/?p=559? My problem is I'm new configuration not only step change but little more could you help me ?. I have saved my marlin |
If you plan to use Kimbra's Marlin, I think it is better if you contact him |
Ok thanks'll ask. Also if someone here can help seguire thread. Thank you |
No problem |
@manitas532 Actually, @emartinez167 is mistaken. There is color mixing support in Marlin 1.1.0. I'm the developer who implemented it. But it doesn't support the extra "stirring" motor that some extruders include. If you need help in configuring it, let me know and I will do what I can to help. It probably needs some testing and feedback, because there are very few people using it. This would be a good opportunity to fix it up. /**
* "Mixing Extruder"
* - Adds a new code, M165, to set the current mix factors.
* - Extends the stepping routines to move multiple steppers in proportion to the mix.
* - Optional support for Repetier Host M163, M164, and virtual extruder.
* - This implementation supports only a single extruder.
* - Enable DIRECT_MIXING_IN_G1 for Pia Taubert's reference implementation
*/
//#define MIXING_EXTRUDER
#if ENABLED(MIXING_EXTRUDER)
#define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder
#define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164
//#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands
#endif |
Sorry for that. I thought it was still in development mode. |
@thinkyhead please.. I don't have idea what I must do. If I can send you my marlin you will configure me this?? I'm afraid because I don't know do and I'm looked since 2 month ago.. Thank you for all |
alguien podría ayudarme a configurarlo el marlin para cyclops mixter?es que no consigo configurarlo me da errores |
@manitas532 All you need to do is enable With the feature enabled, you can then use Documentation on these commands: /**
* M163: Set a single mix factor for a mixing extruder
* This is called "weight" by some systems.
*
* S[index] The channel index to set
* P[float] The mix value
*
*/
/**
* M164: Store the current mix factors as a virtual tool.
*
* S[index] The virtual tool to store
*
*/
|
@thinkyhead . Thank you very much, My problem is that not compile. But thanks also |
@manitas532 If it fails to compile, post your configuration. |
@ thinkyhead G1 A0.2 B0.2 C0.6 E10 I have tried the format: M163 S0 P5
M163 S1 P1
M163 S2 P0
M164 S0 also M163 S0 P0.2
M163 S1 P0.2
M163 S2 P0.6
M164 S0 then initiating M104 T0 S240
G92 E0
M109 T0 S240 My extruder moves do nothing with the m codes... I am using Repetier-Host V1.6.2 and have set my virtual extruders set but the Any suggestions? Also is there a way to have the G1 method inserted only once at each colour change, rather than every extrusion move?? Also a few more questions because I think they will be quick answers for you ;) What is the max number of In Repetier-Host can I setup 5 scripts of 16 virtual mixing values - 80 colours? Thanks! mixing def code: #define MIXING_EXTRUDER
#if ENABLED(MIXING_EXTRUDER)
#define MIXING_STEPPERS 3 // Number of steppers in your mixing extruder
#define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164
#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands
#endif |
Hi @mkc2000 — Sorry to hear there's trouble in mixing-land. It hasn't been widely tested, so this is a good chance to make sure it's in proper working order. I'd recommend taking the
It should be set to the number of steppers that you have on the mixing extruder.
With When mixing, any values for mixing factors will work, but they are always "normalized" when they're stored. So for your example: M163 S0 P5
M163 S1 P1
M163 S2 P0
M164 S5
T5 This mix will be stored as Tool # The command |
Ideally yellow, cyan, magenta, (black, white). In a colour (paper) printer you can omit white - that's provided by the paper. |
Thanks for the reply Scott. ; Cyan
M163 S0 P1
M163 S1 P0
M163 S2 P0
M164 S0 P1
; Ocean
M163 S0 P5
M163 S1 P1
M163 S2 P0
M164 S1
; Blue
M163 S0 P1
M163 S1 P1
M163 S2 P0
M164 S2
; Violet
M163 S0 P1
M163 S1 P5
M163 S2 P0
M164 S3
; Magenta
M163 S0 P0
M163 S1 P1
M163 S2 P0
M164 S4
; Raspberry
M163 S0 P0
M163 S1 P5
M163 S2 P1
M164 S5
; Red
M163 S0 P0
M163 S1 P1
M163 S2 P1
M164 S6
; Orange
M163 S0 P0
M163 S1 P1
M163 S2 P5
M164 S7
; Yellow
M163 S0 P0
M163 S1 P0
M163 S2 P1
M164 S8
; Spring Green
M163 S0 P1
M163 S1 P0
M163 S2 P5
M164 S9
; Green
M163 S0 P1
M163 S1 P0
M163 S2 P1
M164 S10
; Turquoise
M163 S0 P5
M163 S1 P0
M163 S2 P1
M164 S11
; Cyan-Brown
M163 S0 P2
M163 S1 P1
M163 S2 P1
M164 S12
; Magenta-Brown
M163 S0 P1
M163 S1 P2
M163 S2 P1
M164 S13
; Yellow-Brown
M163 S0 P1
M163 S1 P1
M163 S2 P2
M164 S14
; Brown
M163 S0 P1
M163 S1 P1
M163 S2 P1
M164 S15
Program below generated with the Cura slicer in Repetier:
;Generated with Cura_SteamEngine 15.01
; Default start code
G28 ; Home extruder
G1 Z15 F100
M107 ; Turn off fan
G90 ; Absolute positioning
M82 ; Extruder in absolute mode
M190 S60
; Activate all used extruder
M104 T0 S240
G92 E0 ; Reset extruder position
; Wait for all used extruders to reach temperature
M109 T0 S240
;Layer count: 1
;LAYER:0
M107
G0 F9000 X3.652 Y32.175 Z0.300
;TYPE:SKIRT
G1 F1800 X20.312 Y32.175 E0.83117
G1 X20.312 Y48.835 E1.66234
G1 X3.652 Y48.835 E2.49351
G1 X3.652 Y32.175 E3.32468
G0 F9000 X4.052 Y32.575
G1 F1800 X19.912 Y32.575 E4.11594
G1 X19.912 Y48.435 E4.90720
G1 X4.052 Y48.435 E5.69846
G1 X4.052 Y32.575 E6.48972
G0 F9000 X4.452 Y32.975
G1 F1800 X19.512 Y32.975 E7.24106
G1 X19.512 Y48.035 E7.99241
G1 X4.452 Y48.035 E8.74376
G1 X4.452 Y32.975 E9.49510
G1 F2400 E5.49510
G0 F9000 X4.452 Y32.975 Z5.101
; Default end code
;G1 X0 Y0 Z130 ; Get extruder out of way. Uncomment to use!
M107 ; Turn off fan
; Disable all extruder
G91 ; Relative positioning
T0
G1 E-1 ; Reduce filament pressure
M104 T0 S0
M104 T1 S0
M104 T2 S0
M104 T3 S0
M104 T4 S0
M104 T5 S0
M104 T6 S0
M104 T7 S0
M104 T8 S0
M104 T9 S0
M104 T10 S0
M104 T11 S0
M104 T12 S0
M104 T13 S0
M104 T14 S0
M104 T15 S0
G90 ; Absolute positioning
G92 E0 ; Reset extruder position
M140 S0 ; Disable heated bed
M84 ; Turn steppers off |
I am thinking something Marlin_main.cpp #if ENABLED(MIXING_EXTRUDER)
void normalize_mix() {
float mix_total = 0.0;
for (int i = 0; i < MIXING_STEPPERS; i++) {
float v = mixing_factor[i];
if (v < 0) v = mixing_factor[i] = 0;
mix_total += v;
}
// Scale all values if they don't add up to ~1.0
if (mix_total < 0.9999 || mix_total > 1.0001) {
SERIAL_PROTOCOLLNPGM("Warning: Mix factors must add up to 1.0. Scaling.");
float mix_scale = 1.0 / mix_total;
for (int i = 0; i < MIXING_STEPPERS; i++)
mixing_factor[i] *= mix_scale;
}
}
#if ENABLED(DIRECT_MIXING_IN_G1)
// Get mixing parameters from the GCode
// Factors that are left out are set to 0
// The total "must" be 1.0 (but it will be normalized)
void gcode_get_mix() {
const char* mixing_codes = "ABCDHI";
for (int i = 0; i < MIXING_STEPPERS; i++)
mixing_factor[i] = code_seen(mixing_codes[i]) ? code_value_float() : 0;
normalize_mix();
}
#endif |
Answered my own question... |
True. You can't use both options. The solution is either for us to add a sanity check and prevent compiling with both options, or to change void gcode_get_mix() {
const char* mixing_codes = "ABCDHI";
for (int i = 0; i < MIXING_STEPPERS; i++) {
- float v = code_seen(mixing_codes[i]) ? code_value_float() : 0.0;
+ float v = code_seen(mixing_codes[i]) ? code_value_float() : RECIPROCAL(mixing_factor[i]);
NOLESS(v, 0.0);
mixing_factor[i] = RECIPROCAL(v);
}
normalize_mix();
} The reason for using |
Fixed with #5228. If you include any mix factors with |
Most of the email I receive about Marlin concerns this feature. So here is the implementation built on top of the current
RCBugFix
for those interested parties.MIXING_EXTRUDER_FEATURE
M163
,M164
as in Repetier HostM165
to set the mix in one lineABCDHI
mixing parameters inG1
commands (reference implementation)Concise diff: https://github.com/MarlinFirmware/Marlin/pull/3655/files?w=1