Explorar el Código

Apply the ABL rotation matrix to the extruder offset.

Scott Lahteine hace 9 años
padre
commit
8e66028d25
Se han modificado 1 ficheros con 18 adiciones y 3 borrados
  1. 18
    3
      Marlin/Marlin_main.cpp

+ 18
- 3
Marlin/Marlin_main.cpp Ver fichero

@@ -5649,9 +5649,24 @@ inline void gcode_T(uint8_t tmp_extruder) {
5649 5649
             delayed_move_time = 0;
5650 5650
           }
5651 5651
         #else // !DUAL_X_CARRIAGE
5652
-          // Offset extruder (only by XY)
5653
-          for (int i = X_AXIS; i <= Y_AXIS; i++)
5654
-            current_position[i] += extruder_offset[i][tmp_extruder] - extruder_offset[i][active_extruder];
5652
+          #if ENABLED(AUTO_BED_LEVELING_FEATURE)
5653
+            // Offset extruder, make sure to apply the bed level rotation matrix
5654
+            vector_3 tmp_offset_vec = vector_3(extruder_offset[X_AXIS][tmp_extruder],
5655
+                                               extruder_offset[Y_AXIS][tmp_extruder],
5656
+                                               extruder_offset[Z_AXIS][tmp_extruder]),
5657
+                     act_offset_vec = vector_3(extruder_offset[X_AXIS][active_extruder],
5658
+                                               extruder_offset[Y_AXIS][active_extruder],
5659
+                                               extruder_offset[Z_AXIS][active_extruder]),
5660
+                     offset_vec = tmp_offset_vec - act_offset_vec;
5661
+            offset_vec.apply_rotation(plan_bed_level_matrix.transpose(plan_bed_level_matrix));
5662
+            current_position[X_AXIS] += offset_vec.x;
5663
+            current_position[Y_AXIS] += offset_vec.y;
5664
+            current_position[Z_AXIS] += offset_vec.z;
5665
+          #else // !AUTO_BED_LEVELING_FEATURE
5666
+            // Offset extruder (only by XY)
5667
+            for (int i=X_AXIS; i<=Y_AXIS; i++)
5668
+              current_position[i] += extruder_offset[i][tmp_extruder] - extruder_offset[i][active_extruder];
5669
+          #endif // !AUTO_BED_LEVELING_FEATURE
5655 5670
           // Set the new active extruder and position
5656 5671
           active_extruder = tmp_extruder;
5657 5672
         #endif // !DUAL_X_CARRIAGE

Loading…
Cancelar
Guardar