|
@@ -2049,9 +2049,9 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
|
2049
|
2049
|
#endif
|
2050
|
2050
|
#elif ENABLED(MARKFORGED_XY)
|
2051
|
2051
|
steps_dist_mm.a = (da - db) * mm_per_step[A_AXIS];
|
2052
|
|
- steps_dist_mm.b = db * mm_per_step[B_AXIS];
|
|
2052
|
+ steps_dist_mm.b = db * mm_per_step[B_AXIS];
|
2053
|
2053
|
#elif ENABLED(MARKFORGED_YX)
|
2054
|
|
- steps_dist_mm.a = da * mm_per_step[A_AXIS];
|
|
2054
|
+ steps_dist_mm.a = da * mm_per_step[A_AXIS];
|
2055
|
2055
|
steps_dist_mm.b = (db - da) * mm_per_step[B_AXIS];
|
2056
|
2056
|
#else
|
2057
|
2057
|
XYZ_CODE(
|
|
@@ -2097,12 +2097,21 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
|
2097
|
2097
|
block->millimeters = millimeters;
|
2098
|
2098
|
else {
|
2099
|
2099
|
/**
|
2100
|
|
- * Distance for interpretation of feedrate in accordance with LinuxCNC (the successor of NIST
|
2101
|
|
- * RS274NGC interpreter - version 3) and its default CANON_XYZ feed reference mode.
|
2102
|
|
- * Assume that X, Y, Z are the primary linear axes and U, V, W are secondary linear axes and A, B, C are
|
2103
|
|
- * rotational axes. Then dX, dY, dZ are the displacements of the primary linear axes and dU, dV, dW are the displacements of linear axes and
|
2104
|
|
- * dA, dB, dC are the displacements of rotational axes.
|
2105
|
|
- * The time it takes to execute move command with feedrate F is t = D/F, where D is the total distance, calculated as follows:
|
|
2100
|
+ * Distance for interpretation of feedrate in accordance with LinuxCNC (the successor of
|
|
2101
|
+ * NIST RS274NGC interpreter - version 3) and its default CANON_XYZ feed reference mode.
|
|
2102
|
+ *
|
|
2103
|
+ * Assume:
|
|
2104
|
+ * - X, Y, Z are the primary linear axes;
|
|
2105
|
+ * - U, V, W are secondary linear axes;
|
|
2106
|
+ * - A, B, C are rotational axes.
|
|
2107
|
+ *
|
|
2108
|
+ * Then:
|
|
2109
|
+ * - dX, dY, dZ are the displacements of the primary linear axes;
|
|
2110
|
+ * - dU, dV, dW are the displacements of linear axes;
|
|
2111
|
+ * - dA, dB, dC are the displacements of rotational axes.
|
|
2112
|
+ *
|
|
2113
|
+ * The time it takes to execute move command with feedrate F is t = D/F,
|
|
2114
|
+ * where D is the total distance, calculated as follows:
|
2106
|
2115
|
* D^2 = dX^2 + dY^2 + dZ^2
|
2107
|
2116
|
* if D^2 == 0 (none of XYZ move but any secondary linear axes move, whether other axes are moved or not):
|
2108
|
2117
|
* D^2 = dU^2 + dV^2 + dW^2
|
|
@@ -2111,8 +2120,9 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
|
2111
|
2120
|
*/
|
2112
|
2121
|
float distance_sqr = (
|
2113
|
2122
|
#if ENABLED(ARTICULATED_ROBOT_ARM)
|
2114
|
|
- // For articulated robots, interpreting feedrate like LinuxCNC would require inverse kinematics. As a workaround, pretend that motors sit on n mutually orthogonal
|
2115
|
|
- // axes and assume that we could think of distance as magnitude of an n-vector in an n-dimensional Euclidian space.
|
|
2123
|
+ // For articulated robots, interpreting feedrate like LinuxCNC would require inverse kinematics. As a workaround,
|
|
2124
|
+ // assume that motors sit on a mutually-orthogonal axes and we can think of distance as magnitude of an n-vector
|
|
2125
|
+ // in an n-dimensional Euclidian space.
|
2116
|
2126
|
NUM_AXIS_GANG(
|
2117
|
2127
|
sq(steps_dist_mm.x), + sq(steps_dist_mm.y), + sq(steps_dist_mm.z),
|
2118
|
2128
|
+ sq(steps_dist_mm.i), + sq(steps_dist_mm.j), + sq(steps_dist_mm.k),
|
|
@@ -2120,8 +2130,8 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
|
2120
|
2130
|
);
|
2121
|
2131
|
#elif ENABLED(FOAMCUTTER_XYUV)
|
2122
|
2132
|
#if HAS_J_AXIS
|
2123
|
|
- // Special 5 axis kinematics. Return the largest distance move from either X/Y or I/J plane
|
2124
|
|
- _MAX(sq(steps_dist_mm.x) + sq(steps_dist_mm.y), sq(steps_dist_mm.i) + sq(steps_dist_mm.j))
|
|
2133
|
+ // Special 5 axis kinematics. Return the largest distance move from either X/Y or I/J plane
|
|
2134
|
+ _MAX(sq(steps_dist_mm.x) + sq(steps_dist_mm.y), sq(steps_dist_mm.i) + sq(steps_dist_mm.j))
|
2125
|
2135
|
#else // Foamcutter with only two axes (XY)
|
2126
|
2136
|
sq(steps_dist_mm.x) + sq(steps_dist_mm.y)
|
2127
|
2137
|
#endif
|
|
@@ -2132,7 +2142,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
|
2132
|
2142
|
#elif CORE_IS_YZ
|
2133
|
2143
|
XYZ_GANG(sq(steps_dist_mm.x), + sq(steps_dist_mm.head.y), + sq(steps_dist_mm.head.z))
|
2134
|
2144
|
#else
|
2135
|
|
- XYZ_GANG(sq(steps_dist_mm.x), + sq(steps_dist_mm.y), + sq(steps_dist_mm.z))
|
|
2145
|
+ XYZ_GANG(sq(steps_dist_mm.x), + sq(steps_dist_mm.y), + sq(steps_dist_mm.z))
|
2136
|
2146
|
#endif
|
2137
|
2147
|
);
|
2138
|
2148
|
|
|
@@ -2165,9 +2175,9 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
|
2165
|
2175
|
|
2166
|
2176
|
/**
|
2167
|
2177
|
* At this point at least one of the axes has more steps than
|
2168
|
|
- * MIN_STEPS_PER_SEGMENT, ensuring the segment won't get dropped as
|
2169
|
|
- * zero-length. It's important to not apply corrections
|
2170
|
|
- * to blocks that would get dropped!
|
|
2178
|
+ * MIN_STEPS_PER_SEGMENT, ensuring the segment won't get dropped
|
|
2179
|
+ * as zero-length. It's important to not apply corrections to blocks
|
|
2180
|
+ * that would get dropped!
|
2171
|
2181
|
*
|
2172
|
2182
|
* A correction function is permitted to add steps to an axis, it
|
2173
|
2183
|
* should *never* remove steps!
|
|
@@ -2203,15 +2213,9 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
|
2203
|
2213
|
|
2204
|
2214
|
#if ENABLED(AUTO_POWER_CONTROL)
|
2205
|
2215
|
if (NUM_AXIS_GANG(
|
2206
|
|
- block->steps.x,
|
2207
|
|
- || block->steps.y,
|
2208
|
|
- || block->steps.z,
|
2209
|
|
- || block->steps.i,
|
2210
|
|
- || block->steps.j,
|
2211
|
|
- || block->steps.k,
|
2212
|
|
- || block->steps.u,
|
2213
|
|
- || block->steps.v,
|
2214
|
|
- || block->steps.w
|
|
2216
|
+ block->steps.x, || block->steps.y, || block->steps.z,
|
|
2217
|
+ || block->steps.i, || block->steps.j, || block->steps.k,
|
|
2218
|
+ || block->steps.u, || block->steps.v, || block->steps.w
|
2215
|
2219
|
)) powerManager.power_on();
|
2216
|
2220
|
#endif
|
2217
|
2221
|
|