Merge pull request #136 from rGlory/e2e9fb45fa36cc9fe2be50b9133f1e17d00d015b

Home function fix
This commit is contained in:
kliment 2012-02-13 12:41:00 -08:00
commit a98a51f0cd

View file

@ -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;