diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h
index 9ecbdb8f3c29968fafc6b9c49dee5c1c11bfb316..432055eb3ee7b6bb91d60904143fc6de72e7e548 100644
--- a/Marlin/Configuration.h
+++ b/Marlin/Configuration.h
@@ -306,6 +306,9 @@ Here are some standard links for getting your machine calibrated:
 // Uncomment this option to enable CoreXY kinematics
 // #define COREXY
 
+// Uncomment this option to enable CoreXZ kinematics
+// #define COREXZ
+
 // Enable this option for Toshiba steppers
 //#define CONFIG_STEPPERS_TOSHIBA
 
diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h
index 4846d12b7c82baaf6254ef67e501f4eb7f54839b..7bdb12b7aa9815670b34509b6d8d5921e0a60478 100644
--- a/Marlin/Marlin.h
+++ b/Marlin/Marlin.h
@@ -196,7 +196,7 @@ void manage_inactivity(bool ignore_stepper_queue=false);
  * A_AXIS and B_AXIS are used by COREXY printers
  * X_HEAD and Y_HEAD is used for systems that don't have a 1:1 relationship between X_AXIS and X Head movement, like CoreXY bots.
  */
-enum AxisEnum {X_AXIS=0, Y_AXIS=1, A_AXIS=0, B_AXIS=1, Z_AXIS=2, E_AXIS=3, X_HEAD=4, Y_HEAD=5};
+enum AxisEnum {X_AXIS=0, A_AXIS=0, Y_AXIS=1, B_AXIS=1, Z_AXIS=2, C_AXIS=2, E_AXIS=3, X_HEAD=4, Y_HEAD=5, Z_HEAD=5};
 
 enum EndstopEnum {X_MIN=0, Y_MIN=1, Z_MIN=2, Z_PROBE=3, X_MAX=4, Y_MAX=5, Z_MAX=6, Z2_MIN=7, Z2_MAX=8};
 
diff --git a/Marlin/configurator/config/Configuration.h b/Marlin/configurator/config/Configuration.h
index 9ecbdb8f3c29968fafc6b9c49dee5c1c11bfb316..432055eb3ee7b6bb91d60904143fc6de72e7e548 100644
--- a/Marlin/configurator/config/Configuration.h
+++ b/Marlin/configurator/config/Configuration.h
@@ -306,6 +306,9 @@ Here are some standard links for getting your machine calibrated:
 // Uncomment this option to enable CoreXY kinematics
 // #define COREXY
 
+// Uncomment this option to enable CoreXZ kinematics
+// #define COREXZ
+
 // Enable this option for Toshiba steppers
 //#define CONFIG_STEPPERS_TOSHIBA
 
diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h
index 85186922f28001ff9212407f385c42847cd07beb..a3806de99c07548c7620324af978b4c6132214ca 100644
--- a/Marlin/example_configurations/Felix/Configuration.h
+++ b/Marlin/example_configurations/Felix/Configuration.h
@@ -288,6 +288,9 @@ Here are some standard links for getting your machine calibrated:
 // Uncomment this option to enable CoreXY kinematics
 // #define COREXY
 
+// Uncomment this option to enable CoreXZ kinematics
+// #define COREXZ
+
 // Enable this option for Toshiba steppers
 //#define CONFIG_STEPPERS_TOSHIBA
 
diff --git a/Marlin/example_configurations/Felix/Configuration_DUAL.h b/Marlin/example_configurations/Felix/Configuration_DUAL.h
index d75109ac1e73b9d80aef1a0327c6f51cec908152..81db1aae3a9f23e00e3d6624a3f6711908f386f3 100644
--- a/Marlin/example_configurations/Felix/Configuration_DUAL.h
+++ b/Marlin/example_configurations/Felix/Configuration_DUAL.h
@@ -273,6 +273,9 @@ Here are some standard links for getting your machine calibrated:
 // Uncomment this option to enable CoreXY kinematics
 // #define COREXY
 
+// Uncomment this option to enable CoreXZ kinematics
+// #define COREXZ
+
 // Enable this option for Toshiba steppers
 //#define CONFIG_STEPPERS_TOSHIBA
 
diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h
index 791e5b0e10712d6b626eac91ecc8c6ec6e8aa7ca..4b0192a50c0e7ed11b409dd419d3dcb956aa986b 100644
--- a/Marlin/example_configurations/Hephestos/Configuration.h
+++ b/Marlin/example_configurations/Hephestos/Configuration.h
@@ -298,6 +298,9 @@ Here are some standard links for getting your machine calibrated:
 // Uncomment this option to enable CoreXY kinematics
 // #define COREXY
 
+// Uncomment this option to enable CoreXZ kinematics
+// #define COREXZ
+
 // Enable this option for Toshiba steppers
 //#define CONFIG_STEPPERS_TOSHIBA
 
diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h
index 48b67d9ab8480fecd2f0eb07218f917b032c269c..d7e78116296d5d6c61f50c28c104ed6eb87526fb 100644
--- a/Marlin/example_configurations/K8200/Configuration.h
+++ b/Marlin/example_configurations/K8200/Configuration.h
@@ -294,6 +294,9 @@ Here are some standard links for getting your machine calibrated:
 // Uncomment this option to enable CoreXY kinematics
 // #define COREXY
 
+// Uncomment this option to enable CoreXZ kinematics
+// #define COREXZ
+
 // Enable this option for Toshiba steppers
 //#define CONFIG_STEPPERS_TOSHIBA
 
diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h
index ae47a35d955daf18c7f3eb2df5fd6316dd47f4ac..540019e4512aaf83e2ae58e981a7fb12db43581b 100644
--- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h
+++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h
@@ -306,6 +306,9 @@ Here are some standard links for getting your machine calibrated:
 // Uncomment this option to enable CoreXY kinematics
 // #define COREXY
 
+// Uncomment this option to enable CoreXZ kinematics
+// #define COREXZ
+
 // Enable this option for Toshiba steppers
 //#define CONFIG_STEPPERS_TOSHIBA
 
diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h
index 552540cf1f0fde435b35b20d75379449094b2bc5..a835a83b4079091ffae437648d4d9031f40496a8 100644
--- a/Marlin/example_configurations/SCARA/Configuration.h
+++ b/Marlin/example_configurations/SCARA/Configuration.h
@@ -314,6 +314,9 @@ Here are some standard links for getting your machine calibrated:
 // Uncomment this option to enable CoreXY kinematics
 // #define COREXY
 
+// Uncomment this option to enable CoreXZ kinematics
+// #define COREXZ
+
 // Enable this option for Toshiba steppers
 //#define CONFIG_STEPPERS_TOSHIBA
 
diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h
index c9ddf8410b0065ffe05f3aa0072a1a1cdb31c595..5fb542f6de25b4739fc8c0eb6847a6838730f77e 100644
--- a/Marlin/example_configurations/WITBOX/Configuration.h
+++ b/Marlin/example_configurations/WITBOX/Configuration.h
@@ -298,6 +298,9 @@ Here are some standard links for getting your machine calibrated:
 // Uncomment this option to enable CoreXY kinematics
 // #define COREXY
 
+// Uncomment this option to enable CoreXZ kinematics
+// #define COREXZ
+
 // Enable this option for Toshiba steppers
 //#define CONFIG_STEPPERS_TOSHIBA
 
diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h
index c7ef630e6978f1cd52d0d2046ca6c92e03e13470..d9aef0431cd39f5062cc54922fab47b02a9056e1 100644
--- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h
+++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h
@@ -306,6 +306,9 @@ Here are some standard links for getting your machine calibrated:
 // Uncomment this option to enable CoreXY kinematics
 // #define COREXY
 
+// Uncomment this option to enable CoreXZ kinematics
+// #define COREXZ
+
 // Enable this option for Toshiba steppers
 //#define CONFIG_STEPPERS_TOSHIBA
 
diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h
index 8844d6a6782a58d274f68c16a8b3807dcf58aef7..378a454fa94542482e8609f492ddcb1c3ddf1a70 100644
--- a/Marlin/example_configurations/delta/biv2.5/Configuration.h
+++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h
@@ -306,6 +306,9 @@ Here are some standard links for getting your machine calibrated:
 // Uncomment this option to enable CoreXY kinematics
 // #define COREXY
 
+// Uncomment this option to enable CoreXZ kinematics
+// #define COREXZ
+
 //===========================================================================
 //============================== Delta Settings =============================
 //===========================================================================
diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h
index 9088318bd1a35c7c8977459585abe20790e18d74..646e3118b54943d14f5fbc024171542bfb2f55d7 100644
--- a/Marlin/example_configurations/delta/generic/Configuration.h
+++ b/Marlin/example_configurations/delta/generic/Configuration.h
@@ -306,6 +306,9 @@ Here are some standard links for getting your machine calibrated:
 // Uncomment this option to enable CoreXY kinematics
 // #define COREXY
 
+// Uncomment this option to enable CoreXZ kinematics
+// #define COREXZ
+
 //===========================================================================
 //============================== Delta Settings =============================
 //===========================================================================
diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h
index a9be123f8770f3de3bbd5c24928ef67258d032e3..129c1c1a247d0d23286f5fdd8a9b6201ed5afa07 100644
--- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h
+++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h
@@ -306,6 +306,9 @@ Here are some standard links for getting your machine calibrated:
 // Uncomment this option to enable CoreXY kinematics
 // #define COREXY
 
+// Uncomment this option to enable CoreXZ kinematics
+// #define COREXZ
+
 //===========================================================================
 //============================== Delta Settings =============================
 //===========================================================================
diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h
index 302d234e0a6d54bb00b4da9336f4414b2a3c569d..0d065e903c42c854b10bf68d1c55ac110406e73f 100644
--- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h
+++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h
@@ -293,6 +293,9 @@ Here are some standard links for getting your machine calibrated:
 // Uncomment this option to enable CoreXY kinematics
 // #define COREXY
 
+// Uncomment this option to enable CoreXZ kinematics
+// #define COREXZ
+
 //===========================================================================
 //============================== Delta Settings =============================
 //===========================================================================
diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h
index 0a5f8fb9a3c6c5eea0f7a9c7f80aa8bcfcd54254..ffb062a0a8ae3aa0531432023cdb7b230fc32d2e 100644
--- a/Marlin/example_configurations/makibox/Configuration.h
+++ b/Marlin/example_configurations/makibox/Configuration.h
@@ -309,6 +309,9 @@ Here are some standard links for getting your machine calibrated:
 // Uncomment this option to enable CoreXY kinematics
 // #define COREXY
 
+// Uncomment this option to enable CoreXZ kinematics
+// #define COREXZ
+
 // Enable this option for Toshiba steppers
 //#define CONFIG_STEPPERS_TOSHIBA
 
diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h
index 4bfc6e28466330fc023f7c55e9087c3edfae4e2f..79bcb76d3320c00443753083cfe80b0a2d5a6197 100644
--- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h
+++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h
@@ -296,6 +296,9 @@ Here are some standard links for getting your machine calibrated:
 // Uncomment this option to enable CoreXY kinematics
 // #define COREXY
 
+// Uncomment this option to enable CoreXZ kinematics
+// #define COREXZ
+
 // Enable this option for Toshiba steppers
 #define CONFIG_STEPPERS_TOSHIBA
 
diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp
index d9a52c0bc00dd4d9e18f95b9ce9d97ba4c054ac4..4460a7b3b97fd029c7fe6b42bbf7ce2515ebc761 100644
--- a/Marlin/planner.cpp
+++ b/Marlin/planner.cpp
@@ -541,13 +541,19 @@ float junction_deviation = 0.1;
     // these equations follow the form of the dA and dB equations on http://www.corexy.com/theory.html
     block->steps[A_AXIS] = labs(dx + dy);
     block->steps[B_AXIS] = labs(dx - dy);
+    block->steps[Z_AXIS] = labs(dz);
+  #elif defined(COREXZ)
+    // corexz planning
+    block->steps[A_AXIS] = labs(dx + dz);
+    block->steps[Y_AXIS] = labs(dy);
+    block->steps[C_AXIS] = labs(dx - dz);
   #else
     // default non-h-bot planning
     block->steps[X_AXIS] = labs(dx);
     block->steps[Y_AXIS] = labs(dy);
+    block->steps[Z_AXIS] = labs(dz);
   #endif
 
-  block->steps[Z_AXIS] = labs(dz);
   block->steps[E_AXIS] = labs(de);
   block->steps[E_AXIS] *= volumetric_multiplier[extruder];
   block->steps[E_AXIS] *= extruder_multiplier[extruder];
@@ -568,13 +574,20 @@ float junction_deviation = 0.1;
   #ifdef COREXY
     if (dx < 0) db |= BIT(X_HEAD); // Save the real Extruder (head) direction in X Axis
     if (dy < 0) db |= BIT(Y_HEAD); // ...and Y
+    if (dz < 0) db |= BIT(Z_AXIS);
     if (dx + dy < 0) db |= BIT(A_AXIS); // Motor A direction
     if (dx - dy < 0) db |= BIT(B_AXIS); // Motor B direction
+  #elif defined(COREXZ)
+    if (dx < 0) db |= BIT(X_HEAD); // Save the real Extruder (head) direction in X Axis
+    if (dy < 0) db |= BIT(Y_AXIS);
+    if (dz < 0) db |= BIT(Z_HEAD); // ...and Z
+    if (dx + dz < 0) db |= BIT(A_AXIS); // Motor A direction
+    if (dx - dz < 0) db |= BIT(C_AXIS); // Motor B direction
   #else
     if (dx < 0) db |= BIT(X_AXIS);
     if (dy < 0) db |= BIT(Y_AXIS); 
+    if (dz < 0) db |= BIT(Z_AXIS);
   #endif
-  if (dz < 0) db |= BIT(Z_AXIS);
   if (de < 0) db |= BIT(E_AXIS); 
   block->direction_bits = db;
 
@@ -586,13 +599,20 @@ float junction_deviation = 0.1;
       enable_x();
       enable_y();
     }
+    #ifndef Z_LATE_ENABLE
+      if (block->steps[Z_AXIS]) enable_z();
+    #endif
+  #elif defined(COREXZ)
+    if (block->steps[A_AXIS] || block->steps[C_AXIS]) {
+      enable_x();
+      enable_z();
+    }
   #else
     if (block->steps[X_AXIS]) enable_x();
     if (block->steps[Y_AXIS]) enable_y();
-  #endif
-
-  #ifndef Z_LATE_ENABLE
-    if (block->steps[Z_AXIS]) enable_z();
+    #ifndef Z_LATE_ENABLE
+      if (block->steps[Z_AXIS]) enable_z();
+    #endif
   #endif
 
   // Enable extruder(s)
@@ -676,14 +696,22 @@ float junction_deviation = 0.1;
     float delta_mm[6];
     delta_mm[X_HEAD] = dx / axis_steps_per_unit[A_AXIS];
     delta_mm[Y_HEAD] = dy / axis_steps_per_unit[B_AXIS];
+    delta_mm[Z_AXIS] = dz / axis_steps_per_unit[Z_AXIS];
     delta_mm[A_AXIS] = (dx + dy) / axis_steps_per_unit[A_AXIS];
     delta_mm[B_AXIS] = (dx - dy) / axis_steps_per_unit[B_AXIS];
+  #elif defined(COREXZ)
+    float delta_mm[6];
+    delta_mm[X_HEAD] = dx / axis_steps_per_unit[A_AXIS];
+    delta_mm[Y_AXIS] = dy / axis_steps_per_unit[Y_AXIS];
+    delta_mm[Z_HEAD] = dz / axis_steps_per_unit[C_AXIS];
+    delta_mm[A_AXIS] = (dx + dz) / axis_steps_per_unit[A_AXIS];
+    delta_mm[C_AXIS] = (dx - dz) / axis_steps_per_unit[C_AXIS];
   #else
     float delta_mm[4];
     delta_mm[X_AXIS] = dx / axis_steps_per_unit[X_AXIS];
     delta_mm[Y_AXIS] = dy / axis_steps_per_unit[Y_AXIS];
+    delta_mm[Z_AXIS] = dz / axis_steps_per_unit[Z_AXIS];
   #endif
-  delta_mm[Z_AXIS] = dz / axis_steps_per_unit[Z_AXIS];
   delta_mm[E_AXIS] = (de / axis_steps_per_unit[E_AXIS]) * volumetric_multiplier[extruder] * extruder_multiplier[extruder] / 100.0;
 
   if (block->steps[X_AXIS] <= dropsegments && block->steps[Y_AXIS] <= dropsegments && block->steps[Z_AXIS] <= dropsegments) {
@@ -692,11 +720,12 @@ float junction_deviation = 0.1;
   else {
     block->millimeters = sqrt(
       #ifdef COREXY
-        square(delta_mm[X_HEAD]) + square(delta_mm[Y_HEAD])
+        square(delta_mm[X_HEAD]) + square(delta_mm[Y_HEAD]) + square(delta_mm[Z_AXIS])
+      #elif defined(COREXZ)
+        square(delta_mm[X_HEAD]) + square(delta_mm[Y_AXIS]) + square(delta_mm[Z_HEAD])
       #else
-        square(delta_mm[X_AXIS]) + square(delta_mm[Y_AXIS])
+        square(delta_mm[X_AXIS]) + square(delta_mm[Y_AXIS]) + square(delta_mm[Z_AXIS])
       #endif
-      + square(delta_mm[Z_AXIS])
     );
   }
   float inverse_millimeters = 1.0 / block->millimeters;  // Inverse millimeters to remove multiple divides 
diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp
index 4bf2e1d9ee2844701681289f88deaa19167a9d20..f802bc1c5a64c63863ed0a0e050b45cd4d143373 100644
--- a/Marlin/stepper.cpp
+++ b/Marlin/stepper.cpp
@@ -342,34 +342,38 @@ FORCE_INLINE unsigned short calc_timer(unsigned short step_rate) {
   return timer;
 }
 
-// set the stepper direction of each axis
+/**
+ * Set the stepper direction of each axis
+ *
+ *   X_AXIS=A_AXIS and Y_AXIS=B_AXIS for COREXY
+ *   X_AXIS=A_AXIS and Z_AXIS=C_AXIS for COREXZ
+ */
 void set_stepper_direction() {
-  
-  // Set the direction bits (X_AXIS=A_AXIS and Y_AXIS=B_AXIS for COREXY)
-  if (TEST(out_bits, X_AXIS)) {
-    X_APPLY_DIR(INVERT_X_DIR,0);
+
+  if (TEST(out_bits, X_AXIS)) { // A_AXIS
+    X_APPLY_DIR(INVERT_X_DIR, 0);
     count_direction[X_AXIS] = -1;
   }
   else {
-    X_APPLY_DIR(!INVERT_X_DIR,0);
+    X_APPLY_DIR(!INVERT_X_DIR, 0);
     count_direction[X_AXIS] = 1;
   }
 
-  if (TEST(out_bits, Y_AXIS)) {
-    Y_APPLY_DIR(INVERT_Y_DIR,0);
+  if (TEST(out_bits, Y_AXIS)) { // B_AXIS
+    Y_APPLY_DIR(INVERT_Y_DIR, 0);
     count_direction[Y_AXIS] = -1;
   }
   else {
-    Y_APPLY_DIR(!INVERT_Y_DIR,0);
+    Y_APPLY_DIR(!INVERT_Y_DIR, 0);
     count_direction[Y_AXIS] = 1;
   }
   
-  if (TEST(out_bits, Z_AXIS)) {
-    Z_APPLY_DIR(INVERT_Z_DIR,0);
+  if (TEST(out_bits, Z_AXIS)) { // C_AXIS
+    Z_APPLY_DIR(INVERT_Z_DIR, 0);
     count_direction[Z_AXIS] = -1;
   }
   else {
-    Z_APPLY_DIR(!INVERT_Z_DIR,0);
+    Z_APPLY_DIR(!INVERT_Z_DIR, 0);
     count_direction[Z_AXIS] = 1;
   }
   
@@ -503,6 +507,11 @@ ISR(TIMER1_COMPA_vect) {
         // If DeltaX == -DeltaY, the movement is only in Y axis
         if ((current_block->steps[A_AXIS] != current_block->steps[B_AXIS]) || (TEST(out_bits, A_AXIS) == TEST(out_bits, B_AXIS))) {
           if (TEST(out_bits, X_HEAD))
+      #elif defined(COREXZ)
+        // Head direction in -X axis for CoreXZ bots.
+        // If DeltaX == -DeltaZ, the movement is only in Z axis
+        if ((current_block->steps[A_AXIS] != current_block->steps[C_AXIS]) || (TEST(out_bits, A_AXIS) == TEST(out_bits, C_AXIS))) {
+          if (TEST(out_bits, X_HEAD))
       #else
           if (TEST(out_bits, X_AXIS))   // stepping along -X axis (regular Cartesian bot)
       #endif
@@ -528,8 +537,11 @@ ISR(TIMER1_COMPA_vect) {
                 #endif
               }
           }
-      #ifdef COREXY
+      #if defined(COREXY) || defined(COREXZ)
         }
+      #endif
+
+      #ifdef COREXY
         // Head direction in -Y axis for CoreXY bots.
         // If DeltaX == DeltaY, the movement is only in X axis
         if ((current_block->steps[A_AXIS] != current_block->steps[B_AXIS]) || (TEST(out_bits, A_AXIS) != TEST(out_bits, B_AXIS))) {
@@ -547,82 +559,91 @@ ISR(TIMER1_COMPA_vect) {
               UPDATE_ENDSTOP(Y, MAX);
             #endif
           }
-      #ifdef COREXY
+      #if defined(COREXY) || defined(COREXZ)
         }
       #endif
-      if (TEST(out_bits, Z_AXIS)) { // z -direction
-        #if HAS_Z_MIN
-
-          #ifdef Z_DUAL_ENDSTOPS
-            SET_ENDSTOP_BIT(Z, MIN);
-              #if HAS_Z2_MIN
-                SET_ENDSTOP_BIT(Z2, MIN);
-              #else
-                COPY_BIT(current_endstop_bits, Z_MIN, Z2_MIN);
-              #endif
-
-            byte z_test = TEST_ENDSTOP(Z_MIN) << 0 + TEST_ENDSTOP(Z2_MIN) << 1; // bit 0 for Z, bit 1 for Z2
-
-            if (z_test && current_block->steps[Z_AXIS] > 0) { // z_test = Z_MIN || Z2_MIN
-              endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];
-              endstop_hit_bits |= BIT(Z_MIN);
-              if (!performing_homing || (z_test == 0x3))  //if not performing home or if both endstops were trigged during homing...
-                step_events_completed = current_block->step_event_count;
-            }
-          #else // !Z_DUAL_ENDSTOPS
-
-            UPDATE_ENDSTOP(Z, MIN);
-          #endif // !Z_DUAL_ENDSTOPS
-        #endif // Z_MIN_PIN
-
-        #ifdef Z_PROBE_ENDSTOP
-          UPDATE_ENDSTOP(Z, PROBE);
-
-          if (TEST_ENDSTOP(Z_PROBE))
-          {
-            endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];
-            endstop_hit_bits |= BIT(Z_PROBE);
+
+      #ifdef COREXZ
+        // Head direction in -Z axis for CoreXZ bots.
+        // If DeltaX == DeltaZ, the movement is only in X axis
+        if ((current_block->steps[A_AXIS] != current_block->steps[C_AXIS]) || (TEST(out_bits, A_AXIS) != TEST(out_bits, C_AXIS))) {
+          if (TEST(out_bits, Z_HEAD))
+      #else
+          if (TEST(out_bits, Z_AXIS))
+      #endif
+          { // z -direction
+            #if HAS_Z_MIN
+
+              #ifdef Z_DUAL_ENDSTOPS
+                SET_ENDSTOP_BIT(Z, MIN);
+                  #if HAS_Z2_MIN
+                    SET_ENDSTOP_BIT(Z2, MIN);
+                  #else
+                    COPY_BIT(current_endstop_bits, Z_MIN, Z2_MIN);
+                  #endif
+
+                byte z_test = TEST_ENDSTOP(Z_MIN) << 0 + TEST_ENDSTOP(Z2_MIN) << 1; // bit 0 for Z, bit 1 for Z2
+
+                if (z_test && current_block->steps[Z_AXIS] > 0) { // z_test = Z_MIN || Z2_MIN
+                  endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];
+                  endstop_hit_bits |= BIT(Z_MIN);
+                  if (!performing_homing || (z_test == 0x3))  //if not performing home or if both endstops were trigged during homing...
+                    step_events_completed = current_block->step_event_count;
+                }
+              #else // !Z_DUAL_ENDSTOPS
+
+                UPDATE_ENDSTOP(Z, MIN);
+              #endif // !Z_DUAL_ENDSTOPS
+            #endif // Z_MIN_PIN
+
+            #ifdef Z_PROBE_ENDSTOP
+              UPDATE_ENDSTOP(Z, PROBE);
+
+              if (TEST_ENDSTOP(Z_PROBE))
+              {
+                endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];
+                endstop_hit_bits |= BIT(Z_PROBE);
+              }
+            #endif
           }
-        #endif
-      }
-      else { // z +direction
-        #if HAS_Z_MAX
-
-          #ifdef Z_DUAL_ENDSTOPS
-
-            SET_ENDSTOP_BIT(Z, MAX);
-              #if HAS_Z2_MAX
-                SET_ENDSTOP_BIT(Z2, MAX);
-              #else
-                COPY_BIT(current_endstop_bits, Z_MAX, Z2_MAX)
-              #endif
-
-            byte z_test = TEST_ENDSTOP(Z_MAX) << 0 + TEST_ENDSTOP(Z2_MAX) << 1; // bit 0 for Z, bit 1 for Z2
-
-            if (z_test && current_block->steps[Z_AXIS] > 0) {  // t_test = Z_MAX || Z2_MAX
-              endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];
-              endstop_hit_bits |= BIT(Z_MIN);
-              if (!performing_homing || (z_test == 0x3))  //if not performing home or if both endstops were trigged during homing...
-                step_events_completed = current_block->step_event_count;
-            }
-
-          #else // !Z_DUAL_ENDSTOPS
-
-            UPDATE_ENDSTOP(Z, MAX);
-
-          #endif // !Z_DUAL_ENDSTOPS
-        #endif // Z_MAX_PIN
-        
-        #ifdef Z_PROBE_ENDSTOP
-          UPDATE_ENDSTOP(Z, PROBE);
-          
-          if (TEST_ENDSTOP(Z_PROBE))
-          {
-            endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];
-            endstop_hit_bits |= BIT(Z_PROBE);
+          else { // z +direction
+            #if HAS_Z_MAX
+
+              #ifdef Z_DUAL_ENDSTOPS
+
+                SET_ENDSTOP_BIT(Z, MAX);
+                  #if HAS_Z2_MAX
+                    SET_ENDSTOP_BIT(Z2, MAX);
+                  #else
+                    COPY_BIT(current_endstop_bits, Z_MAX, Z2_MAX)
+                  #endif
+
+                byte z_test = TEST_ENDSTOP(Z_MAX) << 0 + TEST_ENDSTOP(Z2_MAX) << 1; // bit 0 for Z, bit 1 for Z2
+
+                if (z_test && current_block->steps[Z_AXIS] > 0) {  // t_test = Z_MAX || Z2_MAX
+                  endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];
+                  endstop_hit_bits |= BIT(Z_MIN);
+                  if (!performing_homing || (z_test == 0x3))  //if not performing home or if both endstops were trigged during homing...
+                    step_events_completed = current_block->step_event_count;
+                }
+
+              #else // !Z_DUAL_ENDSTOPS
+
+                UPDATE_ENDSTOP(Z, MAX);
+
+              #endif // !Z_DUAL_ENDSTOPS
+            #endif // Z_MAX_PIN
+            
+            #ifdef Z_PROBE_ENDSTOP
+              UPDATE_ENDSTOP(Z, PROBE);
+              
+              if (TEST_ENDSTOP(Z_PROBE))
+              {
+                endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];
+                endstop_hit_bits |= BIT(Z_PROBE);
+              }
+            #endif
           }
-        #endif
-      }
       old_endstop_bits = current_endstop_bits;
     }