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

Fix M166 Gradient Mix on delta printers #19285

Merged
merged 3 commits into from
Sep 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 6 additions & 1 deletion Marlin/src/feature/mixing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,12 @@ void Mixer::refresh_collector(const float proportion/*=1.0*/, const uint8_t t/*=
}

void Mixer::update_gradient_for_planner_z() {
update_gradient_for_z(planner.get_axis_position_mm(Z_AXIS));
#if ENABLED(DELTA)
get_cartesian_from_steppers();
update_gradient_for_z(cartes.z);
#else
update_gradient_for_z(planner.get_axis_position_mm(Z_AXIS));
#endif
}

#endif // GRADIENT_MIX
Expand Down
9 changes: 8 additions & 1 deletion Marlin/src/gcode/feature/mixing/M166.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,14 @@ void GcodeSuite::M166() {
echo_zt(mixer.gradient.end_vtool, mixer.gradient.end_z);

mixer.update_mix_from_gradient();
SERIAL_ECHOPAIR(" ; Current Z", planner.get_axis_position_mm(Z_AXIS));

SERIAL_ECHOPGM(" ; Current Z");
#if ENABLED(DELTA)
get_cartesian_from_steppers();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't this duplicative since mixer.update_mix_from_gradient() calls it?

SERIAL_ECHO(cartes.z);
#else
SERIAL_ECHO(planner.get_axis_position_mm(Z_AXIS));
#endif
echo_mix();
}

Expand Down