do_pause_e_move => unscaled_e_move

This commit is contained in:
Scott Lahteine
2020-03-29 16:26:55 -05:00
parent fc11e72174
commit 765a9f3471
7 changed files with 33 additions and 35 deletions

View File

@ -55,6 +55,10 @@
#include "../lcd/ultralcd.h"
#endif
#if HAS_FILAMENT_SENSOR
#include "../feature/runout.h"
#endif
#if ENABLED(SENSORLESS_HOMING)
#include "../feature/tmc_util.h"
#endif
@ -332,6 +336,15 @@ void line_to_current_position(const feedRate_t &fr_mm_s/*=feedrate_mm_s*/) {
planner.buffer_line(current_position, fr_mm_s, active_extruder);
}
void unscaled_e_move(const float &length, const feedRate_t &fr_mm_s) {
#if HAS_FILAMENT_SENSOR
runout.reset();
#endif
current_position.e += length / planner.e_factor[active_extruder];
line_to_current_position(fr_mm_s);
planner.synchronize();
}
#if IS_KINEMATIC
/**

View File

@ -184,6 +184,8 @@ void sync_plan_position_e();
*/
void line_to_current_position(const feedRate_t &fr_mm_s=feedrate_mm_s);
void unscaled_e_move(const float &length, const feedRate_t &fr_mm_s);
void prepare_line_to_destination();
void _internal_move_to_destination(const feedRate_t &fr_mm_s=0.0f

View File

@ -856,7 +856,7 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
}
else {
#if ENABLED(ADVANCED_PAUSE_FEATURE)
do_pause_e_move(-toolchange_settings.swap_length, MMM_TO_MMS(toolchange_settings.retract_speed));
unscaled_e_move(-toolchange_settings.swap_length, MMM_TO_MMS(toolchange_settings.retract_speed));
#else
current_position.e -= toolchange_settings.swap_length / planner.e_factor[old_tool];
planner.buffer_line(current_position, MMM_TO_MMS(toolchange_settings.retract_speed), old_tool);
@ -991,8 +991,8 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
#if ENABLED(TOOLCHANGE_FILAMENT_SWAP)
if (should_swap && !too_cold) {
#if ENABLED(ADVANCED_PAUSE_FEATURE)
do_pause_e_move(toolchange_settings.swap_length, MMM_TO_MMS(toolchange_settings.prime_speed));
do_pause_e_move(toolchange_settings.extra_prime, ADVANCED_PAUSE_PURGE_FEEDRATE);
unscaled_e_move(toolchange_settings.swap_length, MMM_TO_MMS(toolchange_settings.prime_speed));
unscaled_e_move(toolchange_settings.extra_prime, ADVANCED_PAUSE_PURGE_FEEDRATE);
#else
current_position.e += toolchange_settings.swap_length / planner.e_factor[new_tool];
planner.buffer_line(current_position, MMM_TO_MMS(toolchange_settings.prime_speed), new_tool);