Browse Source

repaired homing position setting.

pull/1/head
Bernhard 13 years ago
parent
commit
460b788d78
  1. 39
      Marlin/Marlin.pde

39
Marlin/Marlin.pde

@ -539,33 +539,52 @@ FORCE_INLINE void process_commands()
#ifdef QUICK_HOME #ifdef QUICK_HOME
if( code_seen(axis_codes[0]) && code_seen(axis_codes[1]) ) //first diagonal move 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]); 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[X_AXIS] = 1.5 * X_MAX_LENGTH * X_HOME_DIR;destination[Y_AXIS] = 1.5 * Y_MAX_LENGTH * Y_HOME_DIR;
destination[Y_AXIS] = 1.5 * Y_MAX_LENGTH * Y_HOME_DIR; feedrate = homing_feedrate[X_AXIS];
feedrate =homing_feedrate[X_AXIS];
if(homing_feedrate[Y_AXIS]<feedrate) if(homing_feedrate[Y_AXIS]<feedrate)
feedrate =homing_feedrate[Y_AXIS]; feedrate =homing_feedrate[Y_AXIS];
prepare_move(); 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 #endif
if((home_all_axis) || (code_seen(axis_codes[X_AXIS]))) if((home_all_axis) || (code_seen(axis_codes[X_AXIS])))
{ {
HOMEAXIS(X); HOMEAXIS(X);
current_position[0]=code_value()+add_homeing[0];
} }
if((home_all_axis) || (code_seen(axis_codes[Y_AXIS]))) { if((home_all_axis) || (code_seen(axis_codes[Y_AXIS]))) {
HOMEAXIS(Y); HOMEAXIS(Y);
current_position[1]=code_value()+add_homeing[1];
} }
if((home_all_axis) || (code_seen(axis_codes[Z_AXIS]))) { if((home_all_axis) || (code_seen(axis_codes[Z_AXIS]))) {
HOMEAXIS(Z); 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 #ifdef ENDSTOPS_ONLY_FOR_HOMING
enable_endstops(false); enable_endstops(false);
#endif #endif

Loading…
Cancel
Save