Ensure smooth print moves even with LCD enabled
lcd_update can take so much time that the block buffer gets drained if there are only short segments. This leads to jerky printer movements for example in circles and a bad print quality. This change implements a simple check: Only if the block currently executed is long enough, run lcd_update. This also means the printer will not show actual values on the LCD nor will it respond to buttons pressed. A option that keeps the menu accessible is also available. Aditionaly, slow down if a block would be so fast that adding a new block to the buffer would take more time. In this case, the buffer would drain until it's empty in worst case.
This commit is contained in:
committed by
Scott Lahteine
parent
0be6167f14
commit
de89dc9f04
@ -937,12 +937,24 @@ void Planner::_buffer_line(const float &a, const float &b, const float &c, const
|
||||
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.
|
||||
inverse_mm_s = 1000000.0 / (segment_time + lround(2 * (min_segment_time - segment_time) / moves_queued));
|
||||
#ifdef XY_FREQUENCY_LIMIT
|
||||
#if defined(XY_FREQUENCY_LIMIT) || ENABLED(ENSURE_SMOOTH_MOVES)
|
||||
segment_time = lround(1000000.0 / inverse_mm_s);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if ENABLED(ENSURE_SMOOTH_MOVES)
|
||||
#if DISABLED(SLOWDOWN)
|
||||
unsigned long segment_time = lround(1000000.0 / inverse_mm_s);
|
||||
#endif
|
||||
if (segment_time < (MIN_BLOCK_TIME) * 1000UL) {
|
||||
// buffer will be draining, set to MIN_BLOCK_TIME.
|
||||
inverse_mm_s = 1000000.0 / (1000.0 * (MIN_BLOCK_TIME));
|
||||
segment_time = (MIN_BLOCK_TIME) * 1000UL;
|
||||
}
|
||||
block->segment_time = segment_time;
|
||||
#endif
|
||||
|
||||
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
|
||||
|
Reference in New Issue
Block a user