623 { \ |
623 { \ |
624 current_position[LETTER##_AXIS] = 0; \ |
624 current_position[LETTER##_AXIS] = 0; \ |
625 plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); \ |
625 plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); \ |
626 destination[LETTER##_AXIS] = 1.1 * max_length[LETTER##_AXIS] * LETTER##_HOME_DIR; \ |
626 destination[LETTER##_AXIS] = 1.1 * max_length[LETTER##_AXIS] * LETTER##_HOME_DIR; \ |
627 feedrate = fast_home_feedrate[LETTER##_AXIS]; \ |
627 feedrate = fast_home_feedrate[LETTER##_AXIS]; \ |
628 plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder); \ |
628 plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder, false); \ |
629 st_synchronize();\ |
629 st_synchronize();\ |
630 \ |
630 \ |
631 current_position[LETTER##_AXIS] = 0;\ |
631 current_position[LETTER##_AXIS] = 0;\ |
632 plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);\ |
632 plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);\ |
633 destination[LETTER##_AXIS] = -LETTER##_HOME_RETRACT_MM * LETTER##_HOME_DIR;\ |
633 destination[LETTER##_AXIS] = -LETTER##_HOME_RETRACT_MM * LETTER##_HOME_DIR;\ |
634 plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder); \ |
634 plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder, false); \ |
635 st_synchronize();\ |
635 st_synchronize();\ |
636 \ |
636 \ |
637 destination[LETTER##_AXIS] = 2*LETTER##_HOME_RETRACT_MM * LETTER##_HOME_DIR;\ |
637 destination[LETTER##_AXIS] = 2*LETTER##_HOME_RETRACT_MM * LETTER##_HOME_DIR;\ |
638 feedrate = homing_feedrate[LETTER##_AXIS] ; \ |
638 feedrate = homing_feedrate[LETTER##_AXIS] ; \ |
639 plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder); \ |
639 plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder, false); \ |
640 st_synchronize();\ |
640 st_synchronize();\ |
641 \ |
641 \ |
642 current_position[LETTER##_AXIS] = LETTER##_HOME_POS;\ |
642 current_position[LETTER##_AXIS] = LETTER##_HOME_POS;\ |
643 destination[LETTER##_AXIS] = current_position[LETTER##_AXIS];\ |
643 destination[LETTER##_AXIS] = current_position[LETTER##_AXIS];\ |
644 feedrate = 0.0;\ |
644 feedrate = 0.0;\ |
1560 |
1566 |
1561 if(z_off_d > 0) |
1567 if(z_off_d > 0) |
1562 { |
1568 { |
1563 destination[Z_AXIS] += z_off_d; |
1569 destination[Z_AXIS] += z_off_d; |
1564 feedrate = fast_home_feedrate[Z_AXIS]; |
1570 feedrate = fast_home_feedrate[Z_AXIS]; |
1565 prepare_move(); |
1571 prepare_move(false); |
1566 destination[X_AXIS] = temp_position[X_AXIS] + x_off_d; |
1572 destination[X_AXIS] = temp_position[X_AXIS] + x_off_d; |
1567 destination[Y_AXIS] = temp_position[Y_AXIS] + y_off_d; |
1573 destination[Y_AXIS] = temp_position[Y_AXIS] + y_off_d; |
1568 feedrate = fast_home_feedrate[X_AXIS]; |
1574 feedrate = fast_home_feedrate[X_AXIS]; |
1569 prepare_move(); |
1575 prepare_move(false); |
1570 } else |
1576 } else |
1571 { |
1577 { |
1572 destination[X_AXIS] += x_off_d; |
1578 destination[X_AXIS] += x_off_d; |
1573 destination[Y_AXIS] += y_off_d; |
1579 destination[Y_AXIS] += y_off_d; |
1574 feedrate = fast_home_feedrate[X_AXIS]; |
1580 feedrate = fast_home_feedrate[X_AXIS]; |
1575 prepare_move(); |
1581 prepare_move(false); |
1576 destination[Z_AXIS] = temp_position[Z_AXIS] + z_off_d; |
1582 destination[Z_AXIS] = temp_position[Z_AXIS] + z_off_d; |
1577 feedrate = fast_home_feedrate[Z_AXIS]; |
1583 feedrate = fast_home_feedrate[Z_AXIS]; |
1578 prepare_move(); |
1584 prepare_move(false); |
1579 } |
1585 } |
1580 |
1586 |
1581 for(int8_t i=0; i < NUM_AXIS; i++) |
1587 for(int8_t i=0; i < NUM_AXIS; i++) |
1582 current_position[i] = temp_position[i]; |
1588 current_position[i] = temp_position[i]; |
1583 feedrate = next_feedrate; |
1589 feedrate = next_feedrate; |
1673 if (modified_destination[X_AXIS] > max_length[X_AXIS]) modified_destination[X_AXIS] = max_length[X_AXIS]; |
1679 if (modified_destination[X_AXIS] > max_length[X_AXIS]) modified_destination[X_AXIS] = max_length[X_AXIS]; |
1674 if (modified_destination[Y_AXIS] > max_length[Y_AXIS]) modified_destination[Y_AXIS] = max_length[Y_AXIS]; |
1680 if (modified_destination[Y_AXIS] > max_length[Y_AXIS]) modified_destination[Y_AXIS] = max_length[Y_AXIS]; |
1675 if (modified_destination[Z_AXIS] > max_length[Z_AXIS]) modified_destination[Z_AXIS] = max_length[Z_AXIS]; |
1681 if (modified_destination[Z_AXIS] > max_length[Z_AXIS]) modified_destination[Z_AXIS] = max_length[Z_AXIS]; |
1676 } |
1682 } |
1677 previous_millis_cmd = millis(); |
1683 previous_millis_cmd = millis(); |
1678 plan_buffer_line(modified_destination[X_AXIS], modified_destination[Y_AXIS], modified_destination[Z_AXIS], destination[E_AXIS], feedrate*feedmultiply/60/100.0, active_extruder); |
1684 plan_buffer_line(modified_destination[X_AXIS], modified_destination[Y_AXIS], modified_destination[Z_AXIS], destination[E_AXIS], feedrate*feedmultiply/60/100.0, active_extruder, laser_on); |
1679 for(int8_t i=0; i < NUM_AXIS; i++) { |
1685 for(int8_t i=0; i < NUM_AXIS; i++) { |
1680 current_position[i] = destination[i]; |
1686 current_position[i] = destination[i]; |
1681 } |
1687 } |
1682 } |
1688 } |
1683 |
1689 |