|
@@ -1745,7 +1745,7 @@ float Planner::get_axis_position_mm(const AxisEnum axis) {
|
1745
|
1745
|
else
|
1746
|
1746
|
axis_steps = stepper.position(axis);
|
1747
|
1747
|
|
1748
|
|
- #elif ENABLED(MARKFORGED_XY)
|
|
1748
|
+ #elif EITHER(MARKFORGED_XY, MARKFORGED_YX)
|
1749
|
1749
|
|
1750
|
1750
|
// Requesting one of the joined axes?
|
1751
|
1751
|
if (axis == CORE_AXIS_1 || axis == CORE_AXIS_2) {
|
|
@@ -1919,42 +1919,28 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
|
1919
|
1919
|
|
1920
|
1920
|
// Compute direction bit-mask for this block
|
1921
|
1921
|
axis_bits_t dm = 0;
|
1922
|
|
- #if CORE_IS_XY
|
1923
|
|
- if (da < 0) SBI(dm, X_HEAD); // Save the toolhead's true direction in X
|
1924
|
|
- if (db < 0) SBI(dm, Y_HEAD); // ...and Y
|
1925
|
|
- if (dc < 0) SBI(dm, Z_AXIS);
|
1926
|
|
- if (da + db < 0) SBI(dm, A_AXIS); // Motor A direction
|
1927
|
|
- if (CORESIGN(da - db) < 0) SBI(dm, B_AXIS); // Motor B direction
|
1928
|
|
- #elif CORE_IS_XZ
|
1929
|
|
- if (da < 0) SBI(dm, X_HEAD); // Save the toolhead's true direction in X
|
1930
|
|
- if (db < 0) SBI(dm, Y_AXIS);
|
1931
|
|
- if (dc < 0) SBI(dm, Z_HEAD); // ...and Z
|
1932
|
|
- if (da + dc < 0) SBI(dm, A_AXIS); // Motor A direction
|
1933
|
|
- if (CORESIGN(da - dc) < 0) SBI(dm, C_AXIS); // Motor C direction
|
1934
|
|
- #elif CORE_IS_YZ
|
1935
|
|
- if (da < 0) SBI(dm, X_AXIS);
|
1936
|
|
- if (db < 0) SBI(dm, Y_HEAD); // Save the toolhead's true direction in Y
|
1937
|
|
- if (dc < 0) SBI(dm, Z_HEAD); // ...and Z
|
1938
|
|
- if (db + dc < 0) SBI(dm, B_AXIS); // Motor B direction
|
1939
|
|
- if (CORESIGN(db - dc) < 0) SBI(dm, C_AXIS); // Motor C direction
|
1940
|
|
- #elif ENABLED(MARKFORGED_XY)
|
1941
|
|
- if (da < 0) SBI(dm, X_HEAD); // Save the toolhead's true direction in X
|
1942
|
|
- if (db < 0) SBI(dm, Y_HEAD); // ...and Y
|
|
1922
|
+ #if ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX)
|
|
1923
|
+ if (da < 0) SBI(dm, X_HEAD); // Save the toolhead's true direction in X
|
|
1924
|
+ if (db < 0) SBI(dm, Y_HEAD); // ...and Y
|
1943
|
1925
|
if (dc < 0) SBI(dm, Z_AXIS);
|
1944
|
|
- if (da + db < 0) SBI(dm, A_AXIS); // Motor A direction
|
1945
|
|
- if (db < 0) SBI(dm, B_AXIS); // Motor B direction
|
1946
|
|
- #else
|
1947
|
|
- LINEAR_AXIS_CODE(
|
1948
|
|
- if (da < 0) SBI(dm, X_AXIS),
|
1949
|
|
- if (db < 0) SBI(dm, Y_AXIS),
|
1950
|
|
- if (dc < 0) SBI(dm, Z_AXIS),
|
1951
|
|
- if (di < 0) SBI(dm, I_AXIS),
|
1952
|
|
- if (dj < 0) SBI(dm, J_AXIS),
|
1953
|
|
- if (dk < 0) SBI(dm, K_AXIS)
|
1954
|
|
- );
|
1955
|
1926
|
#endif
|
1956
|
|
-
|
1957
|
1927
|
#if IS_CORE
|
|
1928
|
+ #if CORE_IS_XY
|
|
1929
|
+ if (da + db < 0) SBI(dm, A_AXIS); // Motor A direction
|
|
1930
|
+ if (CORESIGN(da - db) < 0) SBI(dm, B_AXIS); // Motor B direction
|
|
1931
|
+ #elif CORE_IS_XZ
|
|
1932
|
+ if (da < 0) SBI(dm, X_HEAD); // Save the toolhead's true direction in X
|
|
1933
|
+ if (db < 0) SBI(dm, Y_AXIS);
|
|
1934
|
+ if (dc < 0) SBI(dm, Z_HEAD); // ...and Z
|
|
1935
|
+ if (da + dc < 0) SBI(dm, A_AXIS); // Motor A direction
|
|
1936
|
+ if (CORESIGN(da - dc) < 0) SBI(dm, C_AXIS); // Motor C direction
|
|
1937
|
+ #elif CORE_IS_YZ
|
|
1938
|
+ if (da < 0) SBI(dm, X_AXIS);
|
|
1939
|
+ if (db < 0) SBI(dm, Y_HEAD); // Save the toolhead's true direction in Y
|
|
1940
|
+ if (dc < 0) SBI(dm, Z_HEAD); // ...and Z
|
|
1941
|
+ if (db + dc < 0) SBI(dm, B_AXIS); // Motor B direction
|
|
1942
|
+ if (CORESIGN(db - dc) < 0) SBI(dm, C_AXIS); // Motor C direction
|
|
1943
|
+ #endif
|
1958
|
1944
|
#if LINEAR_AXES >= 4
|
1959
|
1945
|
if (di < 0) SBI(dm, I_AXIS);
|
1960
|
1946
|
#endif
|
|
@@ -1964,11 +1950,25 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
|
1964
|
1950
|
#if LINEAR_AXES >= 6
|
1965
|
1951
|
if (dk < 0) SBI(dm, K_AXIS);
|
1966
|
1952
|
#endif
|
|
1953
|
+ #elif ENABLED(MARKFORGED_XY)
|
|
1954
|
+ if (da + db < 0) SBI(dm, A_AXIS); // Motor A direction
|
|
1955
|
+ if (db < 0) SBI(dm, B_AXIS); // Motor B direction
|
|
1956
|
+ #elif ENABLED(MARKFORGED_YX)
|
|
1957
|
+ if (da < 0) SBI(dm, A_AXIS); // Motor A direction
|
|
1958
|
+ if (db + da < 0) SBI(dm, B_AXIS); // Motor B direction
|
|
1959
|
+ #else
|
|
1960
|
+ LINEAR_AXIS_CODE(
|
|
1961
|
+ if (da < 0) SBI(dm, X_AXIS),
|
|
1962
|
+ if (db < 0) SBI(dm, Y_AXIS),
|
|
1963
|
+ if (dc < 0) SBI(dm, Z_AXIS),
|
|
1964
|
+ if (di < 0) SBI(dm, I_AXIS),
|
|
1965
|
+ if (dj < 0) SBI(dm, J_AXIS),
|
|
1966
|
+ if (dk < 0) SBI(dm, K_AXIS)
|
|
1967
|
+ );
|
1967
|
1968
|
#endif
|
1968
|
1969
|
|
1969
|
|
- TERN_(HAS_EXTRUDERS, if (de < 0) SBI(dm, E_AXIS));
|
1970
|
|
-
|
1971
|
1970
|
#if HAS_EXTRUDERS
|
|
1971
|
+ if (de < 0) SBI(dm, E_AXIS);
|
1972
|
1972
|
const float esteps_float = de * e_factor[extruder];
|
1973
|
1973
|
const uint32_t esteps = ABS(esteps_float) + 0.5f;
|
1974
|
1974
|
#else
|
|
@@ -1998,6 +1998,8 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
|
1998
|
1998
|
block->steps.set(LINEAR_AXIS_LIST(ABS(da), ABS(db + dc), ABS(db - dc), ABS(di), ABS(dj), ABS(dk)));
|
1999
|
1999
|
#elif ENABLED(MARKFORGED_XY)
|
2000
|
2000
|
block->steps.set(LINEAR_AXIS_LIST(ABS(da + db), ABS(db), ABS(dc), ABS(di), ABS(dj), ABS(dk)));
|
|
2001
|
+ #elif ENABLED(MARKFORGED_YX)
|
|
2002
|
+ block->steps.set(LINEAR_AXIS_LIST(ABS(da), ABS(db + da), ABS(dc), ABS(di), ABS(dj), ABS(dk)));
|
2001
|
2003
|
#elif IS_SCARA
|
2002
|
2004
|
block->steps.set(LINEAR_AXIS_LIST(ABS(da), ABS(db), ABS(dc), ABS(di), ABS(dj), ABS(dk)));
|
2003
|
2005
|
#else
|
|
@@ -2014,15 +2016,18 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
|
2014
|
2016
|
* Having the real displacement of the head, we can calculate the total movement length and apply the desired speed.
|
2015
|
2017
|
*/
|
2016
|
2018
|
struct DistanceMM : abce_float_t {
|
2017
|
|
- #if EITHER(IS_CORE, MARKFORGED_XY)
|
|
2019
|
+ #if ANY(IS_CORE, MARKFORGED_XY, MARKFORGED_YX)
|
2018
|
2020
|
struct { float x, y, z; } head;
|
2019
|
2021
|
#endif
|
2020
|
2022
|
} steps_dist_mm;
|
|
2023
|
+
|
|
2024
|
+ #if ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX)
|
|
2025
|
+ steps_dist_mm.head.x = da * mm_per_step[A_AXIS];
|
|
2026
|
+ steps_dist_mm.head.y = db * mm_per_step[B_AXIS];
|
|
2027
|
+ steps_dist_mm.z = dc * mm_per_step[Z_AXIS];
|
|
2028
|
+ #endif
|
2021
|
2029
|
#if IS_CORE
|
2022
|
2030
|
#if CORE_IS_XY
|
2023
|
|
- steps_dist_mm.head.x = da * mm_per_step[A_AXIS];
|
2024
|
|
- steps_dist_mm.head.y = db * mm_per_step[B_AXIS];
|
2025
|
|
- steps_dist_mm.z = dc * mm_per_step[Z_AXIS];
|
2026
|
2031
|
steps_dist_mm.a = (da + db) * mm_per_step[A_AXIS];
|
2027
|
2032
|
steps_dist_mm.b = CORESIGN(da - db) * mm_per_step[B_AXIS];
|
2028
|
2033
|
#elif CORE_IS_XZ
|
|
@@ -2048,11 +2053,11 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
|
2048
|
2053
|
steps_dist_mm.k = dk * mm_per_step[K_AXIS];
|
2049
|
2054
|
#endif
|
2050
|
2055
|
#elif ENABLED(MARKFORGED_XY)
|
2051
|
|
- steps_dist_mm.head.x = da * mm_per_step[A_AXIS];
|
2052
|
|
- steps_dist_mm.head.y = db * mm_per_step[B_AXIS];
|
2053
|
|
- steps_dist_mm.z = dc * mm_per_step[Z_AXIS];
|
2054
|
2056
|
steps_dist_mm.a = (da - db) * mm_per_step[A_AXIS];
|
2055
|
2057
|
steps_dist_mm.b = db * mm_per_step[B_AXIS];
|
|
2058
|
+ #elif ENABLED(MARKFORGED_YX)
|
|
2059
|
+ steps_dist_mm.a = da * mm_per_step[A_AXIS];
|
|
2060
|
+ steps_dist_mm.b = (db - da) * mm_per_step[B_AXIS];
|
2056
|
2061
|
#else
|
2057
|
2062
|
LINEAR_AXIS_CODE(
|
2058
|
2063
|
steps_dist_mm.a = da * mm_per_step[A_AXIS],
|
|
@@ -2084,7 +2089,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
|
2084
|
2089
|
block->millimeters = millimeters;
|
2085
|
2090
|
else {
|
2086
|
2091
|
block->millimeters = SQRT(
|
2087
|
|
- #if EITHER(CORE_IS_XY, MARKFORGED_XY)
|
|
2092
|
+ #if ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX)
|
2088
|
2093
|
LINEAR_AXIS_GANG(
|
2089
|
2094
|
sq(steps_dist_mm.head.x), + sq(steps_dist_mm.head.y), + sq(steps_dist_mm.z),
|
2090
|
2095
|
+ sq(steps_dist_mm.i), + sq(steps_dist_mm.j), + sq(steps_dist_mm.k)
|
|
@@ -2163,7 +2168,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
|
2163
|
2168
|
#endif
|
2164
|
2169
|
|
2165
|
2170
|
// Enable active axes
|
2166
|
|
- #if EITHER(CORE_IS_XY, MARKFORGED_XY)
|
|
2171
|
+ #if ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX)
|
2167
|
2172
|
if (block->steps.a || block->steps.b) {
|
2168
|
2173
|
stepper.enable_axis(X_AXIS);
|
2169
|
2174
|
stepper.enable_axis(Y_AXIS);
|
|
@@ -2193,7 +2198,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
|
2193
|
2198
|
if (block->steps.k) stepper.enable_axis(K_AXIS)
|
2194
|
2199
|
);
|
2195
|
2200
|
#endif
|
2196
|
|
- #if EITHER(IS_CORE, MARKFORGED_XY)
|
|
2201
|
+ #if ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX)
|
2197
|
2202
|
#if LINEAR_AXES >= 4
|
2198
|
2203
|
if (block->steps.i) stepper.enable_axis(I_AXIS);
|
2199
|
2204
|
#endif
|
|
@@ -2551,7 +2556,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
|
2551
|
2556
|
* => normalize the complete junction vector.
|
2552
|
2557
|
* Elsewise, when needed JD will factor-in the E component
|
2553
|
2558
|
*/
|
2554
|
|
- if (EITHER(IS_CORE, MARKFORGED_XY) || esteps > 0)
|
|
2559
|
+ if (ANY(IS_CORE, MARKFORGED_XY, MARKFORGED_YX) || esteps > 0)
|
2555
|
2560
|
normalize_junction_vector(unit_vec); // Normalize with XYZE components
|
2556
|
2561
|
else
|
2557
|
2562
|
unit_vec *= inverse_millimeters; // Use pre-calculated (1 / SQRT(x^2 + y^2 + z^2))
|