Browse Source

Make tool_change kinematic compatible

Scott Lahteine 8 years ago
parent
commit
847429eff4
1 changed files with 6 additions and 16 deletions
  1. 6
    16
      Marlin/Marlin_main.cpp

+ 6
- 16
Marlin/Marlin_main.cpp View File

7302
             float z_diff = hotend_offset[Z_AXIS][active_extruder] - hotend_offset[Z_AXIS][tmp_extruder],
7302
             float z_diff = hotend_offset[Z_AXIS][active_extruder] - hotend_offset[Z_AXIS][tmp_extruder],
7303
                   z_raise = 0.3 + (z_diff > 0.0 ? z_diff : 0.0);
7303
                   z_raise = 0.3 + (z_diff > 0.0 ? z_diff : 0.0);
7304
 
7304
 
7305
+            set_destination_to_current();
7306
+
7305
             // Always raise by some amount
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
             stepper.synchronize();
7310
             stepper.synchronize();
7315
 
7311
 
7316
             move_extruder_servo(active_extruder);
7312
             move_extruder_servo(active_extruder);
7318
 
7314
 
7319
             // Move back down, if needed
7315
             // Move back down, if needed
7320
             if (z_raise != z_diff) {
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
               stepper.synchronize();
7319
               stepper.synchronize();
7330
             }
7320
             }
7331
           #endif
7321
           #endif

Loading…
Cancel
Save