repaired homing position setting.

This commit is contained in:
Bernhard 2011-12-07 20:54:34 +01:00
parent 12e8edcac3
commit 460b788d78

View file

@ -539,32 +539,51 @@ FORCE_INLINE void process_commands()
#ifdef QUICK_HOME
if( code_seen(axis_codes[0]) && code_seen(axis_codes[1]) ) //first diagonal move
{
current_position[X_AXIS] = 0; current_position[Y_AXIS] = 0;
current_position[X_AXIS] = 0;current_position[Y_AXIS] = 0;
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
destination[X_AXIS] = 1.5 * X_MAX_LENGTH * X_HOME_DIR;
destination[Y_AXIS] = 1.5 * Y_MAX_LENGTH * Y_HOME_DIR;
feedrate =homing_feedrate[X_AXIS];
destination[X_AXIS] = 1.5 * X_MAX_LENGTH * X_HOME_DIR;destination[Y_AXIS] = 1.5 * Y_MAX_LENGTH * Y_HOME_DIR;
feedrate = homing_feedrate[X_AXIS];
if(homing_feedrate[Y_AXIS]<feedrate)
feedrate =homing_feedrate[Y_AXIS];
prepare_move();
current_position[X_AXIS] = 0; current_position[Y_AXIS] = 0;
current_position[X_AXIS] = (X_HOME_DIR == -1) ? 0 : X_MAX_LENGTH;
current_position[Y_AXIS] = (Y_HOME_DIR == -1) ? 0 : Y_MAX_LENGTH;
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
destination[X_AXIS] = current_position[X_AXIS];
destination[Y_AXIS] = current_position[Y_AXIS];
feedrate = 0.0;
st_synchronize();
plan_set_position(0, 0, current_position[Z_AXIS], current_position[E_AXIS]);
current_position[X_AXIS] = 0;current_position[Y_AXIS] = 0;
endstops_hit_on_purpose();
}
#endif
if((home_all_axis) || (code_seen(axis_codes[X_AXIS])))
{
HOMEAXIS(X);
current_position[0]=code_value()+add_homeing[0];
}
if((home_all_axis) || (code_seen(axis_codes[Y_AXIS]))) {
HOMEAXIS(Y);
current_position[1]=code_value()+add_homeing[1];
}
if((home_all_axis) || (code_seen(axis_codes[Z_AXIS]))) {
HOMEAXIS(Z);
current_position[2]=code_value()+add_homeing[2];
}
if(code_seen(axis_codes[X_AXIS]))
{
current_position[0]=code_value()+add_homeing[0];
}
if(code_seen(axis_codes[Y_AXIS])) {
current_position[1]=code_value()+add_homeing[1];
}
if(code_seen(axis_codes[Z_AXIS])) {
current_position[2]=code_value()+add_homeing[2];
}
#ifdef ENDSTOPS_ONLY_FOR_HOMING
enable_endstops(false);