Include Z in SCARA steps feedrate (#16193)

This commit is contained in:
Bo Herrmannsen 2019-12-13 00:13:49 +01:00 committed by Scott Lahteine
parent 629c039eed
commit 98382fcea5

View file

@ -2620,13 +2620,15 @@ bool Planner::buffer_line(const float &rx, const float &ry, const float &rz, con
if (mm == 0.0) if (mm == 0.0)
mm = (delta_mm_cart.x != 0.0 || delta_mm_cart.y != 0.0) ? delta_mm_cart.magnitude() : ABS(delta_mm_cart.z); mm = (delta_mm_cart.x != 0.0 || delta_mm_cart.y != 0.0) ? delta_mm_cart.magnitude() : ABS(delta_mm_cart.z);
// Cartesian XYZ to kinematic ABC, stored in global 'delta'
inverse_kinematics(machine); inverse_kinematics(machine);
#if ENABLED(SCARA_FEEDRATE_SCALING) #if ENABLED(SCARA_FEEDRATE_SCALING)
// For SCARA scale the feed rate from mm/s to degrees/s // For SCARA scale the feed rate from mm/s to degrees/s
// i.e., Complete the angular vector in the given time. // i.e., Complete the angular vector in the given time.
const float duration_recip = inv_duration ?: fr_mm_s / mm; const float duration_recip = inv_duration ?: fr_mm_s / mm;
const feedRate_t feedrate = HYPOT(delta.a - position_float.a, delta.b - position_float.b) * duration_recip; const xyz_pos_t diff = delta - position_float;
const feedRate_t feedrate = diff.magnitude() * duration_recip;
#else #else
const feedRate_t feedrate = fr_mm_s; const feedRate_t feedrate = fr_mm_s;
#endif #endif