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.
master
Sebastianv6508 years agocommitted byScott Lahteine
// Enabling ENSURE_SMOOTH_MOVES ensures your printer will never stutter (for example in circles with a short segments). That's done in two steps:
// --1--
// During short segments like in circles, the update of the LCD Display can take so long that the block buffer gets completely drained.
// If that happens, the movement of the printer gets very jerky until a longer segment like a longer straight line allows the buffer
// to be filled again. This small stops also effects print quality in a bad way.
// Enable ENSURE_SMOOTH_MOVES to update the LCD only when there is enough time during a move to do so.
// Note that this means the display will not show actual values during this time and your printer will also not react to buttons
// pressed immediately, except ALWAYS_ALLOW_MENU is also enabled.
// --2--
// No block is allowed to take less time than MIN_BLOCK_TIME. That's the time it takes in the main loop to add a new block to the buffer, checking temps,
// including all interruptions due to interrupts, but without LCD update. If we would allow shorter moves, the buffer would start continously draining.
//#define ENSURE_SMOOTH_MOVES
#if ENABLED(ENSURE_SMOOTH_MOVES)
//#define ALWAYS_ALLOW_MENU // If enabled, the menu will be always accessible.
// WARNING: If the menu is entered or navigated during short moves, the printer will stutter like without ENSURE_SMOOTH_MOVES!
#define LCD_UPDATE_THRESHOLD 170 // Minimum duration in ms of the current segment to allow a LCD update.
// Default value is valid for graphical LCDs like the REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER.
#define MIN_BLOCK_TIME 6 // Minimum duration in ms a single block has to take. You shouldn't need to modify this.