Просмотр исходного кода

Make tool_change kinematic compatible

Scott Lahteine 8 лет назад
Родитель
Сommit
847429eff4
1 измененных файлов: 6 добавлений и 16 удалений
  1. 6
    16
      Marlin/Marlin_main.cpp

+ 6
- 16
Marlin/Marlin_main.cpp Просмотреть файл

@@ -7302,15 +7302,11 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n
7302 7302
             float z_diff = hotend_offset[Z_AXIS][active_extruder] - hotend_offset[Z_AXIS][tmp_extruder],
7303 7303
                   z_raise = 0.3 + (z_diff > 0.0 ? z_diff : 0.0);
7304 7304
 
7305
+            set_destination_to_current();
7306
+
7305 7307
             // Always raise by some amount
7306
-            planner.buffer_line(
7307
-              current_position[X_AXIS],
7308
-              current_position[Y_AXIS],
7309
-              current_position[Z_AXIS] + z_raise,
7310
-              current_position[E_AXIS],
7311
-              planner.max_feedrate_mm_s[Z_AXIS],
7312
-              active_extruder
7313
-            );
7308
+            destination[Z_AXIS] += z_raise;
7309
+            planner.buffer_line_kinematic(destination, planner.max_feedrate_mm_s[Z_AXIS], active_extruder);
7314 7310
             stepper.synchronize();
7315 7311
 
7316 7312
             move_extruder_servo(active_extruder);
@@ -7318,14 +7314,8 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n
7318 7314
 
7319 7315
             // Move back down, if needed
7320 7316
             if (z_raise != z_diff) {
7321
-              planner.buffer_line(
7322
-                current_position[X_AXIS],
7323
-                current_position[Y_AXIS],
7324
-                current_position[Z_AXIS] + z_diff,
7325
-                current_position[E_AXIS],
7326
-                planner.max_feedrate_mm_s[Z_AXIS],
7327
-                active_extruder
7328
-              );
7317
+              destination[Z_AXIS] = current_position[Z_AXIS] + z_diff;
7318
+              planner.buffer_line_kinematic(destination, planner.max_feedrate_mm_s[Z_AXIS], active_extruder);
7329 7319
               stepper.synchronize();
7330 7320
             }
7331 7321
           #endif

Загрузка…
Отмена
Сохранить