|
|
@ -593,14 +593,6 @@ float soft_endstop_min[XYZ] = { X_MIN_BED, Y_MIN_BED, Z_MIN_POS },
|
|
|
|
// SERIAL_ECHOLNPAIR(" segments=", segments);
|
|
|
|
// SERIAL_ECHOLNPAIR(" segments=", segments);
|
|
|
|
// SERIAL_ECHOLNPAIR(" segment_mm=", cartesian_segment_mm);
|
|
|
|
// SERIAL_ECHOLNPAIR(" segment_mm=", cartesian_segment_mm);
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(SCARA_FEEDRATE_SCALING)
|
|
|
|
|
|
|
|
// SCARA needs to scale the feed rate from mm/s to degrees/s
|
|
|
|
|
|
|
|
const float inv_segment_length = min(10.0, float(segments) / cartesian_mm), // 1/mm/segs
|
|
|
|
|
|
|
|
inverse_secs = inv_segment_length * _feedrate_mm_s;
|
|
|
|
|
|
|
|
float oldA = stepper.get_axis_position_degrees(A_AXIS),
|
|
|
|
|
|
|
|
oldB = stepper.get_axis_position_degrees(B_AXIS);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Get the current position as starting point
|
|
|
|
// Get the current position as starting point
|
|
|
|
float raw[XYZE];
|
|
|
|
float raw[XYZE];
|
|
|
|
COPY(raw, current_position);
|
|
|
|
COPY(raw, current_position);
|
|
|
@ -625,24 +617,11 @@ float soft_endstop_min[XYZ] = { X_MIN_BED, Y_MIN_BED, Z_MIN_POS },
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
ADJUST_DELTA(raw); // Adjust Z if bed leveling is enabled
|
|
|
|
ADJUST_DELTA(raw); // Adjust Z if bed leveling is enabled
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(SCARA_FEEDRATE_SCALING)
|
|
|
|
planner.buffer_line(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], raw[E_AXIS], _feedrate_mm_s, active_extruder, cartesian_segment_mm);
|
|
|
|
// For SCARA scale the feed rate from mm/s to degrees/s
|
|
|
|
|
|
|
|
// i.e., Complete the angular vector in the given time.
|
|
|
|
|
|
|
|
planner.buffer_segment(delta[A_AXIS], delta[B_AXIS], raw[Z_AXIS], raw[E_AXIS], HYPOT(delta[A_AXIS] - oldA, delta[B_AXIS] - oldB) * inverse_secs, active_extruder, cartesian_segment_mm);
|
|
|
|
|
|
|
|
oldA = delta[A_AXIS]; oldB = delta[B_AXIS];
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
planner.buffer_line(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], raw[E_AXIS], _feedrate_mm_s, active_extruder, cartesian_segment_mm);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Ensure last segment arrives at target location.
|
|
|
|
// Ensure last segment arrives at target location.
|
|
|
|
#if ENABLED(SCARA_FEEDRATE_SCALING)
|
|
|
|
planner.buffer_line_kinematic(rtarget, _feedrate_mm_s, active_extruder, cartesian_segment_mm);
|
|
|
|
inverse_kinematics(rtarget);
|
|
|
|
|
|
|
|
ADJUST_DELTA(rtarget);
|
|
|
|
|
|
|
|
planner.buffer_segment(delta[A_AXIS], delta[B_AXIS], rtarget[Z_AXIS], rtarget[E_AXIS], HYPOT(delta[A_AXIS] - oldA, delta[B_AXIS] - oldB) * inverse_secs, active_extruder, cartesian_segment_mm);
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
planner.buffer_line_kinematic(rtarget, _feedrate_mm_s, active_extruder, cartesian_segment_mm);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return false; // caller will update current_position
|
|
|
|
return false; // caller will update current_position
|
|
|
|
}
|
|
|
|
}
|
|
|
|