From e2e9fb45fa36cc9fe2be50b9133f1e17d00d015b Mon Sep 17 00:00:00 2001 From: Vyacheslav Kononenko Date: Mon, 13 Feb 2012 13:51:43 -0500 Subject: changed homing function to not conflict with min_software_endstops/max_software_endstops --- Sprinter/Sprinter.pde | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) (limited to 'Sprinter') diff --git a/Sprinter/Sprinter.pde b/Sprinter/Sprinter.pde index e3126b8..0462c95 100644 --- a/Sprinter/Sprinter.pde +++ b/Sprinter/Sprinter.pde @@ -583,16 +583,17 @@ inline void process_commands() if((home_all_axis) || (code_seen(axis_codes[0]))) { if ((X_MIN_PIN > -1 && X_HOME_DIR==-1) || (X_MAX_PIN > -1 && X_HOME_DIR==1)){ - current_position[0] = 0; - destination[0] = 1.5 * X_MAX_LENGTH * X_HOME_DIR; + current_position[0] = -1.5 * X_MAX_LENGTH * X_HOME_DIR; + destination[0] = 0; feedrate = homing_feedrate[0]; prepare_move(); - current_position[0] = 0; - destination[0] = -5 * X_HOME_DIR; + current_position[0] = 5 * X_HOME_DIR; + destination[0] = 0; prepare_move(); - destination[0] = 10 * X_HOME_DIR; + current_position[0] = -10 * X_HOME_DIR; + destination[0] = 0; prepare_move(); current_position[0] = (X_HOME_DIR == -1) ? 0 : X_MAX_LENGTH; @@ -603,16 +604,18 @@ inline void process_commands() if((home_all_axis) || (code_seen(axis_codes[1]))) { if ((Y_MIN_PIN > -1 && Y_HOME_DIR==-1) || (Y_MAX_PIN > -1 && Y_HOME_DIR==1)){ - current_position[1] = 0; - destination[1] = 1.5 * Y_MAX_LENGTH * Y_HOME_DIR; + current_position[1] = -1.5 * Y_MAX_LENGTH * Y_HOME_DIR; + destination[1] = 0; + feedrate = homing_feedrate[1]; prepare_move(); - current_position[1] = 0; - destination[1] = -5 * Y_HOME_DIR; + current_position[1] = 5 * Y_HOME_DIR; + destination[1] = 0; prepare_move(); - destination[1] = 10 * Y_HOME_DIR; + current_position[1] = -10 * Y_HOME_DIR; + destination[1] = 0; prepare_move(); current_position[1] = (Y_HOME_DIR == -1) ? 0 : Y_MAX_LENGTH; @@ -623,16 +626,17 @@ inline void process_commands() if((home_all_axis) || (code_seen(axis_codes[2]))) { if ((Z_MIN_PIN > -1 && Z_HOME_DIR==-1) || (Z_MAX_PIN > -1 && Z_HOME_DIR==1)){ - current_position[2] = 0; - destination[2] = 1.5 * Z_MAX_LENGTH * Z_HOME_DIR; + current_position[2] = -1.5 * Z_MAX_LENGTH * Z_HOME_DIR; + destination[2] = 0; feedrate = homing_feedrate[2]; prepare_move(); - current_position[2] = 0; - destination[2] = -2 * Z_HOME_DIR; + current_position[2] = 2 * Z_HOME_DIR; + destination[2] = 0; prepare_move(); - destination[2] = 10 * Z_HOME_DIR; + current_position[2] = -5 * Z_HOME_DIR; + destination[2] = 0; prepare_move(); current_position[2] = (Z_HOME_DIR == -1) ? 0 : Z_MAX_LENGTH; -- cgit v1.2.1