TPARA - 3DOF robot arm IK (#21005)

Co-authored-by: Scott Lahteine <github@thinkyhead.com>
This commit is contained in:
Axel
2021-03-03 20:46:32 -03:00
committed by GitHub
parent fd270ddc6c
commit a46e025725
12 changed files with 285 additions and 117 deletions

View File

@ -395,8 +395,21 @@ FORCE_INLINE bool all_axes_trusted() { return xyz_bits ==
// Return true if the given point is within the printable area
inline bool position_is_reachable(const float &rx, const float &ry, const float inset=0) {
#if ENABLED(DELTA)
return HYPOT2(rx, ry) <= sq(DELTA_PRINTABLE_RADIUS - inset + fslop);
#elif ENABLED(AXEL_TPARA)
const float R2 = HYPOT2(rx - TPARA_OFFSET_X, ry - TPARA_OFFSET_Y);
return (
R2 <= sq(L1 + L2) - inset
#if MIDDLE_DEAD_ZONE_R > 0
&& R2 >= sq(float(MIDDLE_DEAD_ZONE_R))
#endif
);
#elif IS_SCARA
const float R2 = HYPOT2(rx - SCARA_OFFSET_X, ry - SCARA_OFFSET_Y);
return (
R2 <= sq(L1 + L2) - inset
@ -404,6 +417,7 @@ FORCE_INLINE bool all_axes_trusted() { return xyz_bits ==
&& R2 >= sq(float(MIDDLE_DEAD_ZONE_R))
#endif
);
#endif
}