Apply feedrate to nozzle movement for kinematic machines
This commit is contained in:
parent
b11e78f5f7
commit
5b4e39a429
41 changed files with 758 additions and 323 deletions
|
|
@ -12370,6 +12370,7 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) {
|
|||
|
||||
// The approximate length of each segment
|
||||
const float inv_segments = 1.0 / float(segments),
|
||||
cartesian_segment_mm = cartesian_mm * inv_segments,
|
||||
segment_distance[XYZE] = {
|
||||
xdiff * inv_segments,
|
||||
ydiff * inv_segments,
|
||||
|
|
@ -12379,6 +12380,7 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) {
|
|||
|
||||
// SERIAL_ECHOPAIR("mm=", cartesian_mm);
|
||||
// SERIAL_ECHOLNPAIR(" segments=", segments);
|
||||
// SERIAL_ECHOLNPAIR(" segment_mm=", cartesian_segment_mm);
|
||||
|
||||
// Get the raw current position as starting point
|
||||
float raw[XYZE];
|
||||
|
|
@ -12393,12 +12395,12 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) {
|
|||
idle();
|
||||
}
|
||||
LOOP_XYZE(i) raw[i] += segment_distance[i];
|
||||
planner.buffer_line_kinematic(raw, fr_mm_s, active_extruder);
|
||||
planner.buffer_line_kinematic(raw, fr_mm_s, active_extruder, cartesian_segment_mm);
|
||||
}
|
||||
|
||||
// Since segment_distance is only approximate,
|
||||
// the final move must be to the exact destination.
|
||||
planner.buffer_line_kinematic(destination, fr_mm_s, active_extruder);
|
||||
planner.buffer_line_kinematic(destination, fr_mm_s, active_extruder, cartesian_segment_mm);
|
||||
}
|
||||
|
||||
#elif ENABLED(MESH_BED_LEVELING)
|
||||
|
|
@ -12595,6 +12597,7 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) {
|
|||
|
||||
// The approximate length of each segment
|
||||
const float inv_segments = 1.0 / float(segments),
|
||||
cartesian_segment_mm = cartesian_mm * inv_segments,
|
||||
segment_distance[XYZE] = {
|
||||
xdiff * inv_segments,
|
||||
ydiff * inv_segments,
|
||||
|
|
@ -12605,6 +12608,7 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) {
|
|||
// SERIAL_ECHOPAIR("mm=", cartesian_mm);
|
||||
// SERIAL_ECHOPAIR(" seconds=", seconds);
|
||||
// SERIAL_ECHOLNPAIR(" segments=", segments);
|
||||
// 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
|
||||
|
|
@ -12642,10 +12646,10 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) {
|
|||
#if ENABLED(SCARA_FEEDRATE_SCALING)
|
||||
// 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);
|
||||
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);
|
||||
planner.buffer_line(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], raw[E_AXIS], _feedrate_mm_s, active_extruder, cartesian_segment_mm);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
@ -12653,9 +12657,9 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) {
|
|||
#if ENABLED(SCARA_FEEDRATE_SCALING)
|
||||
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);
|
||||
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);
|
||||
planner.buffer_line_kinematic(rtarget, _feedrate_mm_s, active_extruder, cartesian_segment_mm);
|
||||
#endif
|
||||
|
||||
return false; // caller will update current_position
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue