Browse Source

Merge pull request #5141 from thinkyhead/rc_old_slowdown_what

OLD_SLOWDOWN does nothing, so remove it
pull/1/head
Scott Lahteine 8 years ago
committed by GitHub
parent
commit
0269347682
  1. 12
      Marlin/planner.cpp

12
Marlin/planner.cpp

@ -929,15 +929,10 @@ void Planner::_buffer_line(const float &a, const float &b, const float &c, const
int moves_queued = movesplanned(); int moves_queued = movesplanned();
// Slow down when the buffer starts to empty, rather than wait at the corner for a buffer refill // Slow down when the buffer starts to empty, rather than wait at the corner for a buffer refill
#if ENABLED(OLD_SLOWDOWN) || ENABLED(SLOWDOWN)
bool mq = moves_queued > 1 && moves_queued < (BLOCK_BUFFER_SIZE) / 2;
#if ENABLED(OLD_SLOWDOWN)
if (mq) fr_mm_s *= 2.0 * moves_queued / (BLOCK_BUFFER_SIZE);
#endif
#if ENABLED(SLOWDOWN) #if ENABLED(SLOWDOWN)
// segment time im micro seconds // Segment time im micro seconds
unsigned long segment_time = lround(1000000.0/inverse_mm_s); unsigned long segment_time = lround(1000000.0 / inverse_mm_s);
if (mq) { if (moves_queued > 1 && moves_queued < (BLOCK_BUFFER_SIZE) / 2) {
if (segment_time < min_segment_time) { if (segment_time < min_segment_time) {
// buffer is draining, add extra time. The amount of time added increases if the buffer is still emptied more. // buffer is draining, add extra time. The amount of time added increases if the buffer is still emptied more.
inverse_mm_s = 1000000.0 / (segment_time + lround(2 * (min_segment_time - segment_time) / moves_queued)); inverse_mm_s = 1000000.0 / (segment_time + lround(2 * (min_segment_time - segment_time) / moves_queued));
@ -947,7 +942,6 @@ void Planner::_buffer_line(const float &a, const float &b, const float &c, const
} }
} }
#endif #endif
#endif
block->nominal_speed = block->millimeters * inverse_mm_s; // (mm/sec) Always > 0 block->nominal_speed = block->millimeters * inverse_mm_s; // (mm/sec) Always > 0
block->nominal_rate = ceil(block->step_event_count * inverse_mm_s); // (step/sec) Always > 0 block->nominal_rate = ceil(block->step_event_count * inverse_mm_s); // (step/sec) Always > 0

Loading…
Cancel
Save