Browse Source

Fix inactive_extruder_x_pos for coordinate space

Scott Lahteine 9 years ago
parent
commit
b183442c61
1 changed files with 11 additions and 6 deletions
  1. 11
    6
      Marlin/Marlin_main.cpp

+ 11
- 6
Marlin/Marlin_main.cpp View File

3000
         int tmp_extruder = active_extruder;
3000
         int tmp_extruder = active_extruder;
3001
         active_extruder = !active_extruder;
3001
         active_extruder = !active_extruder;
3002
         HOMEAXIS(X);
3002
         HOMEAXIS(X);
3003
-        inactive_extruder_x_pos = current_position[X_AXIS];
3003
+        inactive_extruder_x_pos = RAW_X_POSITION(current_position[X_AXIS]);
3004
         active_extruder = tmp_extruder;
3004
         active_extruder = tmp_extruder;
3005
         HOMEAXIS(X);
3005
         HOMEAXIS(X);
3006
         // reset state used by the different modes
3006
         // reset state used by the different modes
6746
 
6746
 
6747
           switch (dual_x_carriage_mode) {
6747
           switch (dual_x_carriage_mode) {
6748
             case DXC_FULL_CONTROL_MODE:
6748
             case DXC_FULL_CONTROL_MODE:
6749
-              current_position[X_AXIS] = inactive_extruder_x_pos;
6750
-              inactive_extruder_x_pos = destination[X_AXIS];
6749
+              current_position[X_AXIS] = LOGICAL_X_POSITION(inactive_extruder_x_pos);
6750
+              inactive_extruder_x_pos = RAW_X_POSITION(destination[X_AXIS]);
6751
               break;
6751
               break;
6752
             case DXC_DUPLICATION_MODE:
6752
             case DXC_DUPLICATION_MODE:
6753
               active_extruder_parked = (active_extruder == 0); // this triggers the second extruder to move into the duplication position
6753
               active_extruder_parked = (active_extruder == 0); // this triggers the second extruder to move into the duplication position
6754
               if (active_extruder_parked)
6754
               if (active_extruder_parked)
6755
-                current_position[X_AXIS] = inactive_extruder_x_pos;
6755
+                current_position[X_AXIS] = LOGICAL_X_POSITION(inactive_extruder_x_pos);
6756
               else
6756
               else
6757
                 current_position[X_AXIS] = destination[X_AXIS] + duplicate_extruder_x_offset;
6757
                 current_position[X_AXIS] = destination[X_AXIS] + duplicate_extruder_x_offset;
6758
-              inactive_extruder_x_pos = destination[X_AXIS];
6758
+              inactive_extruder_x_pos = RAW_X_POSITION(destination[X_AXIS]);
6759
               extruder_duplication_enabled = false;
6759
               extruder_duplication_enabled = false;
6760
               break;
6760
               break;
6761
             default:
6761
             default:
8026
     if (active_extruder_parked) {
8026
     if (active_extruder_parked) {
8027
       if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && active_extruder == 0) {
8027
       if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && active_extruder == 0) {
8028
         // move duplicate extruder into correct duplication position.
8028
         // move duplicate extruder into correct duplication position.
8029
-        planner.set_position_mm(inactive_extruder_x_pos, current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
8029
+        planner.set_position_mm(
8030
+          LOGICAL_X_POSITION(inactive_extruder_x_pos),
8031
+          current_position[Y_AXIS],
8032
+          current_position[Z_AXIS],
8033
+          current_position[E_AXIS]
8034
+        );
8030
         planner.buffer_line(current_position[X_AXIS] + duplicate_extruder_x_offset,
8035
         planner.buffer_line(current_position[X_AXIS] + duplicate_extruder_x_offset,
8031
                          current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], planner.max_feedrate_mm_s[X_AXIS], 1);
8036
                          current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], planner.max_feedrate_mm_s[X_AXIS], 1);
8032
         SYNC_PLAN_POSITION_KINEMATIC();
8037
         SYNC_PLAN_POSITION_KINEMATIC();

Loading…
Cancel
Save