Skip to content

Commit 85330bc

Browse files
Kadahvgadreau
authored andcommitted
Fix M166 Gradient Mix for DELTA (MarlinFirmware#19285)
1 parent 2e5156f commit 85330bc

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

Marlin/src/feature/mixing.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,12 @@ void Mixer::refresh_collector(const float proportion/*=1.0*/, const uint8_t t/*=
180180
}
181181

182182
void Mixer::update_gradient_for_planner_z() {
183-
update_gradient_for_z(planner.get_axis_position_mm(Z_AXIS));
183+
#if ENABLED(DELTA)
184+
get_cartesian_from_steppers();
185+
update_gradient_for_z(cartes.z);
186+
#else
187+
update_gradient_for_z(planner.get_axis_position_mm(Z_AXIS));
188+
#endif
184189
}
185190

186191
#endif // GRADIENT_MIX

Marlin/src/gcode/feature/mixing/M166.cpp

+8-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,14 @@ void GcodeSuite::M166() {
8686
echo_zt(mixer.gradient.end_vtool, mixer.gradient.end_z);
8787

8888
mixer.update_mix_from_gradient();
89-
SERIAL_ECHOPAIR(" ; Current Z", planner.get_axis_position_mm(Z_AXIS));
89+
90+
SERIAL_ECHOPGM(" ; Current Z");
91+
#if ENABLED(DELTA)
92+
get_cartesian_from_steppers();
93+
SERIAL_ECHO(cartes.z);
94+
#else
95+
SERIAL_ECHO(planner.get_axis_position_mm(Z_AXIS));
96+
#endif
9097
echo_mix();
9198
}
9299

0 commit comments

Comments
 (0)