From e661020adaa74c28a3ef8c1bfed1bd214d5dcc23 Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Tue, 21 Nov 2017 18:46:13 +0100 Subject: [PATCH] selftest for x_axis modified little bit to overcome problems with cables and PSU cover colision --- Firmware/ultralcd.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index c4cee605..08e68d44 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -5450,17 +5450,28 @@ static bool lcd_selfcheck_axis_sg(char axis) { float axis_length, current_position_init, current_position_final; float measured_axis_length[2]; float margin = 60; - float max_error_mm = 10; + float max_error_mm = 5; switch (axis) { case 0: axis_length = X_MAX_POS; break; case 1: axis_length = Y_MAX_POS + 8; break; default: axis_length = 210; break; } - tmc2130_sg_stop_on_crash = false; tmc2130_home_exit(); enable_endstops(true); + + if (axis == X_AXIS) { //there is collision between cables and PSU cover in X axis if Z coordinate is too low + + current_position[Z_AXIS] += 17; + plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], manual_feedrate[0] / 60, active_extruder); + tmc2130_home_enter(Z_AXIS_MASK); + st_synchronize(); + tmc2130_home_exit(); + } + + + // first axis length measurement begin tmc2130_home_enter(X_AXIS_MASK << axis); current_position[axis] -= (axis_length + margin);