|
@@ -294,11 +294,14 @@ void GcodeSuite::G34() {
|
294
|
294
|
// Check for less accuracy compared to last move
|
295
|
295
|
if (last_z_align_move[zstepper] < z_align_abs * 0.7f) {
|
296
|
296
|
SERIAL_ECHOLNPGM("Decreasing accuracy detected.");
|
|
297
|
+ if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("> Z", int(zstepper + 1), " last_z_align_move = ", last_z_align_move[zstepper]);
|
|
298
|
+ if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("> Z", int(zstepper + 1), " z_align_abs = ", z_align_abs);
|
297
|
299
|
adjustment_reverse = !adjustment_reverse;
|
298
|
300
|
}
|
299
|
301
|
|
300
|
|
- // Remember the alignment for the next iteration
|
301
|
|
- last_z_align_move[zstepper] = z_align_abs;
|
|
302
|
+ // Remember the alignment for the next iteration, but only if steppers move,
|
|
303
|
+ // otherwise it would be just zero (in case this stepper was at z_measured_min already)
|
|
304
|
+ if (z_align_abs > 0) last_z_align_move[zstepper] = z_align_abs;
|
302
|
305
|
#endif
|
303
|
306
|
|
304
|
307
|
// Stop early if all measured points achieve accuracy target
|
|
@@ -312,8 +315,10 @@ void GcodeSuite::G34() {
|
312
|
315
|
#if DISABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS)
|
313
|
316
|
// Decreasing accuracy was detected so move was inverted.
|
314
|
317
|
// Will match reversed Z steppers on dual steppers. Triple will need more work to map.
|
315
|
|
- if (adjustment_reverse)
|
|
318
|
+ if (adjustment_reverse) {
|
316
|
319
|
z_align_move = -z_align_move;
|
|
320
|
+ if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("> Z", int(zstepper + 1), " correction reversed to ", z_align_move);
|
|
321
|
+ }
|
317
|
322
|
#endif
|
318
|
323
|
|
319
|
324
|
// Do a move to correct part of the misalignment for the current stepper
|