Adjust usage of stepper.synchronize
This commit is contained in:
parent
08e20dbbc6
commit
ac5ff1d802
@ -204,8 +204,6 @@
|
|||||||
destination[E_AXIS] = current_position[E_AXIS];
|
destination[E_AXIS] = current_position[E_AXIS];
|
||||||
|
|
||||||
G26_line_to_destination(feed_value);
|
G26_line_to_destination(feed_value);
|
||||||
|
|
||||||
stepper.synchronize();
|
|
||||||
set_destination_from_current();
|
set_destination_from_current();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -220,8 +218,6 @@
|
|||||||
destination[E_AXIS] += e_delta;
|
destination[E_AXIS] += e_delta;
|
||||||
|
|
||||||
G26_line_to_destination(feed_value);
|
G26_line_to_destination(feed_value);
|
||||||
|
|
||||||
stepper.synchronize();
|
|
||||||
set_destination_from_current();
|
set_destination_from_current();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -267,13 +263,12 @@
|
|||||||
if (Total_Prime >= EXTRUDE_MAXLENGTH) return G26_ERR;
|
if (Total_Prime >= EXTRUDE_MAXLENGTH) return G26_ERR;
|
||||||
#endif
|
#endif
|
||||||
G26_line_to_destination(planner.max_feedrate_mm_s[E_AXIS] / 15.0);
|
G26_line_to_destination(planner.max_feedrate_mm_s[E_AXIS] / 15.0);
|
||||||
|
set_destination_from_current();
|
||||||
stepper.synchronize(); // Without this synchronize, the purge is more consistent,
|
stepper.synchronize(); // Without this synchronize, the purge is more consistent,
|
||||||
// but because the planner has a buffer, we won't be able
|
// but because the planner has a buffer, we won't be able
|
||||||
// to stop as quickly. So we put up with the less smooth
|
// to stop as quickly. So we put up with the less smooth
|
||||||
// action to give the user a more responsive 'Stop'.
|
// action to give the user a more responsive 'Stop'.
|
||||||
set_destination_from_current();
|
|
||||||
idle();
|
|
||||||
SERIAL_FLUSH(); // Prevent host M105 buffer overrun.
|
SERIAL_FLUSH(); // Prevent host M105 buffer overrun.
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -295,7 +290,6 @@
|
|||||||
set_destination_from_current();
|
set_destination_from_current();
|
||||||
destination[E_AXIS] += g26_prime_length;
|
destination[E_AXIS] += g26_prime_length;
|
||||||
G26_line_to_destination(planner.max_feedrate_mm_s[E_AXIS] / 15.0);
|
G26_line_to_destination(planner.max_feedrate_mm_s[E_AXIS] / 15.0);
|
||||||
stepper.synchronize();
|
|
||||||
set_destination_from_current();
|
set_destination_from_current();
|
||||||
retract_filament(destination);
|
retract_filament(destination);
|
||||||
}
|
}
|
||||||
@ -703,7 +697,6 @@
|
|||||||
|
|
||||||
if (current_position[Z_AXIS] < Z_CLEARANCE_BETWEEN_PROBES) {
|
if (current_position[Z_AXIS] < Z_CLEARANCE_BETWEEN_PROBES) {
|
||||||
do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES);
|
do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES);
|
||||||
stepper.synchronize();
|
|
||||||
set_current_from_destination();
|
set_current_from_destination();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -738,7 +731,7 @@
|
|||||||
lcd_external_control = true;
|
lcd_external_control = true;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// debug_current_and_destination(PSTR("Starting G26 Mesh Validation Pattern."));
|
//debug_current_and_destination(PSTR("Starting G26 Mesh Validation Pattern."));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pre-generate radius offset values at 30 degree intervals to reduce CPU load.
|
* Pre-generate radius offset values at 30 degree intervals to reduce CPU load.
|
||||||
|
@ -358,7 +358,7 @@
|
|||||||
|
|
||||||
stepper.synchronize();
|
stepper.synchronize();
|
||||||
|
|
||||||
planner.buffer_line(startCoord[X_AXIS],startCoord[Y_AXIS],startCoord[Z_AXIS],
|
planner.buffer_line(startCoord[X_AXIS], startCoord[Y_AXIS], startCoord[Z_AXIS],
|
||||||
stepper.get_axis_position_mm(E_AXIS), feedrate, 0);
|
stepper.get_axis_position_mm(E_AXIS), feedrate, 0);
|
||||||
stepper.synchronize();
|
stepper.synchronize();
|
||||||
|
|
||||||
@ -415,10 +415,10 @@
|
|||||||
startCoord[encoderAxis] = startDistance;
|
startCoord[encoderAxis] = startDistance;
|
||||||
endCoord[encoderAxis] = endDistance;
|
endCoord[encoderAxis] = endDistance;
|
||||||
|
|
||||||
LOOP_L_N(i, iter) {
|
stepper.synchronize();
|
||||||
stepper.synchronize();
|
|
||||||
|
|
||||||
planner.buffer_line(startCoord[X_AXIS],startCoord[Y_AXIS],startCoord[Z_AXIS],
|
LOOP_L_N(i, iter) {
|
||||||
|
planner.buffer_line(startCoord[X_AXIS], startCoord[Y_AXIS], startCoord[Z_AXIS],
|
||||||
stepper.get_axis_position_mm(E_AXIS), feedrate, 0);
|
stepper.get_axis_position_mm(E_AXIS), feedrate, 0);
|
||||||
stepper.synchronize();
|
stepper.synchronize();
|
||||||
|
|
||||||
@ -427,7 +427,7 @@
|
|||||||
|
|
||||||
//do_blocking_move_to(endCoord[X_AXIS],endCoord[Y_AXIS],endCoord[Z_AXIS]);
|
//do_blocking_move_to(endCoord[X_AXIS],endCoord[Y_AXIS],endCoord[Z_AXIS]);
|
||||||
|
|
||||||
planner.buffer_line(endCoord[X_AXIS],endCoord[Y_AXIS],endCoord[Z_AXIS],
|
planner.buffer_line(endCoord[X_AXIS], endCoord[Y_AXIS], endCoord[Z_AXIS],
|
||||||
stepper.get_axis_position_mm(E_AXIS), feedrate, 0);
|
stepper.get_axis_position_mm(E_AXIS), feedrate, 0);
|
||||||
stepper.synchronize();
|
stepper.synchronize();
|
||||||
|
|
||||||
|
@ -2984,7 +2984,7 @@ static void do_homing_move(const AxisEnum axis, const float distance, const floa
|
|||||||
planner.buffer_line(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], current_position[E_AXIS], fr_mm_s ? fr_mm_s : homing_feedrate(axis), active_extruder);
|
planner.buffer_line(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], current_position[E_AXIS], fr_mm_s ? fr_mm_s : homing_feedrate(axis), active_extruder);
|
||||||
#else
|
#else
|
||||||
sync_plan_position();
|
sync_plan_position();
|
||||||
current_position[axis] = distance;
|
current_position[axis] = distance; // Set delta/cartesian axes directly
|
||||||
planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], fr_mm_s ? fr_mm_s : homing_feedrate(axis), active_extruder);
|
planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], fr_mm_s ? fr_mm_s : homing_feedrate(axis), active_extruder);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -5337,8 +5337,8 @@ void home_all_axes() { gcode_G28(true); }
|
|||||||
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
||||||
if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPAIR("Z Probe End Script: ", Z_PROBE_END_SCRIPT);
|
if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPAIR("Z Probe End Script: ", Z_PROBE_END_SCRIPT);
|
||||||
#endif
|
#endif
|
||||||
enqueue_and_echo_commands_P(PSTR(Z_PROBE_END_SCRIPT));
|
|
||||||
stepper.synchronize();
|
stepper.synchronize();
|
||||||
|
enqueue_and_echo_commands_P(PSTR(Z_PROBE_END_SCRIPT));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Auto Bed Leveling is complete! Enable if possible.
|
// Auto Bed Leveling is complete! Enable if possible.
|
||||||
@ -6134,9 +6134,8 @@ void home_all_axes() { gcode_G28(true); }
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
stepper.synchronize(); // wait until the machine is idle
|
|
||||||
|
|
||||||
// Move until destination reached or target hit
|
// Move until destination reached or target hit
|
||||||
|
stepper.synchronize();
|
||||||
endstops.enable(true);
|
endstops.enable(true);
|
||||||
G38_move = true;
|
G38_move = true;
|
||||||
G38_endstop_hit = false;
|
G38_endstop_hit = false;
|
||||||
@ -6158,13 +6157,13 @@ void home_all_axes() { gcode_G28(true); }
|
|||||||
LOOP_XYZ(i) destination[i] += retract_mm[i];
|
LOOP_XYZ(i) destination[i] += retract_mm[i];
|
||||||
endstops.enable(false);
|
endstops.enable(false);
|
||||||
prepare_move_to_destination();
|
prepare_move_to_destination();
|
||||||
stepper.synchronize();
|
|
||||||
|
|
||||||
feedrate_mm_s /= 4;
|
feedrate_mm_s /= 4;
|
||||||
|
|
||||||
// Bump the target more slowly
|
// Bump the target more slowly
|
||||||
LOOP_XYZ(i) destination[i] -= retract_mm[i] * 2;
|
LOOP_XYZ(i) destination[i] -= retract_mm[i] * 2;
|
||||||
|
|
||||||
|
stepper.synchronize();
|
||||||
endstops.enable(true);
|
endstops.enable(true);
|
||||||
G38_move = true;
|
G38_move = true;
|
||||||
prepare_move_to_destination();
|
prepare_move_to_destination();
|
||||||
@ -6346,6 +6345,8 @@ inline void gcode_G92() {
|
|||||||
|
|
||||||
const bool has_message = !hasP && !hasS && args && *args;
|
const bool has_message = !hasP && !hasS && args && *args;
|
||||||
|
|
||||||
|
stepper.synchronize();
|
||||||
|
|
||||||
#if ENABLED(ULTIPANEL)
|
#if ENABLED(ULTIPANEL)
|
||||||
|
|
||||||
if (has_message)
|
if (has_message)
|
||||||
@ -6369,8 +6370,6 @@ inline void gcode_G92() {
|
|||||||
KEEPALIVE_STATE(PAUSED_FOR_USER);
|
KEEPALIVE_STATE(PAUSED_FOR_USER);
|
||||||
wait_for_user = true;
|
wait_for_user = true;
|
||||||
|
|
||||||
stepper.synchronize();
|
|
||||||
|
|
||||||
if (ms > 0) {
|
if (ms > 0) {
|
||||||
ms += millis(); // wait until this time for a click
|
ms += millis(); // wait until this time for a click
|
||||||
while (PENDING(millis(), ms) && wait_for_user) idle();
|
while (PENDING(millis(), ms) && wait_for_user) idle();
|
||||||
@ -6521,8 +6520,8 @@ inline void gcode_M17() {
|
|||||||
set_destination_from_current();
|
set_destination_from_current();
|
||||||
destination[E_AXIS] += length / planner.e_factor[active_extruder];
|
destination[E_AXIS] += length / planner.e_factor[active_extruder];
|
||||||
planner.buffer_line_kinematic(destination, fr, active_extruder);
|
planner.buffer_line_kinematic(destination, fr, active_extruder);
|
||||||
stepper.synchronize();
|
|
||||||
set_current_from_destination();
|
set_current_from_destination();
|
||||||
|
stepper.synchronize();
|
||||||
}
|
}
|
||||||
|
|
||||||
static float resume_position[XYZE];
|
static float resume_position[XYZE];
|
||||||
@ -6810,12 +6809,12 @@ inline void gcode_M17() {
|
|||||||
#endif
|
#endif
|
||||||
print_job_timer.pause();
|
print_job_timer.pause();
|
||||||
|
|
||||||
// Wait for synchronize steppers
|
|
||||||
stepper.synchronize();
|
|
||||||
|
|
||||||
// Save current position
|
// Save current position
|
||||||
COPY(resume_position, current_position);
|
COPY(resume_position, current_position);
|
||||||
|
|
||||||
|
// Wait for synchronize steppers
|
||||||
|
stepper.synchronize();
|
||||||
|
|
||||||
// Initial retract before move to filament change position
|
// Initial retract before move to filament change position
|
||||||
if (retract && thermalManager.hotEnoughToExtrude(active_extruder))
|
if (retract && thermalManager.hotEnoughToExtrude(active_extruder))
|
||||||
do_pause_e_move(retract, PAUSE_PARK_RETRACT_FEEDRATE);
|
do_pause_e_move(retract, PAUSE_PARK_RETRACT_FEEDRATE);
|
||||||
@ -8505,7 +8504,6 @@ inline void gcode_M81() {
|
|||||||
safe_delay(1000); // Wait 1 second before switching off
|
safe_delay(1000); // Wait 1 second before switching off
|
||||||
|
|
||||||
#if HAS_SUICIDE
|
#if HAS_SUICIDE
|
||||||
stepper.synchronize();
|
|
||||||
suicide();
|
suicide();
|
||||||
#elif HAS_POWER_SWITCH
|
#elif HAS_POWER_SWITCH
|
||||||
PSU_OFF();
|
PSU_OFF();
|
||||||
@ -8641,8 +8639,6 @@ void report_current_position() {
|
|||||||
|
|
||||||
void report_current_position_detail() {
|
void report_current_position_detail() {
|
||||||
|
|
||||||
stepper.synchronize();
|
|
||||||
|
|
||||||
SERIAL_PROTOCOLPGM("\nLogical:");
|
SERIAL_PROTOCOLPGM("\nLogical:");
|
||||||
const float logical[XYZ] = {
|
const float logical[XYZ] = {
|
||||||
LOGICAL_X_POSITION(current_position[X_AXIS]),
|
LOGICAL_X_POSITION(current_position[X_AXIS]),
|
||||||
@ -8677,6 +8673,8 @@ void report_current_position() {
|
|||||||
report_xyz(delta);
|
report_xyz(delta);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
stepper.synchronize();
|
||||||
|
|
||||||
SERIAL_PROTOCOLPGM("Stepper:");
|
SERIAL_PROTOCOLPGM("Stepper:");
|
||||||
LOOP_XYZE(i) {
|
LOOP_XYZE(i) {
|
||||||
SERIAL_CHAR(' ');
|
SERIAL_CHAR(' ');
|
||||||
@ -13366,8 +13364,8 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) {
|
|||||||
current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS],
|
current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS],
|
||||||
planner.max_feedrate_mm_s[X_AXIS], 1
|
planner.max_feedrate_mm_s[X_AXIS], 1
|
||||||
);
|
);
|
||||||
SYNC_PLAN_POSITION_KINEMATIC();
|
|
||||||
stepper.synchronize();
|
stepper.synchronize();
|
||||||
|
SYNC_PLAN_POSITION_KINEMATIC();
|
||||||
extruder_duplication_enabled = true;
|
extruder_duplication_enabled = true;
|
||||||
active_extruder_parked = false;
|
active_extruder_parked = false;
|
||||||
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
||||||
@ -13975,6 +13973,7 @@ void manage_inactivity(const bool ignore_stepper_queue/*=false*/) {
|
|||||||
planner.buffer_line_kinematic(current_position, MMM_TO_MMS(EXTRUDER_RUNOUT_SPEED), active_extruder);
|
planner.buffer_line_kinematic(current_position, MMM_TO_MMS(EXTRUDER_RUNOUT_SPEED), active_extruder);
|
||||||
current_position[E_AXIS] = olde;
|
current_position[E_AXIS] = olde;
|
||||||
planner.set_e_position_mm(olde);
|
planner.set_e_position_mm(olde);
|
||||||
|
|
||||||
stepper.synchronize();
|
stepper.synchronize();
|
||||||
#if ENABLED(SWITCHING_EXTRUDER)
|
#if ENABLED(SWITCHING_EXTRUDER)
|
||||||
E0_ENABLE_WRITE(oldstatus);
|
E0_ENABLE_WRITE(oldstatus);
|
||||||
|
Loading…
Reference in New Issue
Block a user