Skip to content

Commit

Permalink
Fix M166 Gradient Mix for DELTA (MarlinFirmware#19285)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kadah authored and thinkyhead committed Apr 29, 2021
1 parent b186ab9 commit 0bd7a2f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
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();
SERIAL_ECHO(cartes.z);
#else
SERIAL_ECHO(planner.get_axis_position_mm(Z_AXIS));
#endif
echo_mix();
}

Expand Down

0 comments on commit 0bd7a2f

Please sign in to comment.