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

Mixer Presets #21562

Merged
merged 37 commits into from
Aug 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
261e690
Mixer presets
Apr 8, 2021
17d5094
Merge branch 'bugfix-2.0.x' into PR2
Apr 9, 2021
e4dfc9a
Merge branch 'bugfix-2.0.x' into PR2
Apr 9, 2021
3e7e2b1
Merge branch 'bugfix-2.0.x' into PR2
Apr 10, 2021
6dbf460
Merge branch 'bugfix-2.0.x' into PR2
Apr 11, 2021
682a0ee
Merge branch 'bugfix-2.0.x' into PR2
Apr 12, 2021
6b863c3
Merge branch 'bugfix-2.0.x' into PR2
Apr 12, 2021
ecf620a
Merge branch 'bugfix-2.0.x' into PR2
Apr 13, 2021
311c4ba
Use celsius_t for temperature accessors
thinkyhead Apr 16, 2021
f6b6ac3
Merge branch 'bugfix-2.0.x' into PR2
Apr 16, 2021
050a97f
Merge remote-tracking branch 'MarlinFirmware/bugfix-2.0.x' into PR2
Apr 19, 2021
40991a1
clean up
Apr 19, 2021
2d8b37c
Merge remote-tracking branch 'MarlinFirmware/bugfix-2.0.x' into PR2
Apr 20, 2021
8f2371d
Merge remote-tracking branch 'MarlinFirmware/bugfix-2.0.x' into PR2
Apr 21, 2021
781f8fb
follow up
Apr 21, 2021
f62538a
Merge branch 'bugfix-2.0.x' into PR2
Apr 23, 2021
6941ea7
Merge branch 'bugfix-2.0.x' into PR2
Apr 23, 2021
e2d491f
Merge branch 'bugfix-2.0.x' into PR2
Apr 24, 2021
92afe15
follow up
Apr 24, 2021
6d42e6b
Merge branch 'bugfix-2.0.x' into PR2
Apr 24, 2021
a339d5d
Merge branch 'bugfix-2.0.x' into PR2
Apr 25, 2021
fb4a36c
Merge branch 'bugfix-2.0.x' into PR2
Apr 26, 2021
ef2377a
follow up
Apr 26, 2021
53ae8d8
Merge branch 'bugfix-2.0.x' into PR2
Apr 27, 2021
4433364
Merge branch 'bugfix-2.0.x' into PR2
Apr 28, 2021
e2dc3ca
Merge branch 'bugfix-2.0.x' into PR2
Apr 30, 2021
92a381d
Merge branch 'bugfix-2.0.x' into PR2
May 10, 2021
a44ad31
Merge branch 'bugfix-2.0.x' into PR2
May 16, 2021
15e3013
Merge branch 'bugfix-2.0.x' into PR2
May 19, 2021
3eb2d42
Merge branch 'bugfix-2.0.x' into PR2
Jun 9, 2021
24c857e
Merge branch 'bugfix-2.0.x' into PR2
Jun 14, 2021
f70c58f
Merge branch 'bugfix-2.0.x' into PR2
Jun 26, 2021
90a56a4
Merge branch 'bugfix-2.0.x' into PR2
Jul 21, 2021
cb8e316
Merge branch 'bugfix-2.0.x' into PR2
Jul 23, 2021
55efee6
Merge branch 'bugfix-2.0.x' into PR2
Aug 3, 2021
944518a
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into pr/21562
thinkyhead Aug 4, 2021
227a6b7
Move presets to reset_vtools
thinkyhead Aug 4, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@
#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
//#define GRADIENT_MIX // Support for gradient mixing with M166 and LCD
//#define MIXING_PRESETS // Assign 8 default V-tool presets for 2 or 3 MIXING_STEPPERS
#if ENABLED(GRADIENT_MIX)
//#define GRADIENT_VTOOL // Add M166 T to use a V-tool index as a Gradient alias
#endif
Expand Down
23 changes: 21 additions & 2 deletions Marlin/src/feature/mixing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,32 @@ void Mixer::reset_vtools() {
MIXER_STEPPER_LOOP(i)
color[t][i] = (i == 0) ? COLOR_A_MASK : 0;
#endif

// MIXING_PRESETS: Set a variety of obvious mixes as presets
#if ENABLED(MIXING_PRESETS) && WITHIN(MIXING_STEPPERS, 2, 3)
#if MIXING_STEPPERS == 2
if (MIXING_VIRTUAL_TOOLS > 2) { collector[0] = 1; collector[1] = 1; mixer.normalize(2); } // 1:1
if (MIXING_VIRTUAL_TOOLS > 3) { collector[0] = 3; mixer.normalize(3); } // 3:1
if (MIXING_VIRTUAL_TOOLS > 4) { collector[0] = 1; collector[1] = 3; mixer.normalize(4); } // 1:3
if (MIXING_VIRTUAL_TOOLS > 5) { collector[1] = 2; mixer.normalize(5); } // 1:2
if (MIXING_VIRTUAL_TOOLS > 6) { collector[0] = 2; collector[1] = 1; mixer.normalize(6); } // 2:1
if (MIXING_VIRTUAL_TOOLS > 7) { collector[0] = 3; collector[1] = 2; mixer.normalize(7); } // 3:2
#else
if (MIXING_VIRTUAL_TOOLS > 3) { collector[0] = 1; collector[1] = 1; collector[2] = 1; mixer.normalize(3); } // 1:1:1
if (MIXING_VIRTUAL_TOOLS > 4) { collector[1] = 3; collector[2] = 0; mixer.normalize(4); } // 1:3:0
if (MIXING_VIRTUAL_TOOLS > 5) { collector[0] = 0; collector[2] = 1; mixer.normalize(5); } // 0:3:1
if (MIXING_VIRTUAL_TOOLS > 6) { collector[1] = 1; mixer.normalize(6); } // 0:1:1
if (MIXING_VIRTUAL_TOOLS > 7) { collector[0] = 1; collector[2] = 0; mixer.normalize(7); } // 1:1:0
#endif
ZERO(collector);
#endif
}

// called at boot
void Mixer::init() {

ZERO(collector);

reset_vtools();

#if HAS_MIXER_SYNC_CHANNEL
Expand All @@ -119,8 +140,6 @@ void Mixer::init() {
color[MIXER_AUTORETRACT_TOOL][i] = COLOR_A_MASK;
#endif

ZERO(collector);

#if EITHER(HAS_DUAL_MIXING, GRADIENT_MIX)
update_mix_from_vtool();
#endif
Expand Down