Fix a G34 bug, allow negative Z corrections (#13240)

This commit is contained in:
Bruce j Beare 2019-02-23 00:41:52 -08:00 committed by Scott Lahteine
parent edf025ed8d
commit 562f2321d2

View file

@ -88,7 +88,7 @@ void GcodeSuite::G34() {
}
const float z_auto_align_amplification = parser.floatval('A', Z_STEPPER_ALIGN_AMP);
if (!WITHIN(z_auto_align_amplification, 0.5f, 2.0f)) {
if (!WITHIN(ABS(z_auto_align_amplification), 0.5f, 2.0f)) {
SERIAL_ECHOLNPGM("?(A)mplification out of bounds (0.5-2.0).");
break;
}
@ -137,7 +137,7 @@ void GcodeSuite::G34() {
// For each iteration go through all probe positions (one per Z-Stepper)
for (uint8_t zstepper = 0; zstepper < Z_STEPPER_COUNT; ++zstepper) {
// Probe a Z height for each stepper
z_measured[zstepper] = probe_pt(z_auto_align_xpos[zstepper], z_auto_align_ypos[zstepper], PROBE_PT_RAISE, false);
z_measured[zstepper] = probe_pt(z_auto_align_xpos[zstepper], z_auto_align_ypos[zstepper], PROBE_PT_RAISE, 0, false);
// Stop on error
if (isnan(z_measured[zstepper])) {