|
|
@ -513,20 +513,22 @@ bool code_seen(char code) |
|
|
|
destination[LETTER##_AXIS] = 1.5 * LETTER##_MAX_LENGTH * LETTER##_HOME_DIR; \ |
|
|
|
feedrate = homing_feedrate[LETTER##_AXIS]; \ |
|
|
|
plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder); \ |
|
|
|
st_synchronize();\ |
|
|
|
\ |
|
|
|
current_position[LETTER##_AXIS] = 0;\ |
|
|
|
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);\ |
|
|
|
destination[LETTER##_AXIS] = -LETTER##_HOME_RETRACT_MM * LETTER##_HOME_DIR;\ |
|
|
|
plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder); \ |
|
|
|
st_synchronize();\ |
|
|
|
\ |
|
|
|
destination[LETTER##_AXIS] = 2*LETTER##_HOME_RETRACT_MM * LETTER##_HOME_DIR;\ |
|
|
|
feedrate = homing_feedrate[LETTER##_AXIS]/2 ; \ |
|
|
|
plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder); \ |
|
|
|
st_synchronize();\ |
|
|
|
\ |
|
|
|
current_position[LETTER##_AXIS] = (LETTER##_HOME_DIR == -1) ? LETTER##_HOME_POS : LETTER##_MAX_LENGTH;\ |
|
|
|
destination[LETTER##_AXIS] = current_position[LETTER##_AXIS];\ |
|
|
|
feedrate = 0.0;\ |
|
|
|
st_synchronize();\ |
|
|
|
endstops_hit_on_purpose();\ |
|
|
|
} |
|
|
|
|
|
|
@ -589,13 +591,15 @@ void process_commands() |
|
|
|
feedrate = homing_feedrate[X_AXIS]; |
|
|
|
if(homing_feedrate[Y_AXIS]<feedrate) |
|
|
|
feedrate =homing_feedrate[Y_AXIS]; |
|
|
|
prepare_move(); |
|
|
|
plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder); \ |
|
|
|
st_synchronize(); |
|
|
|
|
|
|
|
current_position[X_AXIS] = (X_HOME_DIR == -1) ? X_HOME_POS : X_MAX_LENGTH; |
|
|
|
current_position[Y_AXIS] = (Y_HOME_DIR == -1) ? Y_HOME_POS : 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]; |
|
|
|
plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder); \ |
|
|
|
feedrate = 0.0; |
|
|
|
st_synchronize(); |
|
|
|
endstops_hit_on_purpose(); |
|
|
@ -1273,6 +1277,18 @@ void get_arc_coordinates() |
|
|
|
|
|
|
|
void prepare_move() |
|
|
|
{ |
|
|
|
if (min_software_endstops) { |
|
|
|
if (destination[X_AXIS] < X_HOME_POS) destination[X_AXIS] = X_HOME_POS; |
|
|
|
if (destination[Y_AXIS] < Y_HOME_POS) destination[Y_AXIS] = Y_HOME_POS; |
|
|
|
if (destination[Z_AXIS] < Z_HOME_POS) destination[Z_AXIS] = Z_HOME_POS; |
|
|
|
} |
|
|
|
|
|
|
|
if (max_software_endstops) { |
|
|
|
if (destination[X_AXIS] > X_MAX_LENGTH) destination[X_AXIS] = X_MAX_LENGTH; |
|
|
|
if (destination[Y_AXIS] > Y_MAX_LENGTH) destination[Y_AXIS] = Y_MAX_LENGTH; |
|
|
|
if (destination[Z_AXIS] > Z_MAX_LENGTH) destination[Z_AXIS] = Z_MAX_LENGTH; |
|
|
|
} |
|
|
|
|
|
|
|
plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate*feedmultiply/60/100.0, active_extruder); |
|
|
|
for(int8_t i=0; i < NUM_AXIS; i++) { |
|
|
|
current_position[i] = destination[i]; |
|
|
|