You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (!(NUM_AXIS_GANG(diff.x, || diff.y, /* skip z */, || diff.i, || diff.j, || diff.k, || diff.u, || diff.v, || diff.w)))
1067
+
returnTERN0(HAS_Z_AXIS, ABS(diff.z));
1068
+
1069
+
#if ENABLED(ARTICULATED_ROBOT_ARM)
1070
+
1071
+
// For articulated robots, interpreting feedrate like LinuxCNC would require inverse kinematics. As a workaround, pretend that motors sit on n mutually orthogonal
1072
+
// axes and assume that we could think of distance as magnitude of an n-vector in an n-dimensional Euclidian space.
1073
+
constfloat distance_sqr = NUM_AXIS_GANG(
1074
+
sq(diff.x), + sq(diff.y), + sq(diff.z),
1075
+
+ sq(diff.i), + sq(diff.j), + sq(diff.k),
1076
+
+ sq(diff.u), + sq(diff.v), + sq(diff.w)
1077
+
);
1078
+
1079
+
#elif ENABLED(FOAMCUTTER_XYUV)
1080
+
1081
+
constfloat distance_sqr = (
1082
+
#if HAS_J_AXIS
1083
+
_MAX(sq(diff.x) + sq(diff.y), sq(diff.i) + sq(diff.j)) // Special 5 axis kinematics. Return the larger of plane X/Y or I/J
1084
+
#else
1085
+
sq(diff.x) + sq(diff.y) // Foamcutter with only two axes (XY)
1086
+
#endif
1087
+
);
1088
+
1089
+
#else
1090
+
1091
+
/**
1092
+
* Calculate distance for feedrate interpretation in accordance with NIST RS274NGC interpreter - version 3) and its default CANON_XYZ feed reference mode.
1093
+
* Assume:
1094
+
* - X, Y, Z are the primary linear axes;
1095
+
* - U, V, W are secondary linear axes;
1096
+
* - A, B, C are rotational axes.
1097
+
*
1098
+
* Then:
1099
+
* - dX, dY, dZ are the displacements of the primary linear axes;
1100
+
* - dU, dV, dW are the displacements of linear axes;
1101
+
* - dA, dB, dC are the displacements of rotational axes.
1102
+
*
1103
+
* The time it takes to execute a move command with feedrate F is t = D/F,
1104
+
* plus any time for acceleration and deceleration.
1105
+
* Here, D is the total distance, calculated as follows:
1106
+
*
1107
+
* D^2 = dX^2 + dY^2 + dZ^2
1108
+
* if D^2 == 0 (none of XYZ move but any secondary linear axes move, whether other axes are moved or not):
* Distance for interpretation of feedrate in accordance with LinuxCNC (the successor of NIST
2157
-
* RS274NGC interpreter - version 3) and its default CANON_XYZ feed reference mode.
2158
-
* Assume that X, Y, Z are the primary linear axes and U, V, W are secondary linear axes and A, B, C are
2159
-
* 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
2160
-
* dA, dB, dC are the displacements of rotational axes.
2161
-
* The time it takes to execute move command with feedrate F is t = D/F, where D is the total distance, calculated as follows:
2162
-
* D^2 = dX^2 + dY^2 + dZ^2
2163
-
* if D^2 == 0 (none of XYZ move but any secondary linear axes move, whether other axes are moved or not):
2164
-
* D^2 = dU^2 + dV^2 + dW^2
2165
-
* if D^2 == 0 (only rotational axes are moved):
2166
-
* D^2 = dA^2 + dB^2 + dC^2
2167
-
*/
2168
-
float distance_sqr = (
2169
-
#if ENABLED(ARTICULATED_ROBOT_ARM)
2170
-
// For articulated robots, interpreting feedrate like LinuxCNC would require inverse kinematics. As a workaround, pretend that motors sit on n mutually orthogonal
2171
-
// axes and assume that we could think of distance as magnitude of an n-vector in an n-dimensional Euclidian space.
0 commit comments