|
|
@ -2007,27 +2007,37 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
|
|
|
|
filwidth.advance_e(delta_mm.e);
|
|
|
|
filwidth.advance_e(delta_mm.e);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
// Calculate and limit speed in mm/sec for each axis
|
|
|
|
// Calculate and limit speed in mm/sec
|
|
|
|
|
|
|
|
|
|
|
|
xyze_float_t current_speed;
|
|
|
|
xyze_float_t current_speed;
|
|
|
|
float speed_factor = 1.0f; // factor <1 decreases speed
|
|
|
|
float speed_factor = 1.0f; // factor <1 decreases speed
|
|
|
|
LOOP_XYZE(i) {
|
|
|
|
|
|
|
|
|
|
|
|
// Linear axes first with less logic
|
|
|
|
|
|
|
|
LOOP_XYZ(i) {
|
|
|
|
|
|
|
|
current_speed[i] = delta_mm[i] * inverse_secs;
|
|
|
|
|
|
|
|
const feedRate_t cs = ABS(current_speed[i]),
|
|
|
|
|
|
|
|
max_fr = settings.max_feedrate_mm_s[i];
|
|
|
|
|
|
|
|
if (cs > max_fr) NOMORE(speed_factor, max_fr / cs);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Limit speed on extruders, if any
|
|
|
|
|
|
|
|
#if EXTRUDERS
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
current_speed.e = delta_mm.e * inverse_secs;
|
|
|
|
#if BOTH(MIXING_EXTRUDER, RETRACT_SYNC_MIXING)
|
|
|
|
#if BOTH(MIXING_EXTRUDER, RETRACT_SYNC_MIXING)
|
|
|
|
// In worst case, only one extruder running, no change is needed.
|
|
|
|
// Move all mixing extruders at the specified rate
|
|
|
|
// In best case, all extruders run the same amount, we can divide by MIXING_STEPPERS
|
|
|
|
if (mixer.get_current_vtool() == MIXER_AUTORETRACT_TOOL)
|
|
|
|
float delta_mm_i = 0;
|
|
|
|
current_speed.e *= MIXING_STEPPERS;
|
|
|
|
if (i == E_AXIS && mixer.get_current_vtool() == MIXER_AUTORETRACT_TOOL)
|
|
|
|
|
|
|
|
delta_mm_i = delta_mm.e / MIXING_STEPPERS;
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
delta_mm_i = delta_mm.e;
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
const float delta_mm_i = delta_mm[i];
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
const feedRate_t cs = ABS(current_speed[i] = delta_mm_i * inverse_secs);
|
|
|
|
const feedRate_t cs = ABS(current_speed.e),
|
|
|
|
#if ENABLED(DISTINCT_E_FACTORS)
|
|
|
|
max_fr = (settings.max_feedrate_mm_s[E_AXIS_N(extruder)]
|
|
|
|
if (i == E_AXIS) i += extruder;
|
|
|
|
#if BOTH(MIXING_EXTRUDER, RETRACT_SYNC_MIXING)
|
|
|
|
|
|
|
|
* MIXING_STEPPERS
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
if (cs > settings.max_feedrate_mm_s[i]) NOMORE(speed_factor, settings.max_feedrate_mm_s[i] / cs);
|
|
|
|
);
|
|
|
|
|
|
|
|
if (cs > max_fr) NOMORE(speed_factor, max_fr / cs);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
// Max segment time in µs.
|
|
|
|
// Max segment time in µs.
|
|
|
|
#ifdef XY_FREQUENCY_LIMIT
|
|
|
|
#ifdef XY_FREQUENCY_LIMIT
|
|
|
|