Code size optimization: 2KB down (#2687)
* Combine repeated calls into functions with much less parameters -> 2KB down. * Save some bytes by removing unnecessary 1-character strings: "x" -> 'x' used in SERIAL_xxx printing macros. This is also saves some CPU cycles * Fix compilation for MK25S and MK3 * Copy surrounding indentation * Fix compilation for a rare HW setup * rename mesh_planXX_buffer_line back to mesh_plan_buffer_line * Remove active_extruder from remaining plan_buffer_line_destinationXYZE calls and one more fix of indentation
This commit is contained in:
parent
3cc87b17e5
commit
eb44ee0f57
|
|
@ -1338,8 +1338,7 @@ void setup()
|
||||||
// Initialize current_position accounting for software endstops to
|
// Initialize current_position accounting for software endstops to
|
||||||
// avoid unexpected initial shifts on the first move
|
// avoid unexpected initial shifts on the first move
|
||||||
clamp_to_software_endstops(current_position);
|
clamp_to_software_endstops(current_position);
|
||||||
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS],
|
plan_set_position_curposXYZE();
|
||||||
current_position[Z_AXIS], current_position[E_AXIS]);
|
|
||||||
|
|
||||||
#ifdef FILAMENT_SENSOR
|
#ifdef FILAMENT_SENSOR
|
||||||
fsensor_init();
|
fsensor_init();
|
||||||
|
|
@ -1954,7 +1953,7 @@ static void set_bed_level_equation_lsq(double *plane_equation_coefficients)
|
||||||
// put the bed at 0 so we don't go below it.
|
// put the bed at 0 so we don't go below it.
|
||||||
current_position[Z_AXIS] = cs.zprobe_zoffset; // in the lsq we reach here after raising the extruder due to the loop structure
|
current_position[Z_AXIS] = cs.zprobe_zoffset; // in the lsq we reach here after raising the extruder due to the loop structure
|
||||||
|
|
||||||
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
plan_set_position_curposXYZE();
|
||||||
}
|
}
|
||||||
|
|
||||||
#else // not AUTO_BED_LEVELING_GRID
|
#else // not AUTO_BED_LEVELING_GRID
|
||||||
|
|
@ -1982,7 +1981,7 @@ static void set_bed_level_equation_3pts(float z_at_pt_1, float z_at_pt_2, float
|
||||||
// put the bed at 0 so we don't go below it.
|
// put the bed at 0 so we don't go below it.
|
||||||
current_position[Z_AXIS] = cs.zprobe_zoffset;
|
current_position[Z_AXIS] = cs.zprobe_zoffset;
|
||||||
|
|
||||||
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
plan_set_position_curposXYZE();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2014,7 +2013,7 @@ static void run_z_probe() {
|
||||||
|
|
||||||
current_position[Z_AXIS] = st_get_position_mm(Z_AXIS);
|
current_position[Z_AXIS] = st_get_position_mm(Z_AXIS);
|
||||||
// make sure the planner knows where we are as it may be a bit different than we last said to move to
|
// make sure the planner knows where we are as it may be a bit different than we last said to move to
|
||||||
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
plan_set_position_curposXYZE();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void do_blocking_move_to(float x, float y, float z) {
|
static void do_blocking_move_to(float x, float y, float z) {
|
||||||
|
|
@ -2135,7 +2134,7 @@ void raise_z_above(float target, bool plan)
|
||||||
if (axis_known_position[Z_AXIS] || z_min_endstop)
|
if (axis_known_position[Z_AXIS] || z_min_endstop)
|
||||||
{
|
{
|
||||||
// current position is known or very low, it's safe to raise Z
|
// current position is known or very low, it's safe to raise Z
|
||||||
if(plan) plan_buffer_line_curposXYZE(max_feedrate[Z_AXIS], active_extruder);
|
if(plan) plan_buffer_line_curposXYZE(max_feedrate[Z_AXIS]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2148,15 +2147,14 @@ void raise_z_above(float target, bool plan)
|
||||||
#ifdef TMC2130
|
#ifdef TMC2130
|
||||||
tmc2130_home_enter(Z_AXIS_MASK);
|
tmc2130_home_enter(Z_AXIS_MASK);
|
||||||
#endif //TMC2130
|
#endif //TMC2130
|
||||||
plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 60, active_extruder);
|
plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 60);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
#ifdef TMC2130
|
#ifdef TMC2130
|
||||||
if (endstop_z_hit_on_purpose())
|
if (endstop_z_hit_on_purpose())
|
||||||
{
|
{
|
||||||
// not necessarily exact, but will avoid further vertical moves
|
// not necessarily exact, but will avoid further vertical moves
|
||||||
current_position[Z_AXIS] = max_pos[Z_AXIS];
|
current_position[Z_AXIS] = max_pos[Z_AXIS];
|
||||||
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS],
|
plan_set_position_curposXYZE();
|
||||||
current_position[Z_AXIS], current_position[E_AXIS]);
|
|
||||||
}
|
}
|
||||||
tmc2130_home_exit();
|
tmc2130_home_exit();
|
||||||
#endif //TMC2130
|
#endif //TMC2130
|
||||||
|
|
@ -2174,22 +2172,22 @@ bool calibrate_z_auto()
|
||||||
int axis_up_dir = -home_dir(Z_AXIS);
|
int axis_up_dir = -home_dir(Z_AXIS);
|
||||||
tmc2130_home_enter(Z_AXIS_MASK);
|
tmc2130_home_enter(Z_AXIS_MASK);
|
||||||
current_position[Z_AXIS] = 0;
|
current_position[Z_AXIS] = 0;
|
||||||
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
plan_set_position_curposXYZE();
|
||||||
set_destination_to_current();
|
set_destination_to_current();
|
||||||
destination[Z_AXIS] += (1.1 * max_length(Z_AXIS) * axis_up_dir);
|
destination[Z_AXIS] += (1.1 * max_length(Z_AXIS) * axis_up_dir);
|
||||||
feedrate = homing_feedrate[Z_AXIS];
|
feedrate = homing_feedrate[Z_AXIS];
|
||||||
plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate / 60, active_extruder);
|
plan_buffer_line_destinationXYZE(feedrate / 60);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
// current_position[axis] = 0;
|
// current_position[axis] = 0;
|
||||||
// plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
// plan_set_position_curposXYZE();
|
||||||
tmc2130_home_exit();
|
tmc2130_home_exit();
|
||||||
enable_endstops(false);
|
enable_endstops(false);
|
||||||
current_position[Z_AXIS] = 0;
|
current_position[Z_AXIS] = 0;
|
||||||
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
plan_set_position_curposXYZE();
|
||||||
set_destination_to_current();
|
set_destination_to_current();
|
||||||
destination[Z_AXIS] += 10 * axis_up_dir; //10mm up
|
destination[Z_AXIS] += 10 * axis_up_dir; //10mm up
|
||||||
feedrate = homing_feedrate[Z_AXIS] / 2;
|
feedrate = homing_feedrate[Z_AXIS] / 2;
|
||||||
plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate / 60, active_extruder);
|
plan_buffer_line_destinationXYZE(feedrate / 60);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
enable_endstops(endstops_enabled);
|
enable_endstops(endstops_enabled);
|
||||||
if (PRINTER_TYPE == PRINTER_MK3) {
|
if (PRINTER_TYPE == PRINTER_MK3) {
|
||||||
|
|
@ -2198,7 +2196,7 @@ bool calibrate_z_auto()
|
||||||
else {
|
else {
|
||||||
current_position[Z_AXIS] = Z_MAX_POS + 9.0;
|
current_position[Z_AXIS] = Z_MAX_POS + 9.0;
|
||||||
}
|
}
|
||||||
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
plan_set_position_curposXYZE();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#endif //TMC2130
|
#endif //TMC2130
|
||||||
|
|
@ -2209,9 +2207,9 @@ static void check_Z_crash(void)
|
||||||
if (READ(Z_TMC2130_DIAG) != 0) { //Z crash
|
if (READ(Z_TMC2130_DIAG) != 0) { //Z crash
|
||||||
FORCE_HIGH_POWER_END;
|
FORCE_HIGH_POWER_END;
|
||||||
current_position[Z_AXIS] = 0;
|
current_position[Z_AXIS] = 0;
|
||||||
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
plan_set_position_curposXYZE();
|
||||||
current_position[Z_AXIS] += MESH_HOME_Z_SEARCH;
|
current_position[Z_AXIS] += MESH_HOME_Z_SEARCH;
|
||||||
plan_buffer_line_curposXYZE(max_feedrate[Z_AXIS], active_extruder);
|
plan_buffer_line_curposXYZE(max_feedrate[Z_AXIS]);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
kill(_T(MSG_BED_LEVELING_FAILED_POINT_LOW));
|
kill(_T(MSG_BED_LEVELING_FAILED_POINT_LOW));
|
||||||
}
|
}
|
||||||
|
|
@ -2241,24 +2239,24 @@ void homeaxis(int axis, uint8_t cnt)
|
||||||
// and the following movement to endstop has a chance to achieve the required velocity
|
// and the following movement to endstop has a chance to achieve the required velocity
|
||||||
// for the stall guard to work.
|
// for the stall guard to work.
|
||||||
current_position[axis] = 0;
|
current_position[axis] = 0;
|
||||||
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
plan_set_position_curposXYZE();
|
||||||
set_destination_to_current();
|
set_destination_to_current();
|
||||||
// destination[axis] = 11.f;
|
// destination[axis] = 11.f;
|
||||||
destination[axis] = -3.f * axis_home_dir;
|
destination[axis] = -3.f * axis_home_dir;
|
||||||
plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
|
plan_buffer_line_destinationXYZE(feedrate/60);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
// Move away from the possible collision with opposite endstop with the collision detection disabled.
|
// Move away from the possible collision with opposite endstop with the collision detection disabled.
|
||||||
endstops_hit_on_purpose();
|
endstops_hit_on_purpose();
|
||||||
enable_endstops(false);
|
enable_endstops(false);
|
||||||
current_position[axis] = 0;
|
current_position[axis] = 0;
|
||||||
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
plan_set_position_curposXYZE();
|
||||||
destination[axis] = 1. * axis_home_dir;
|
destination[axis] = 1. * axis_home_dir;
|
||||||
plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
|
plan_buffer_line_destinationXYZE(feedrate/60);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
// Now continue to move up to the left end stop with the collision detection enabled.
|
// Now continue to move up to the left end stop with the collision detection enabled.
|
||||||
enable_endstops(true);
|
enable_endstops(true);
|
||||||
destination[axis] = 1.1 * axis_home_dir * max_length(axis);
|
destination[axis] = 1.1 * axis_home_dir * max_length(axis);
|
||||||
plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
|
plan_buffer_line_destinationXYZE(feedrate/60);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
for (uint8_t i = 0; i < cnt; i++)
|
for (uint8_t i = 0; i < cnt; i++)
|
||||||
{
|
{
|
||||||
|
|
@ -2266,9 +2264,9 @@ void homeaxis(int axis, uint8_t cnt)
|
||||||
endstops_hit_on_purpose();
|
endstops_hit_on_purpose();
|
||||||
enable_endstops(false);
|
enable_endstops(false);
|
||||||
current_position[axis] = 0;
|
current_position[axis] = 0;
|
||||||
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
plan_set_position_curposXYZE();
|
||||||
destination[axis] = -10.f * axis_home_dir;
|
destination[axis] = -10.f * axis_home_dir;
|
||||||
plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
|
plan_buffer_line_destinationXYZE(feedrate/60);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
endstops_hit_on_purpose();
|
endstops_hit_on_purpose();
|
||||||
// Now move left up to the collision, this time with a repeatable velocity.
|
// Now move left up to the collision, this time with a repeatable velocity.
|
||||||
|
|
@ -2279,7 +2277,7 @@ void homeaxis(int axis, uint8_t cnt)
|
||||||
#else //TMC2130
|
#else //TMC2130
|
||||||
feedrate = homing_feedrate[axis] / 2;
|
feedrate = homing_feedrate[axis] / 2;
|
||||||
#endif //TMC2130
|
#endif //TMC2130
|
||||||
plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
|
plan_buffer_line_destinationXYZE(feedrate/60);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
#ifdef TMC2130
|
#ifdef TMC2130
|
||||||
uint16_t mscnt = tmc2130_rd_MSCNT(axis);
|
uint16_t mscnt = tmc2130_rd_MSCNT(axis);
|
||||||
|
|
@ -2313,10 +2311,10 @@ void homeaxis(int axis, uint8_t cnt)
|
||||||
float dist = - axis_home_dir * 0.01f * 64;
|
float dist = - axis_home_dir * 0.01f * 64;
|
||||||
#endif //TMC2130
|
#endif //TMC2130
|
||||||
current_position[axis] -= dist;
|
current_position[axis] -= dist;
|
||||||
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
plan_set_position_curposXYZE();
|
||||||
current_position[axis] += dist;
|
current_position[axis] += dist;
|
||||||
destination[axis] = current_position[axis];
|
destination[axis] = current_position[axis];
|
||||||
plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], 0.5f*feedrate/60, active_extruder);
|
plan_buffer_line_destinationXYZE(0.5f*feedrate/60);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
|
|
||||||
feedrate = 0.0;
|
feedrate = 0.0;
|
||||||
|
|
@ -2328,22 +2326,22 @@ void homeaxis(int axis, uint8_t cnt)
|
||||||
#endif
|
#endif
|
||||||
int axis_home_dir = home_dir(axis);
|
int axis_home_dir = home_dir(axis);
|
||||||
current_position[axis] = 0;
|
current_position[axis] = 0;
|
||||||
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
plan_set_position_curposXYZE();
|
||||||
destination[axis] = 1.5 * max_length(axis) * axis_home_dir;
|
destination[axis] = 1.5 * max_length(axis) * axis_home_dir;
|
||||||
feedrate = homing_feedrate[axis];
|
feedrate = homing_feedrate[axis];
|
||||||
plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
|
plan_buffer_line_destinationXYZE(feedrate/60);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
#ifdef TMC2130
|
#ifdef TMC2130
|
||||||
check_Z_crash();
|
check_Z_crash();
|
||||||
#endif //TMC2130
|
#endif //TMC2130
|
||||||
current_position[axis] = 0;
|
current_position[axis] = 0;
|
||||||
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
plan_set_position_curposXYZE();
|
||||||
destination[axis] = -home_retract_mm(axis) * axis_home_dir;
|
destination[axis] = -home_retract_mm(axis) * axis_home_dir;
|
||||||
plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
|
plan_buffer_line_destinationXYZE(feedrate/60);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
destination[axis] = 2*home_retract_mm(axis) * axis_home_dir;
|
destination[axis] = 2*home_retract_mm(axis) * axis_home_dir;
|
||||||
feedrate = homing_feedrate[axis]/2 ;
|
feedrate = homing_feedrate[axis]/2 ;
|
||||||
plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
|
plan_buffer_line_destinationXYZE(feedrate/60);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
#ifdef TMC2130
|
#ifdef TMC2130
|
||||||
check_Z_crash();
|
check_Z_crash();
|
||||||
|
|
@ -2366,7 +2364,7 @@ void home_xy()
|
||||||
set_destination_to_current();
|
set_destination_to_current();
|
||||||
homeaxis(X_AXIS);
|
homeaxis(X_AXIS);
|
||||||
homeaxis(Y_AXIS);
|
homeaxis(Y_AXIS);
|
||||||
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
plan_set_position_curposXYZE();
|
||||||
endstops_hit_on_purpose();
|
endstops_hit_on_purpose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2389,7 +2387,7 @@ void refresh_cmd_timeout(void)
|
||||||
retracted[active_extruder]=true;
|
retracted[active_extruder]=true;
|
||||||
prepare_move();
|
prepare_move();
|
||||||
current_position[Z_AXIS]-=cs.retract_zlift;
|
current_position[Z_AXIS]-=cs.retract_zlift;
|
||||||
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
plan_set_position_curposXYZE();
|
||||||
prepare_move();
|
prepare_move();
|
||||||
feedrate = oldFeedrate;
|
feedrate = oldFeedrate;
|
||||||
} else if(!retracting && retracted[active_extruder]) {
|
} else if(!retracting && retracted[active_extruder]) {
|
||||||
|
|
@ -2398,7 +2396,7 @@ void refresh_cmd_timeout(void)
|
||||||
destination[Z_AXIS]=current_position[Z_AXIS];
|
destination[Z_AXIS]=current_position[Z_AXIS];
|
||||||
destination[E_AXIS]=current_position[E_AXIS];
|
destination[E_AXIS]=current_position[E_AXIS];
|
||||||
current_position[Z_AXIS]+=cs.retract_zlift;
|
current_position[Z_AXIS]+=cs.retract_zlift;
|
||||||
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
plan_set_position_curposXYZE();
|
||||||
current_position[E_AXIS]-=(swapretract?(retract_length_swap+retract_recover_length_swap):(cs.retract_length+cs.retract_recover_length))*float(extrudemultiply)*0.01f;
|
current_position[E_AXIS]-=(swapretract?(retract_length_swap+retract_recover_length_swap):(cs.retract_length+cs.retract_recover_length))*float(extrudemultiply)*0.01f;
|
||||||
plan_set_e_position(current_position[E_AXIS]);
|
plan_set_e_position(current_position[E_AXIS]);
|
||||||
float oldFeedrate = feedrate;
|
float oldFeedrate = feedrate;
|
||||||
|
|
@ -2601,7 +2599,7 @@ static void gcode_G28(bool home_x_axis, long home_x_value, bool home_y_axis, lon
|
||||||
|
|
||||||
int x_axis_home_dir = home_dir(X_AXIS);
|
int x_axis_home_dir = home_dir(X_AXIS);
|
||||||
|
|
||||||
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
plan_set_position_curposXYZE();
|
||||||
destination[X_AXIS] = 1.5 * max_length(X_AXIS) * x_axis_home_dir;destination[Y_AXIS] = 1.5 * max_length(Y_AXIS) * home_dir(Y_AXIS);
|
destination[X_AXIS] = 1.5 * max_length(X_AXIS) * x_axis_home_dir;destination[Y_AXIS] = 1.5 * max_length(Y_AXIS) * home_dir(Y_AXIS);
|
||||||
feedrate = homing_feedrate[X_AXIS];
|
feedrate = homing_feedrate[X_AXIS];
|
||||||
if(homing_feedrate[Y_AXIS]<feedrate)
|
if(homing_feedrate[Y_AXIS]<feedrate)
|
||||||
|
|
@ -2611,15 +2609,15 @@ static void gcode_G28(bool home_x_axis, long home_x_value, bool home_y_axis, lon
|
||||||
} else {
|
} else {
|
||||||
feedrate *= sqrt(pow(max_length(X_AXIS) / max_length(Y_AXIS), 2) + 1);
|
feedrate *= sqrt(pow(max_length(X_AXIS) / max_length(Y_AXIS), 2) + 1);
|
||||||
}
|
}
|
||||||
plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
|
plan_buffer_line_destinationXYZE(feedrate/60);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
|
|
||||||
axis_is_at_home(X_AXIS);
|
axis_is_at_home(X_AXIS);
|
||||||
axis_is_at_home(Y_AXIS);
|
axis_is_at_home(Y_AXIS);
|
||||||
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
plan_set_position_curposXYZE();
|
||||||
destination[X_AXIS] = current_position[X_AXIS];
|
destination[X_AXIS] = current_position[X_AXIS];
|
||||||
destination[Y_AXIS] = current_position[Y_AXIS];
|
destination[Y_AXIS] = current_position[Y_AXIS];
|
||||||
plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
|
plan_buffer_line_destinationXYZE(feedrate/60);
|
||||||
feedrate = 0.0;
|
feedrate = 0.0;
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
endstops_hit_on_purpose();
|
endstops_hit_on_purpose();
|
||||||
|
|
@ -2683,14 +2681,14 @@ static void gcode_G28(bool home_x_axis, long home_x_value, bool home_y_axis, lon
|
||||||
MYSERIAL.println(current_position[X_AXIS]);MYSERIAL.println(current_position[Y_AXIS]);
|
MYSERIAL.println(current_position[X_AXIS]);MYSERIAL.println(current_position[Y_AXIS]);
|
||||||
MYSERIAL.println(current_position[Z_AXIS]);MYSERIAL.println(current_position[E_AXIS]);
|
MYSERIAL.println(current_position[Z_AXIS]);MYSERIAL.println(current_position[E_AXIS]);
|
||||||
#endif
|
#endif
|
||||||
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
plan_set_position_curposXYZE();
|
||||||
#ifdef DEBUG_BUILD
|
#ifdef DEBUG_BUILD
|
||||||
SERIAL_ECHOLNPGM("plan_buffer_line()");
|
SERIAL_ECHOLNPGM("plan_buffer_line()");
|
||||||
MYSERIAL.println(destination[X_AXIS]);MYSERIAL.println(destination[Y_AXIS]);
|
MYSERIAL.println(destination[X_AXIS]);MYSERIAL.println(destination[Y_AXIS]);
|
||||||
MYSERIAL.println(destination[Z_AXIS]);MYSERIAL.println(destination[E_AXIS]);
|
MYSERIAL.println(destination[Z_AXIS]);MYSERIAL.println(destination[E_AXIS]);
|
||||||
MYSERIAL.println(feedrate);MYSERIAL.println(active_extruder);
|
MYSERIAL.println(feedrate);MYSERIAL.println(active_extruder);
|
||||||
#endif
|
#endif
|
||||||
plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate, active_extruder);
|
plan_buffer_line_destinationXYZE(feedrate);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
current_position[X_AXIS] = destination[X_AXIS];
|
current_position[X_AXIS] = destination[X_AXIS];
|
||||||
current_position[Y_AXIS] = destination[Y_AXIS];
|
current_position[Y_AXIS] = destination[Y_AXIS];
|
||||||
|
|
@ -2709,8 +2707,8 @@ static void gcode_G28(bool home_x_axis, long home_x_value, bool home_y_axis, lon
|
||||||
feedrate = XY_TRAVEL_SPEED/60;
|
feedrate = XY_TRAVEL_SPEED/60;
|
||||||
current_position[Z_AXIS] = 0;
|
current_position[Z_AXIS] = 0;
|
||||||
|
|
||||||
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
plan_set_position_curposXYZE();
|
||||||
plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate, active_extruder);
|
plan_buffer_line_destinationXYZE(feedrate);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
current_position[X_AXIS] = destination[X_AXIS];
|
current_position[X_AXIS] = destination[X_AXIS];
|
||||||
current_position[Y_AXIS] = destination[Y_AXIS];
|
current_position[Y_AXIS] = destination[Y_AXIS];
|
||||||
|
|
@ -2726,10 +2724,10 @@ static void gcode_G28(bool home_x_axis, long home_x_value, bool home_y_axis, lon
|
||||||
&& (current_position[Y_AXIS]+Y_PROBE_OFFSET_FROM_EXTRUDER <= Y_MAX_POS)) {
|
&& (current_position[Y_AXIS]+Y_PROBE_OFFSET_FROM_EXTRUDER <= Y_MAX_POS)) {
|
||||||
|
|
||||||
current_position[Z_AXIS] = 0;
|
current_position[Z_AXIS] = 0;
|
||||||
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
plan_set_position_curposXYZE();
|
||||||
destination[Z_AXIS] = Z_RAISE_BEFORE_HOMING * home_dir(Z_AXIS) * (-1); // Set destination away from bed
|
destination[Z_AXIS] = Z_RAISE_BEFORE_HOMING * home_dir(Z_AXIS) * (-1); // Set destination away from bed
|
||||||
feedrate = max_feedrate[Z_AXIS];
|
feedrate = max_feedrate[Z_AXIS];
|
||||||
plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate, active_extruder);
|
plan_buffer_line_destinationXYZE(feedrate);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
|
|
||||||
homeaxis(Z_AXIS);
|
homeaxis(Z_AXIS);
|
||||||
|
|
@ -2756,7 +2754,7 @@ static void gcode_G28(bool home_x_axis, long home_x_value, bool home_y_axis, lon
|
||||||
// Set the planner and stepper routine positions.
|
// Set the planner and stepper routine positions.
|
||||||
// At this point the mesh bed leveling and world2machine corrections are disabled and current_position
|
// At this point the mesh bed leveling and world2machine corrections are disabled and current_position
|
||||||
// contains the machine coordinates.
|
// contains the machine coordinates.
|
||||||
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
plan_set_position_curposXYZE();
|
||||||
|
|
||||||
#ifdef ENDSTOPS_ONLY_FOR_HOMING
|
#ifdef ENDSTOPS_ONLY_FOR_HOMING
|
||||||
enable_endstops(false);
|
enable_endstops(false);
|
||||||
|
|
@ -2868,7 +2866,7 @@ bool gcode_M45(bool onlyZ, int8_t verbosity_level)
|
||||||
enable_endstops(false);
|
enable_endstops(false);
|
||||||
current_position[X_AXIS] += 5;
|
current_position[X_AXIS] += 5;
|
||||||
current_position[Y_AXIS] += 5;
|
current_position[Y_AXIS] += 5;
|
||||||
plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40, active_extruder);
|
plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
|
|
||||||
// Let the user move the Z axes up to the end stoppers.
|
// Let the user move the Z axes up to the end stoppers.
|
||||||
|
|
@ -2918,7 +2916,7 @@ bool gcode_M45(bool onlyZ, int8_t verbosity_level)
|
||||||
|
|
||||||
bool endstops_enabled = enable_endstops(false);
|
bool endstops_enabled = enable_endstops(false);
|
||||||
current_position[Z_AXIS] -= 1; //move 1mm down with disabled endstop
|
current_position[Z_AXIS] -= 1; //move 1mm down with disabled endstop
|
||||||
plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40, active_extruder);
|
plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
|
|
||||||
// Move the print head close to the bed.
|
// Move the print head close to the bed.
|
||||||
|
|
@ -2929,7 +2927,7 @@ bool gcode_M45(bool onlyZ, int8_t verbosity_level)
|
||||||
tmc2130_home_enter(Z_AXIS_MASK);
|
tmc2130_home_enter(Z_AXIS_MASK);
|
||||||
#endif //TMC2130
|
#endif //TMC2130
|
||||||
|
|
||||||
plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40, active_extruder);
|
plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40);
|
||||||
|
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
#ifdef TMC2130
|
#ifdef TMC2130
|
||||||
|
|
@ -2970,7 +2968,7 @@ bool gcode_M45(bool onlyZ, int8_t verbosity_level)
|
||||||
clean_up_after_endstop_move(l_feedmultiply);
|
clean_up_after_endstop_move(l_feedmultiply);
|
||||||
// Print head up.
|
// Print head up.
|
||||||
current_position[Z_AXIS] = MESH_HOME_Z_SEARCH;
|
current_position[Z_AXIS] = MESH_HOME_Z_SEARCH;
|
||||||
plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40, active_extruder);
|
plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
//#ifndef NEW_XYZCAL
|
//#ifndef NEW_XYZCAL
|
||||||
if (result >= 0)
|
if (result >= 0)
|
||||||
|
|
@ -2990,7 +2988,7 @@ bool gcode_M45(bool onlyZ, int8_t verbosity_level)
|
||||||
clean_up_after_endstop_move(l_feedmultiply);
|
clean_up_after_endstop_move(l_feedmultiply);
|
||||||
// Print head up.
|
// Print head up.
|
||||||
current_position[Z_AXIS] = MESH_HOME_Z_SEARCH;
|
current_position[Z_AXIS] = MESH_HOME_Z_SEARCH;
|
||||||
plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40, active_extruder);
|
plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
// if (result >= 0) babystep_apply();
|
// if (result >= 0) babystep_apply();
|
||||||
#endif //HEATBED_V2
|
#endif //HEATBED_V2
|
||||||
|
|
@ -3103,18 +3101,18 @@ static void gcode_M600(bool automatic, float x_position, float y_position, float
|
||||||
|
|
||||||
//Retract E
|
//Retract E
|
||||||
current_position[E_AXIS] += e_shift;
|
current_position[E_AXIS] += e_shift;
|
||||||
plan_buffer_line_curposXYZE(FILAMENTCHANGE_RFEED, active_extruder);
|
plan_buffer_line_curposXYZE(FILAMENTCHANGE_RFEED);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
|
|
||||||
//Lift Z
|
//Lift Z
|
||||||
current_position[Z_AXIS] += z_shift;
|
current_position[Z_AXIS] += z_shift;
|
||||||
plan_buffer_line_curposXYZE(FILAMENTCHANGE_ZFEED, active_extruder);
|
plan_buffer_line_curposXYZE(FILAMENTCHANGE_ZFEED);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
|
|
||||||
//Move XY to side
|
//Move XY to side
|
||||||
current_position[X_AXIS] = x_position;
|
current_position[X_AXIS] = x_position;
|
||||||
current_position[Y_AXIS] = y_position;
|
current_position[Y_AXIS] = y_position;
|
||||||
plan_buffer_line_curposXYZE(FILAMENTCHANGE_XYFEED, active_extruder);
|
plan_buffer_line_curposXYZE(FILAMENTCHANGE_XYFEED);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
|
|
||||||
//Beep, manage nozzle heater and wait for user to start unload filament
|
//Beep, manage nozzle heater and wait for user to start unload filament
|
||||||
|
|
@ -3139,7 +3137,7 @@ static void gcode_M600(bool automatic, float x_position, float y_position, float
|
||||||
lcd_set_cursor(0, 2);
|
lcd_set_cursor(0, 2);
|
||||||
lcd_puts_P(_T(MSG_PLEASE_WAIT));
|
lcd_puts_P(_T(MSG_PLEASE_WAIT));
|
||||||
current_position[X_AXIS] -= 100;
|
current_position[X_AXIS] -= 100;
|
||||||
plan_buffer_line_curposXYZE(FILAMENTCHANGE_XYFEED, active_extruder);
|
plan_buffer_line_curposXYZE(FILAMENTCHANGE_XYFEED);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
lcd_show_fullscreen_message_and_wait_P(_i("Please open idler and remove filament manually."));////MSG_CHECK_IDLER c=20 r=4
|
lcd_show_fullscreen_message_and_wait_P(_i("Please open idler and remove filament manually."));////MSG_CHECK_IDLER c=20 r=4
|
||||||
}
|
}
|
||||||
|
|
@ -3176,7 +3174,7 @@ static void gcode_M600(bool automatic, float x_position, float y_position, float
|
||||||
if (!automatic)
|
if (!automatic)
|
||||||
{
|
{
|
||||||
current_position[E_AXIS] += FILAMENTCHANGE_RECFEED;
|
current_position[E_AXIS] += FILAMENTCHANGE_RECFEED;
|
||||||
plan_buffer_line_curposXYZE(FILAMENTCHANGE_EXFEED, active_extruder);
|
plan_buffer_line_curposXYZE(FILAMENTCHANGE_EXFEED);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Move XY back
|
//Move XY back
|
||||||
|
|
@ -3234,12 +3232,12 @@ void gcode_M701()
|
||||||
|
|
||||||
lcd_setstatuspgm(_T(MSG_LOADING_FILAMENT));
|
lcd_setstatuspgm(_T(MSG_LOADING_FILAMENT));
|
||||||
current_position[E_AXIS] += 40;
|
current_position[E_AXIS] += 40;
|
||||||
plan_buffer_line_curposXYZE(400 / 60, active_extruder); //fast sequence
|
plan_buffer_line_curposXYZE(400 / 60); //fast sequence
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
|
|
||||||
raise_z_above(MIN_Z_FOR_LOAD, false);
|
raise_z_above(MIN_Z_FOR_LOAD, false);
|
||||||
current_position[E_AXIS] += 30;
|
current_position[E_AXIS] += 30;
|
||||||
plan_buffer_line_curposXYZE(400 / 60, active_extruder); //fast sequence
|
plan_buffer_line_curposXYZE(400 / 60); //fast sequence
|
||||||
|
|
||||||
load_filament_final_feed(); //slow sequence
|
load_filament_final_feed(); //slow sequence
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
|
|
@ -3405,8 +3403,7 @@ static void gcode_G92()
|
||||||
current_position[E_AXIS] = values[E_AXIS];
|
current_position[E_AXIS] = values[E_AXIS];
|
||||||
|
|
||||||
// Set all at once
|
// Set all at once
|
||||||
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS],
|
plan_set_position_curposXYZE();
|
||||||
current_position[Z_AXIS], current_position[E_AXIS]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -4359,7 +4356,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
||||||
current_position[X_AXIS] = uncorrected_position.x;
|
current_position[X_AXIS] = uncorrected_position.x;
|
||||||
current_position[Y_AXIS] = uncorrected_position.y;
|
current_position[Y_AXIS] = uncorrected_position.y;
|
||||||
current_position[Z_AXIS] = uncorrected_position.z;
|
current_position[Z_AXIS] = uncorrected_position.z;
|
||||||
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
plan_set_position_curposXYZE();
|
||||||
int l_feedmultiply = setup_for_endstop_move();
|
int l_feedmultiply = setup_for_endstop_move();
|
||||||
|
|
||||||
feedrate = homing_feedrate[Z_AXIS];
|
feedrate = homing_feedrate[Z_AXIS];
|
||||||
|
|
@ -4473,7 +4470,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
||||||
|
|
||||||
apply_rotation_xyz(plan_bed_level_matrix, x_tmp, y_tmp, z_tmp); //Apply the correction sending the probe offset
|
apply_rotation_xyz(plan_bed_level_matrix, x_tmp, y_tmp, z_tmp); //Apply the correction sending the probe offset
|
||||||
current_position[Z_AXIS] = z_tmp - real_z + current_position[Z_AXIS]; //The difference is added to current position and sent to planner.
|
current_position[Z_AXIS] = z_tmp - real_z + current_position[Z_AXIS]; //The difference is added to current position and sent to planner.
|
||||||
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
plan_set_position_curposXYZE();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#ifndef Z_PROBE_SLED
|
#ifndef Z_PROBE_SLED
|
||||||
|
|
@ -4605,15 +4602,15 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
current_position[Z_AXIS] = MESH_HOME_Z_SEARCH;
|
current_position[Z_AXIS] = MESH_HOME_Z_SEARCH;
|
||||||
plan_buffer_line_curposXYZE(3000 / 60, active_extruder);
|
plan_buffer_line_curposXYZE(3000 / 60);
|
||||||
current_position[Z_AXIS] = 50;
|
current_position[Z_AXIS] = 50;
|
||||||
current_position[Y_AXIS] = 180;
|
current_position[Y_AXIS] = 180;
|
||||||
plan_buffer_line_curposXYZE(3000 / 60, active_extruder);
|
plan_buffer_line_curposXYZE(3000 / 60);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
lcd_show_fullscreen_message_and_wait_P(_T(MSG_REMOVE_STEEL_SHEET));
|
lcd_show_fullscreen_message_and_wait_P(_T(MSG_REMOVE_STEEL_SHEET));
|
||||||
current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1);
|
current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1);
|
||||||
current_position[X_AXIS] = pgm_read_float(bed_ref_points_4);
|
current_position[X_AXIS] = pgm_read_float(bed_ref_points_4);
|
||||||
plan_buffer_line_curposXYZE(3000 / 60, active_extruder);
|
plan_buffer_line_curposXYZE(3000 / 60);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
gcode_G28(false, false, true);
|
gcode_G28(false, false, true);
|
||||||
|
|
||||||
|
|
@ -4621,7 +4618,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
||||||
if ((current_temperature_pinda > 35) && (farm_mode == false)) {
|
if ((current_temperature_pinda > 35) && (farm_mode == false)) {
|
||||||
//waiting for PIDNA probe to cool down in case that we are not in farm mode
|
//waiting for PIDNA probe to cool down in case that we are not in farm mode
|
||||||
current_position[Z_AXIS] = 100;
|
current_position[Z_AXIS] = 100;
|
||||||
plan_buffer_line_curposXYZE(3000 / 60, active_extruder);
|
plan_buffer_line_curposXYZE(3000 / 60);
|
||||||
if (lcd_wait_for_pinda(35) == false) { //waiting for PINDA probe to cool, if this takes more then time expected, temp. cal. fails
|
if (lcd_wait_for_pinda(35) == false) { //waiting for PINDA probe to cool, if this takes more then time expected, temp. cal. fails
|
||||||
lcd_temp_cal_show_result(false);
|
lcd_temp_cal_show_result(false);
|
||||||
break;
|
break;
|
||||||
|
|
@ -4645,12 +4642,12 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
||||||
custom_message_state = 1;
|
custom_message_state = 1;
|
||||||
lcd_setstatuspgm(_T(MSG_TEMP_CALIBRATION));
|
lcd_setstatuspgm(_T(MSG_TEMP_CALIBRATION));
|
||||||
current_position[Z_AXIS] = MESH_HOME_Z_SEARCH;
|
current_position[Z_AXIS] = MESH_HOME_Z_SEARCH;
|
||||||
plan_buffer_line_curposXYZE(3000 / 60, active_extruder);
|
plan_buffer_line_curposXYZE(3000 / 60);
|
||||||
current_position[X_AXIS] = PINDA_PREHEAT_X;
|
current_position[X_AXIS] = PINDA_PREHEAT_X;
|
||||||
current_position[Y_AXIS] = PINDA_PREHEAT_Y;
|
current_position[Y_AXIS] = PINDA_PREHEAT_Y;
|
||||||
plan_buffer_line_curposXYZE(3000 / 60, active_extruder);
|
plan_buffer_line_curposXYZE(3000 / 60);
|
||||||
current_position[Z_AXIS] = PINDA_PREHEAT_Z;
|
current_position[Z_AXIS] = PINDA_PREHEAT_Z;
|
||||||
plan_buffer_line_curposXYZE(3000 / 60, active_extruder);
|
plan_buffer_line_curposXYZE(3000 / 60);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
|
|
||||||
while (current_temperature_pinda < start_temp)
|
while (current_temperature_pinda < start_temp)
|
||||||
|
|
@ -4662,10 +4659,10 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
||||||
eeprom_update_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA, 0); //invalidate temp. calibration in case that in will be aborted during the calibration process
|
eeprom_update_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA, 0); //invalidate temp. calibration in case that in will be aborted during the calibration process
|
||||||
|
|
||||||
current_position[Z_AXIS] = MESH_HOME_Z_SEARCH;
|
current_position[Z_AXIS] = MESH_HOME_Z_SEARCH;
|
||||||
plan_buffer_line_curposXYZE(3000 / 60, active_extruder);
|
plan_buffer_line_curposXYZE(3000 / 60);
|
||||||
current_position[X_AXIS] = pgm_read_float(bed_ref_points_4);
|
current_position[X_AXIS] = pgm_read_float(bed_ref_points_4);
|
||||||
current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1);
|
current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1);
|
||||||
plan_buffer_line_curposXYZE(3000 / 60, active_extruder);
|
plan_buffer_line_curposXYZE(3000 / 60);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
|
|
||||||
bool find_z_result = find_bed_induction_sensor_point_z(-1.f);
|
bool find_z_result = find_bed_induction_sensor_point_z(-1.f);
|
||||||
|
|
@ -4693,12 +4690,12 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
||||||
setTargetBed(50 + 10 * (temp - 30) / 5);
|
setTargetBed(50 + 10 * (temp - 30) / 5);
|
||||||
// setTargetHotend(255, 0);
|
// setTargetHotend(255, 0);
|
||||||
current_position[Z_AXIS] = MESH_HOME_Z_SEARCH;
|
current_position[Z_AXIS] = MESH_HOME_Z_SEARCH;
|
||||||
plan_buffer_line_curposXYZE(3000 / 60, active_extruder);
|
plan_buffer_line_curposXYZE(3000 / 60);
|
||||||
current_position[X_AXIS] = PINDA_PREHEAT_X;
|
current_position[X_AXIS] = PINDA_PREHEAT_X;
|
||||||
current_position[Y_AXIS] = PINDA_PREHEAT_Y;
|
current_position[Y_AXIS] = PINDA_PREHEAT_Y;
|
||||||
plan_buffer_line_curposXYZE(3000 / 60, active_extruder);
|
plan_buffer_line_curposXYZE(3000 / 60);
|
||||||
current_position[Z_AXIS] = PINDA_PREHEAT_Z;
|
current_position[Z_AXIS] = PINDA_PREHEAT_Z;
|
||||||
plan_buffer_line_curposXYZE(3000 / 60, active_extruder);
|
plan_buffer_line_curposXYZE(3000 / 60);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
while (current_temperature_pinda < temp)
|
while (current_temperature_pinda < temp)
|
||||||
{
|
{
|
||||||
|
|
@ -4706,10 +4703,10 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
||||||
serialecho_temperatures();
|
serialecho_temperatures();
|
||||||
}
|
}
|
||||||
current_position[Z_AXIS] = MESH_HOME_Z_SEARCH;
|
current_position[Z_AXIS] = MESH_HOME_Z_SEARCH;
|
||||||
plan_buffer_line_curposXYZE(3000 / 60, active_extruder);
|
plan_buffer_line_curposXYZE(3000 / 60);
|
||||||
current_position[X_AXIS] = pgm_read_float(bed_ref_points_4);
|
current_position[X_AXIS] = pgm_read_float(bed_ref_points_4);
|
||||||
current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1);
|
current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1);
|
||||||
plan_buffer_line_curposXYZE(3000 / 60, active_extruder);
|
plan_buffer_line_curposXYZE(3000 / 60);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
find_z_result = find_bed_induction_sensor_point_z(-1.f);
|
find_z_result = find_bed_induction_sensor_point_z(-1.f);
|
||||||
if (find_z_result == false) {
|
if (find_z_result == false) {
|
||||||
|
|
@ -4749,7 +4746,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
||||||
current_position[X_AXIS] = PINDA_PREHEAT_X;
|
current_position[X_AXIS] = PINDA_PREHEAT_X;
|
||||||
current_position[Y_AXIS] = PINDA_PREHEAT_Y;
|
current_position[Y_AXIS] = PINDA_PREHEAT_Y;
|
||||||
current_position[Z_AXIS] = PINDA_PREHEAT_Z;
|
current_position[Z_AXIS] = PINDA_PREHEAT_Z;
|
||||||
plan_buffer_line_curposXYZE(3000 / 60, active_extruder);
|
plan_buffer_line_curposXYZE(3000 / 60);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
|
|
||||||
while (abs(degBed() - PINDA_MIN_T) > 1) {
|
while (abs(degBed() - PINDA_MIN_T) > 1) {
|
||||||
|
|
@ -4765,11 +4762,11 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
||||||
eeprom_update_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA, 0); //invalidate temp. calibration in case that in will be aborted during the calibration process
|
eeprom_update_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA, 0); //invalidate temp. calibration in case that in will be aborted during the calibration process
|
||||||
|
|
||||||
current_position[Z_AXIS] = 5;
|
current_position[Z_AXIS] = 5;
|
||||||
plan_buffer_line_curposXYZE(3000 / 60, active_extruder);
|
plan_buffer_line_curposXYZE(3000 / 60);
|
||||||
|
|
||||||
current_position[X_AXIS] = BED_X0;
|
current_position[X_AXIS] = BED_X0;
|
||||||
current_position[Y_AXIS] = BED_Y0;
|
current_position[Y_AXIS] = BED_Y0;
|
||||||
plan_buffer_line_curposXYZE(3000 / 60, active_extruder);
|
plan_buffer_line_curposXYZE(3000 / 60);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
|
|
||||||
find_bed_induction_sensor_point_z(-1.f);
|
find_bed_induction_sensor_point_z(-1.f);
|
||||||
|
|
@ -4786,7 +4783,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
||||||
current_position[X_AXIS] = PINDA_PREHEAT_X;
|
current_position[X_AXIS] = PINDA_PREHEAT_X;
|
||||||
current_position[Y_AXIS] = PINDA_PREHEAT_Y;
|
current_position[Y_AXIS] = PINDA_PREHEAT_Y;
|
||||||
current_position[Z_AXIS] = PINDA_PREHEAT_Z;
|
current_position[Z_AXIS] = PINDA_PREHEAT_Z;
|
||||||
plan_buffer_line_curposXYZE(3000 / 60, active_extruder);
|
plan_buffer_line_curposXYZE(3000 / 60);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
while (degBed() < t_c) {
|
while (degBed() < t_c) {
|
||||||
delay_keep_alive(1000);
|
delay_keep_alive(1000);
|
||||||
|
|
@ -4797,10 +4794,10 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
||||||
serialecho_temperatures();
|
serialecho_temperatures();
|
||||||
}
|
}
|
||||||
current_position[Z_AXIS] = 5;
|
current_position[Z_AXIS] = 5;
|
||||||
plan_buffer_line_curposXYZE(3000 / 60, active_extruder);
|
plan_buffer_line_curposXYZE(3000 / 60);
|
||||||
current_position[X_AXIS] = BED_X0;
|
current_position[X_AXIS] = BED_X0;
|
||||||
current_position[Y_AXIS] = BED_Y0;
|
current_position[Y_AXIS] = BED_Y0;
|
||||||
plan_buffer_line_curposXYZE(3000 / 60, active_extruder);
|
plan_buffer_line_curposXYZE(3000 / 60);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
find_bed_induction_sensor_point_z(-1.f);
|
find_bed_induction_sensor_point_z(-1.f);
|
||||||
z_shift = (int)((current_position[Z_AXIS] - zero_z)*cs.axis_steps_per_unit[Z_AXIS]);
|
z_shift = (int)((current_position[Z_AXIS] - zero_z)*cs.axis_steps_per_unit[Z_AXIS]);
|
||||||
|
|
@ -4943,7 +4940,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
||||||
// Cycle through all points and probe them
|
// Cycle through all points and probe them
|
||||||
// First move up. During this first movement, the babystepping will be reverted.
|
// First move up. During this first movement, the babystepping will be reverted.
|
||||||
current_position[Z_AXIS] = MESH_HOME_Z_SEARCH;
|
current_position[Z_AXIS] = MESH_HOME_Z_SEARCH;
|
||||||
plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 60, active_extruder);
|
plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 60);
|
||||||
// The move to the first calibration point.
|
// The move to the first calibration point.
|
||||||
current_position[X_AXIS] = BED_X0;
|
current_position[X_AXIS] = BED_X0;
|
||||||
current_position[Y_AXIS] = BED_Y0;
|
current_position[Y_AXIS] = BED_Y0;
|
||||||
|
|
@ -4958,7 +4955,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
||||||
world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]);
|
world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]);
|
||||||
#endif //SUPPORT_VERBOSITY
|
#endif //SUPPORT_VERBOSITY
|
||||||
|
|
||||||
plan_buffer_line_curposXYZE(homing_feedrate[X_AXIS] / 30, active_extruder);
|
plan_buffer_line_curposXYZE(homing_feedrate[X_AXIS] / 30);
|
||||||
// Wait until the move is finished.
|
// Wait until the move is finished.
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
|
|
||||||
|
|
@ -5010,7 +5007,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
||||||
if((ix == 0) && (iy == 0)) current_position[Z_AXIS] = MESH_HOME_Z_SEARCH;
|
if((ix == 0) && (iy == 0)) current_position[Z_AXIS] = MESH_HOME_Z_SEARCH;
|
||||||
else current_position[Z_AXIS] += 2.f / nMeasPoints; //use relative movement from Z coordinate where PINDa triggered on previous point. This makes calibration faster.
|
else current_position[Z_AXIS] += 2.f / nMeasPoints; //use relative movement from Z coordinate where PINDa triggered on previous point. This makes calibration faster.
|
||||||
float init_z_bckp = current_position[Z_AXIS];
|
float init_z_bckp = current_position[Z_AXIS];
|
||||||
plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE, active_extruder);
|
plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
|
|
||||||
// Move to XY position of the sensor point.
|
// Move to XY position of the sensor point.
|
||||||
|
|
@ -5031,7 +5028,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
||||||
#endif // SUPPORT_VERBOSITY
|
#endif // SUPPORT_VERBOSITY
|
||||||
|
|
||||||
//printf_P(PSTR("after clamping: [%f;%f]\n"), current_position[X_AXIS], current_position[Y_AXIS]);
|
//printf_P(PSTR("after clamping: [%f;%f]\n"), current_position[X_AXIS], current_position[Y_AXIS]);
|
||||||
plan_buffer_line_curposXYZE(XY_AXIS_FEEDRATE, active_extruder);
|
plan_buffer_line_curposXYZE(XY_AXIS_FEEDRATE);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
|
|
||||||
// Go down until endstop is hit
|
// Go down until endstop is hit
|
||||||
|
|
@ -5043,7 +5040,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
||||||
if (init_z_bckp - current_position[Z_AXIS] < 0.1f) { //broken cable or initial Z coordinate too low. Go to MESH_HOME_Z_SEARCH and repeat last step (z-probe) again to distinguish between these two cases.
|
if (init_z_bckp - current_position[Z_AXIS] < 0.1f) { //broken cable or initial Z coordinate too low. Go to MESH_HOME_Z_SEARCH and repeat last step (z-probe) again to distinguish between these two cases.
|
||||||
//printf_P(PSTR("Another attempt! Current Z position: %f\n"), current_position[Z_AXIS]);
|
//printf_P(PSTR("Another attempt! Current Z position: %f\n"), current_position[Z_AXIS]);
|
||||||
current_position[Z_AXIS] = MESH_HOME_Z_SEARCH;
|
current_position[Z_AXIS] = MESH_HOME_Z_SEARCH;
|
||||||
plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE, active_extruder);
|
plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
|
|
||||||
if (!find_bed_induction_sensor_point_z((has_z && mesh_point > 0) ? z0 - Z_CALIBRATION_THRESHOLD : -10.f, nProbeRetry)) { //if we have data from z calibration max allowed difference is 1mm for each point, if we dont have data max difference is 10mm from initial point
|
if (!find_bed_induction_sensor_point_z((has_z && mesh_point > 0) ? z0 - Z_CALIBRATION_THRESHOLD : -10.f, nProbeRetry)) { //if we have data from z calibration max allowed difference is 1mm for each point, if we dont have data max difference is 10mm from initial point
|
||||||
|
|
@ -5098,7 +5095,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
||||||
MYSERIAL.print(current_position[Z_AXIS], 5);
|
MYSERIAL.print(current_position[Z_AXIS], 5);
|
||||||
}
|
}
|
||||||
#endif // SUPPORT_VERBOSITY
|
#endif // SUPPORT_VERBOSITY
|
||||||
plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE, active_extruder);
|
plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
if (mesh_point != nMeasPoints * nMeasPoints) {
|
if (mesh_point != nMeasPoints * nMeasPoints) {
|
||||||
Sound_MakeSound(e_SOUND_TYPE_StandardAlert);
|
Sound_MakeSound(e_SOUND_TYPE_StandardAlert);
|
||||||
|
|
@ -5115,14 +5112,14 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
||||||
// ~ Z-homing (can not be used "G28", because X & Y-homing would have been done before (Z-homing))
|
// ~ Z-homing (can not be used "G28", because X & Y-homing would have been done before (Z-homing))
|
||||||
bState=enable_z_endstop(false);
|
bState=enable_z_endstop(false);
|
||||||
current_position[Z_AXIS] -= 1;
|
current_position[Z_AXIS] -= 1;
|
||||||
plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40, active_extruder);
|
plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
enable_z_endstop(true);
|
enable_z_endstop(true);
|
||||||
#ifdef TMC2130
|
#ifdef TMC2130
|
||||||
tmc2130_home_enter(Z_AXIS_MASK);
|
tmc2130_home_enter(Z_AXIS_MASK);
|
||||||
#endif // TMC2130
|
#endif // TMC2130
|
||||||
current_position[Z_AXIS] = MESH_HOME_Z_SEARCH;
|
current_position[Z_AXIS] = MESH_HOME_Z_SEARCH;
|
||||||
plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40, active_extruder);
|
plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
#ifdef TMC2130
|
#ifdef TMC2130
|
||||||
tmc2130_home_exit();
|
tmc2130_home_exit();
|
||||||
|
|
@ -5252,7 +5249,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
||||||
//unretract (after PINDA preheat retraction)
|
//unretract (after PINDA preheat retraction)
|
||||||
if (degHotend(active_extruder) > EXTRUDE_MINTEMP && temp_cal_active == true && calibration_status_pinda() == true && target_temperature_bed >= 50) {
|
if (degHotend(active_extruder) > EXTRUDE_MINTEMP && temp_cal_active == true && calibration_status_pinda() == true && target_temperature_bed >= 50) {
|
||||||
current_position[E_AXIS] += default_retraction;
|
current_position[E_AXIS] += default_retraction;
|
||||||
plan_buffer_line_curposXYZE(400, active_extruder);
|
plan_buffer_line_curposXYZE(400);
|
||||||
}
|
}
|
||||||
KEEPALIVE_STATE(NOT_BUSY);
|
KEEPALIVE_STATE(NOT_BUSY);
|
||||||
// Restore custom message state
|
// Restore custom message state
|
||||||
|
|
@ -5274,7 +5271,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
||||||
if (mbl.active) {
|
if (mbl.active) {
|
||||||
SERIAL_PROTOCOLPGM("Num X,Y: ");
|
SERIAL_PROTOCOLPGM("Num X,Y: ");
|
||||||
SERIAL_PROTOCOL(MESH_NUM_X_POINTS);
|
SERIAL_PROTOCOL(MESH_NUM_X_POINTS);
|
||||||
SERIAL_PROTOCOLPGM(",");
|
SERIAL_PROTOCOL(',');
|
||||||
SERIAL_PROTOCOL(MESH_NUM_Y_POINTS);
|
SERIAL_PROTOCOL(MESH_NUM_Y_POINTS);
|
||||||
SERIAL_PROTOCOLPGM("\nZ search height: ");
|
SERIAL_PROTOCOLPGM("\nZ search height: ");
|
||||||
SERIAL_PROTOCOL(MESH_HOME_Z_SEARCH);
|
SERIAL_PROTOCOL(MESH_HOME_Z_SEARCH);
|
||||||
|
|
@ -5284,7 +5281,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
||||||
SERIAL_PROTOCOLPGM(" ");
|
SERIAL_PROTOCOLPGM(" ");
|
||||||
SERIAL_PROTOCOL_F(mbl.z_values[y][x], 5);
|
SERIAL_PROTOCOL_F(mbl.z_values[y][x], 5);
|
||||||
}
|
}
|
||||||
SERIAL_PROTOCOLPGM("\n");
|
SERIAL_PROTOCOLLN();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -6292,7 +6289,7 @@ Sigma_Exit:
|
||||||
for (int8_t cur_extruder = 0; cur_extruder < EXTRUDERS; ++cur_extruder) {
|
for (int8_t cur_extruder = 0; cur_extruder < EXTRUDERS; ++cur_extruder) {
|
||||||
SERIAL_PROTOCOLPGM(" T");
|
SERIAL_PROTOCOLPGM(" T");
|
||||||
SERIAL_PROTOCOL(cur_extruder);
|
SERIAL_PROTOCOL(cur_extruder);
|
||||||
SERIAL_PROTOCOLPGM(":");
|
SERIAL_PROTOCOL(':');
|
||||||
SERIAL_PROTOCOL_F(degHotend(cur_extruder),1);
|
SERIAL_PROTOCOL_F(degHotend(cur_extruder),1);
|
||||||
SERIAL_PROTOCOLPGM(" /");
|
SERIAL_PROTOCOLPGM(" /");
|
||||||
SERIAL_PROTOCOL_F(degTargetHotend(cur_extruder),1);
|
SERIAL_PROTOCOL_F(degTargetHotend(cur_extruder),1);
|
||||||
|
|
@ -7977,9 +7974,8 @@ Sigma_Exit:
|
||||||
{
|
{
|
||||||
SERIAL_PROTOCOLPGM("P:");
|
SERIAL_PROTOCOLPGM("P:");
|
||||||
SERIAL_PROTOCOL_F(current_temperature_pinda, 1);
|
SERIAL_PROTOCOL_F(current_temperature_pinda, 1);
|
||||||
SERIAL_PROTOCOLPGM("/");
|
SERIAL_PROTOCOL('/');
|
||||||
SERIAL_PROTOCOL(set_target_pinda);
|
SERIAL_PROTOCOLLN(set_target_pinda);
|
||||||
SERIAL_PROTOCOLLN("");
|
|
||||||
codenum = _millis();
|
codenum = _millis();
|
||||||
}
|
}
|
||||||
manage_heater();
|
manage_heater();
|
||||||
|
|
@ -8728,7 +8724,7 @@ Sigma_Exit:
|
||||||
#else //SNMM
|
#else //SNMM
|
||||||
if (tmp_extruder >= EXTRUDERS) {
|
if (tmp_extruder >= EXTRUDERS) {
|
||||||
SERIAL_ECHO_START;
|
SERIAL_ECHO_START;
|
||||||
SERIAL_ECHOPGM("T");
|
SERIAL_ECHO('T');
|
||||||
SERIAL_PROTOCOLLN((int)tmp_extruder);
|
SERIAL_PROTOCOLLN((int)tmp_extruder);
|
||||||
SERIAL_ECHOLNRPGM(_n("Invalid extruder"));////MSG_INVALID_EXTRUDER
|
SERIAL_ECHOLNRPGM(_n("Invalid extruder"));////MSG_INVALID_EXTRUDER
|
||||||
}
|
}
|
||||||
|
|
@ -8758,7 +8754,7 @@ Sigma_Exit:
|
||||||
}
|
}
|
||||||
// Set the new active extruder and position
|
// Set the new active extruder and position
|
||||||
active_extruder = tmp_extruder;
|
active_extruder = tmp_extruder;
|
||||||
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
plan_set_position_curposXYZE();
|
||||||
// Move to the old position if 'F' was in the parameters
|
// Move to the old position if 'F' was in the parameters
|
||||||
if (make_move && Stopped == false) {
|
if (make_move && Stopped == false) {
|
||||||
prepare_move();
|
prepare_move();
|
||||||
|
|
@ -9308,13 +9304,13 @@ void prepare_move()
|
||||||
|
|
||||||
// Do not use feedmultiply for E or Z only moves
|
// Do not use feedmultiply for E or Z only moves
|
||||||
if( (current_position[X_AXIS] == destination [X_AXIS]) && (current_position[Y_AXIS] == destination [Y_AXIS])) {
|
if( (current_position[X_AXIS] == destination [X_AXIS]) && (current_position[Y_AXIS] == destination [Y_AXIS])) {
|
||||||
plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
|
plan_buffer_line_destinationXYZE(feedrate/60);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
#ifdef MESH_BED_LEVELING
|
#ifdef MESH_BED_LEVELING
|
||||||
mesh_plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate*feedmultiply*(1./(60.f*100.f)), active_extruder);
|
mesh_plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate*feedmultiply*(1./(60.f*100.f)), active_extruder);
|
||||||
#else
|
#else
|
||||||
plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate*feedmultiply*(1./(60.f*100.f)), active_extruder);
|
plan_buffer_line_destinationXYZE(feedrate*feedmultiply*(1./(60.f*100.f)));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -9946,7 +9942,7 @@ static void wait_for_heater(long codenum, uint8_t extruder) {
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SERIAL_PROTOCOLLN("?");
|
SERIAL_PROTOCOLLN('?');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
|
@ -10077,16 +10073,16 @@ void bed_check(float x_dimension, float y_dimension, int x_points_num, int y_poi
|
||||||
card.openFile(filename_wldsd, false);
|
card.openFile(filename_wldsd, false);
|
||||||
|
|
||||||
/*destination[Z_AXIS] = mesh_home_z_search;
|
/*destination[Z_AXIS] = mesh_home_z_search;
|
||||||
//plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE, active_extruder);
|
//plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE);
|
||||||
|
|
||||||
plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], Z_LIFT_FEEDRATE, active_extruder);
|
plan_buffer_line_destinationXYZE(Z_LIFT_FEEDRATE);
|
||||||
for(int8_t i=0; i < NUM_AXIS; i++) {
|
for(int8_t i=0; i < NUM_AXIS; i++) {
|
||||||
current_position[i] = destination[i];
|
current_position[i] = destination[i];
|
||||||
}
|
}
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
*/
|
*/
|
||||||
destination[Z_AXIS] = measure_z_height;
|
destination[Z_AXIS] = measure_z_height;
|
||||||
plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], Z_LIFT_FEEDRATE, active_extruder);
|
plan_buffer_line_destinationXYZE(Z_LIFT_FEEDRATE);
|
||||||
for(int8_t i=0; i < NUM_AXIS; i++) {
|
for(int8_t i=0; i < NUM_AXIS; i++) {
|
||||||
current_position[i] = destination[i];
|
current_position[i] = destination[i];
|
||||||
}
|
}
|
||||||
|
|
@ -10111,9 +10107,9 @@ void bed_check(float x_dimension, float y_dimension, int x_points_num, int y_poi
|
||||||
if (iy & 1) ix = (x_points_num - 1) - ix; // Zig zag
|
if (iy & 1) ix = (x_points_num - 1) - ix; // Zig zag
|
||||||
float z0 = 0.f;
|
float z0 = 0.f;
|
||||||
/*destination[Z_AXIS] = mesh_home_z_search;
|
/*destination[Z_AXIS] = mesh_home_z_search;
|
||||||
//plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE, active_extruder);
|
//plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE);
|
||||||
|
|
||||||
plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], Z_LIFT_FEEDRATE, active_extruder);
|
plan_buffer_line_destinationXYZE(Z_LIFT_FEEDRATE);
|
||||||
for(int8_t i=0; i < NUM_AXIS; i++) {
|
for(int8_t i=0; i < NUM_AXIS; i++) {
|
||||||
current_position[i] = destination[i];
|
current_position[i] = destination[i];
|
||||||
}
|
}
|
||||||
|
|
@ -10126,8 +10122,8 @@ void bed_check(float x_dimension, float y_dimension, int x_points_num, int y_poi
|
||||||
destination[X_AXIS] = ix * (x_dimension / (x_points_num - 1)) + shift_x;
|
destination[X_AXIS] = ix * (x_dimension / (x_points_num - 1)) + shift_x;
|
||||||
destination[Y_AXIS] = iy * (y_dimension / (y_points_num - 1)) + shift_y;
|
destination[Y_AXIS] = iy * (y_dimension / (y_points_num - 1)) + shift_y;
|
||||||
|
|
||||||
mesh_plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], XY_AXIS_FEEDRATE/6, active_extruder);
|
mesh_plan_buffer_line_destinationXYZE(XY_AXIS_FEEDRATE/6);
|
||||||
set_current_to_destination();
|
set_current_to_destination();
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
|
|
||||||
// printf_P(PSTR("X = %f; Y= %f \n"), current_position[X_AXIS], current_position[Y_AXIS]);
|
// printf_P(PSTR("X = %f; Y= %f \n"), current_position[X_AXIS], current_position[Y_AXIS]);
|
||||||
|
|
@ -10550,12 +10546,12 @@ void long_pause() //long pause print
|
||||||
//lift z
|
//lift z
|
||||||
current_position[Z_AXIS] += Z_PAUSE_LIFT;
|
current_position[Z_AXIS] += Z_PAUSE_LIFT;
|
||||||
if (current_position[Z_AXIS] > Z_MAX_POS) current_position[Z_AXIS] = Z_MAX_POS;
|
if (current_position[Z_AXIS] > Z_MAX_POS) current_position[Z_AXIS] = Z_MAX_POS;
|
||||||
plan_buffer_line_curposXYZE(15, active_extruder);
|
plan_buffer_line_curposXYZE(15);
|
||||||
|
|
||||||
//Move XY to side
|
//Move XY to side
|
||||||
current_position[X_AXIS] = X_PAUSE_POS;
|
current_position[X_AXIS] = X_PAUSE_POS;
|
||||||
current_position[Y_AXIS] = Y_PAUSE_POS;
|
current_position[Y_AXIS] = Y_PAUSE_POS;
|
||||||
plan_buffer_line_curposXYZE(50, active_extruder);
|
plan_buffer_line_curposXYZE(50);
|
||||||
|
|
||||||
// Turn off the print fan
|
// Turn off the print fan
|
||||||
fanSpeed = 0;
|
fanSpeed = 0;
|
||||||
|
|
@ -10665,7 +10661,7 @@ void uvlo_()
|
||||||
|
|
||||||
// Retract
|
// Retract
|
||||||
current_position[E_AXIS] -= default_retraction;
|
current_position[E_AXIS] -= default_retraction;
|
||||||
plan_buffer_line_curposXYZE(95, active_extruder);
|
plan_buffer_line_curposXYZE(95);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
disable_e0();
|
disable_e0();
|
||||||
|
|
||||||
|
|
@ -10678,7 +10674,7 @@ void uvlo_()
|
||||||
current_position[Z_AXIS] += float(1024 - z_microsteps)
|
current_position[Z_AXIS] += float(1024 - z_microsteps)
|
||||||
/ (z_res * cs.axis_steps_per_unit[Z_AXIS])
|
/ (z_res * cs.axis_steps_per_unit[Z_AXIS])
|
||||||
+ UVLO_Z_AXIS_SHIFT;
|
+ UVLO_Z_AXIS_SHIFT;
|
||||||
plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS]/60, active_extruder);
|
plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS]/60);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
poweroff_z();
|
poweroff_z();
|
||||||
|
|
||||||
|
|
@ -10741,7 +10737,7 @@ void uvlo_()
|
||||||
// All is set: with all the juice left, try to move extruder away to detach the nozzle completely from the print
|
// All is set: with all the juice left, try to move extruder away to detach the nozzle completely from the print
|
||||||
poweron_z();
|
poweron_z();
|
||||||
current_position[X_AXIS] = (current_position[X_AXIS] < 0.5f * (X_MIN_POS + X_MAX_POS)) ? X_MIN_POS : X_MAX_POS;
|
current_position[X_AXIS] = (current_position[X_AXIS] < 0.5f * (X_MIN_POS + X_MAX_POS)) ? X_MIN_POS : X_MAX_POS;
|
||||||
plan_buffer_line_curposXYZE(500, active_extruder);
|
plan_buffer_line_curposXYZE(500);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
|
|
||||||
wdt_enable(WDTO_1S);
|
wdt_enable(WDTO_1S);
|
||||||
|
|
@ -10792,7 +10788,7 @@ void uvlo_tiny()
|
||||||
current_position[Z_AXIS] += float(1024 - z_microsteps)
|
current_position[Z_AXIS] += float(1024 - z_microsteps)
|
||||||
/ (z_res * cs.axis_steps_per_unit[Z_AXIS])
|
/ (z_res * cs.axis_steps_per_unit[Z_AXIS])
|
||||||
+ UVLO_TINY_Z_AXIS_SHIFT;
|
+ UVLO_TINY_Z_AXIS_SHIFT;
|
||||||
plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS]/60, active_extruder);
|
plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS]/60);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
poweroff_z();
|
poweroff_z();
|
||||||
|
|
||||||
|
|
@ -10971,7 +10967,7 @@ bool recover_machine_state_after_power_panic()
|
||||||
|
|
||||||
// 5) Set the physical positions from the logical positions using the world2machine transformation
|
// 5) Set the physical positions from the logical positions using the world2machine transformation
|
||||||
// This is only done to inizialize Z/E axes with physical locations, since X/Y are unknown.
|
// This is only done to inizialize Z/E axes with physical locations, since X/Y are unknown.
|
||||||
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
plan_set_position_curposXYZE();
|
||||||
|
|
||||||
// 6) Power up the Z motors, mark their positions as known.
|
// 6) Power up the Z motors, mark their positions as known.
|
||||||
axis_known_position[Z_AXIS] = true;
|
axis_known_position[Z_AXIS] = true;
|
||||||
|
|
@ -11395,9 +11391,9 @@ void print_mesh_bed_leveling_table()
|
||||||
for (int8_t y = 0; y < MESH_NUM_Y_POINTS; ++ y)
|
for (int8_t y = 0; y < MESH_NUM_Y_POINTS; ++ y)
|
||||||
for (int8_t x = 0; x < MESH_NUM_Y_POINTS; ++ x) {
|
for (int8_t x = 0; x < MESH_NUM_Y_POINTS; ++ x) {
|
||||||
MYSERIAL.print(mbl.z_values[y][x], 3);
|
MYSERIAL.print(mbl.z_values[y][x], 3);
|
||||||
SERIAL_ECHOPGM(" ");
|
SERIAL_ECHO(' ');
|
||||||
}
|
}
|
||||||
SERIAL_ECHOLNPGM("");
|
SERIAL_ECHOLN();
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t print_time_remaining() {
|
uint16_t print_time_remaining() {
|
||||||
|
|
@ -11445,7 +11441,7 @@ static void print_time_remaining_init()
|
||||||
void load_filament_final_feed()
|
void load_filament_final_feed()
|
||||||
{
|
{
|
||||||
current_position[E_AXIS]+= FILAMENTCHANGE_FINALFEED;
|
current_position[E_AXIS]+= FILAMENTCHANGE_FINALFEED;
|
||||||
plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FINAL, active_extruder);
|
plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FINAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
//! @brief Wait for user to check the state
|
//! @brief Wait for user to check the state
|
||||||
|
|
@ -11590,7 +11586,7 @@ void M600_load_filament_movements()
|
||||||
plan_buffer_line_curposXYZE(50, active_extruder);
|
plan_buffer_line_curposXYZE(50, active_extruder);
|
||||||
#else
|
#else
|
||||||
current_position[E_AXIS]+= FILAMENTCHANGE_FIRSTFEED ;
|
current_position[E_AXIS]+= FILAMENTCHANGE_FIRSTFEED ;
|
||||||
plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FIRST, active_extruder);
|
plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FIRST);
|
||||||
#endif
|
#endif
|
||||||
load_filament_final_feed();
|
load_filament_final_feed();
|
||||||
lcd_loading_filament();
|
lcd_loading_filament();
|
||||||
|
|
|
||||||
|
|
@ -331,7 +331,7 @@ void CardReader::diveSubfolder (const char *fileName, SdFile& dir)
|
||||||
{
|
{
|
||||||
SERIAL_PROTOCOLRPGM(MSG_SD_OPEN_FILE_FAIL);
|
SERIAL_PROTOCOLRPGM(MSG_SD_OPEN_FILE_FAIL);
|
||||||
SERIAL_PROTOCOL(subdirname);
|
SERIAL_PROTOCOL(subdirname);
|
||||||
SERIAL_PROTOCOLLNPGM(".");
|
SERIAL_PROTOCOLLN('.');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -430,7 +430,7 @@ void CardReader::openFile(const char* name,bool read, bool replace_current/*=tru
|
||||||
{
|
{
|
||||||
SERIAL_PROTOCOLRPGM(MSG_SD_OPEN_FILE_FAIL);
|
SERIAL_PROTOCOLRPGM(MSG_SD_OPEN_FILE_FAIL);
|
||||||
SERIAL_PROTOCOL(fname);
|
SERIAL_PROTOCOL(fname);
|
||||||
SERIAL_PROTOCOLLNPGM(".");
|
SERIAL_PROTOCOLLN('.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -439,7 +439,7 @@ void CardReader::openFile(const char* name,bool read, bool replace_current/*=tru
|
||||||
{
|
{
|
||||||
SERIAL_PROTOCOLRPGM(MSG_SD_OPEN_FILE_FAIL);
|
SERIAL_PROTOCOLRPGM(MSG_SD_OPEN_FILE_FAIL);
|
||||||
SERIAL_PROTOCOL(fname);
|
SERIAL_PROTOCOL(fname);
|
||||||
SERIAL_PROTOCOLLNPGM(".");
|
SERIAL_PROTOCOLLN('.');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -496,17 +496,15 @@ void CardReader::getStatus()
|
||||||
SERIAL_PROTOCOLLNPGM("Print saved");
|
SERIAL_PROTOCOLLNPGM("Print saved");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
SERIAL_PROTOCOL(longFilename);
|
SERIAL_PROTOCOLLN(longFilename);
|
||||||
SERIAL_PROTOCOLPGM("\n");
|
|
||||||
SERIAL_PROTOCOLRPGM(_N("SD printing byte "));////MSG_SD_PRINTING_BYTE
|
SERIAL_PROTOCOLRPGM(_N("SD printing byte "));////MSG_SD_PRINTING_BYTE
|
||||||
SERIAL_PROTOCOL(sdpos);
|
SERIAL_PROTOCOL(sdpos);
|
||||||
SERIAL_PROTOCOLPGM("/");
|
SERIAL_PROTOCOL('/');
|
||||||
SERIAL_PROTOCOLLN(filesize);
|
SERIAL_PROTOCOLLN(filesize);
|
||||||
uint16_t time = _millis()/60000 - starttime/60000;
|
uint16_t time = ( _millis() - starttime ) / 60000U;
|
||||||
SERIAL_PROTOCOL(itostr2(time/60));
|
SERIAL_PROTOCOL(itostr2(time/60));
|
||||||
SERIAL_PROTOCOL(':');
|
SERIAL_PROTOCOL(':');
|
||||||
SERIAL_PROTOCOL(itostr2(time%60));
|
SERIAL_PROTOCOLLN(itostr2(time%60));
|
||||||
SERIAL_PROTOCOLPGM("\n");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
||||||
|
|
@ -624,7 +624,7 @@ void fsensor_update(void)
|
||||||
// move the nozzle away while checking the filament
|
// move the nozzle away while checking the filament
|
||||||
current_position[Z_AXIS] += 0.8;
|
current_position[Z_AXIS] += 0.8;
|
||||||
if(current_position[Z_AXIS] > Z_MAX_POS) current_position[Z_AXIS] = Z_MAX_POS;
|
if(current_position[Z_AXIS] > Z_MAX_POS) current_position[Z_AXIS] = Z_MAX_POS;
|
||||||
plan_buffer_line_curposXYZE(max_feedrate[Z_AXIS], active_extruder);
|
plan_buffer_line_curposXYZE(max_feedrate[Z_AXIS]);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
|
|
||||||
// check the filament in isolation
|
// check the filament in isolation
|
||||||
|
|
@ -632,9 +632,9 @@ void fsensor_update(void)
|
||||||
fsensor_oq_meassure_start(0);
|
fsensor_oq_meassure_start(0);
|
||||||
float e_tmp = current_position[E_AXIS];
|
float e_tmp = current_position[E_AXIS];
|
||||||
current_position[E_AXIS] -= 3;
|
current_position[E_AXIS] -= 3;
|
||||||
plan_buffer_line_curposXYZE(250/60, active_extruder);
|
plan_buffer_line_curposXYZE(250/60);
|
||||||
current_position[E_AXIS] = e_tmp;
|
current_position[E_AXIS] = e_tmp;
|
||||||
plan_buffer_line_curposXYZE(200/60, active_extruder);
|
plan_buffer_line_curposXYZE(200/60);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
fsensor_oq_meassure_stop();
|
fsensor_oq_meassure_stop();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -920,7 +920,7 @@ static inline void go_xy(float x, float y, float fr)
|
||||||
|
|
||||||
static inline void go_to_current(float fr)
|
static inline void go_to_current(float fr)
|
||||||
{
|
{
|
||||||
plan_buffer_line_curposXYZE(fr, active_extruder);
|
plan_buffer_line_curposXYZE(fr);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -929,7 +929,7 @@ static inline void update_current_position_xyz()
|
||||||
current_position[X_AXIS] = st_get_position_mm(X_AXIS);
|
current_position[X_AXIS] = st_get_position_mm(X_AXIS);
|
||||||
current_position[Y_AXIS] = st_get_position_mm(Y_AXIS);
|
current_position[Y_AXIS] = st_get_position_mm(Y_AXIS);
|
||||||
current_position[Z_AXIS] = st_get_position_mm(Z_AXIS);
|
current_position[Z_AXIS] = st_get_position_mm(Z_AXIS);
|
||||||
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
plan_set_position_curposXYZE();
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void update_current_position_z()
|
static inline void update_current_position_z()
|
||||||
|
|
|
||||||
|
|
@ -540,7 +540,7 @@ void mmu_command(MmuCmd cmd)
|
||||||
void mmu_load_step(bool synchronize)
|
void mmu_load_step(bool synchronize)
|
||||||
{
|
{
|
||||||
current_position[E_AXIS] = current_position[E_AXIS] + MMU_LOAD_FEEDRATE * 0.1;
|
current_position[E_AXIS] = current_position[E_AXIS] + MMU_LOAD_FEEDRATE * 0.1;
|
||||||
plan_buffer_line_curposXYZE(MMU_LOAD_FEEDRATE, active_extruder);
|
plan_buffer_line_curposXYZE(MMU_LOAD_FEEDRATE);
|
||||||
if (synchronize) st_synchronize();
|
if (synchronize) st_synchronize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -605,7 +605,7 @@ bool mmu_get_response(uint8_t move)
|
||||||
{
|
{
|
||||||
printf_P(PSTR("Unload 1\n"));
|
printf_P(PSTR("Unload 1\n"));
|
||||||
current_position[E_AXIS] = current_position[E_AXIS] - MMU_LOAD_FEEDRATE * MMU_LOAD_TIME_MS*0.001;
|
current_position[E_AXIS] = current_position[E_AXIS] - MMU_LOAD_FEEDRATE * MMU_LOAD_TIME_MS*0.001;
|
||||||
plan_buffer_line_curposXYZE(MMU_LOAD_FEEDRATE, active_extruder);
|
plan_buffer_line_curposXYZE(MMU_LOAD_FEEDRATE);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -623,7 +623,7 @@ bool mmu_get_response(uint8_t move)
|
||||||
{
|
{
|
||||||
printf_P(PSTR("Unload 2\n"));
|
printf_P(PSTR("Unload 2\n"));
|
||||||
current_position[E_AXIS] = current_position[E_AXIS] - MMU_LOAD_FEEDRATE * MMU_LOAD_TIME_MS*0.001;
|
current_position[E_AXIS] = current_position[E_AXIS] - MMU_LOAD_FEEDRATE * MMU_LOAD_TIME_MS*0.001;
|
||||||
plan_buffer_line_curposXYZE(MMU_LOAD_FEEDRATE, active_extruder);
|
plan_buffer_line_curposXYZE(MMU_LOAD_FEEDRATE);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -701,13 +701,13 @@ void manage_response(bool move_axes, bool turn_off_nozzle, uint8_t move)
|
||||||
//lift z
|
//lift z
|
||||||
current_position[Z_AXIS] += Z_PAUSE_LIFT;
|
current_position[Z_AXIS] += Z_PAUSE_LIFT;
|
||||||
if (current_position[Z_AXIS] > Z_MAX_POS) current_position[Z_AXIS] = Z_MAX_POS;
|
if (current_position[Z_AXIS] > Z_MAX_POS) current_position[Z_AXIS] = Z_MAX_POS;
|
||||||
plan_buffer_line_curposXYZE(15, active_extruder);
|
plan_buffer_line_curposXYZE(15);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
|
|
||||||
//Move XY to side
|
//Move XY to side
|
||||||
current_position[X_AXIS] = X_PAUSE_POS;
|
current_position[X_AXIS] = X_PAUSE_POS;
|
||||||
current_position[Y_AXIS] = Y_PAUSE_POS;
|
current_position[Y_AXIS] = Y_PAUSE_POS;
|
||||||
plan_buffer_line_curposXYZE(50, active_extruder);
|
plan_buffer_line_curposXYZE(50);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
}
|
}
|
||||||
if (turn_off_nozzle) {
|
if (turn_off_nozzle) {
|
||||||
|
|
@ -758,17 +758,17 @@ void manage_response(bool move_axes, bool turn_off_nozzle, uint8_t move)
|
||||||
lcd_display_message_fullscreen_P(_i("MMU OK. Resuming temperature..."));
|
lcd_display_message_fullscreen_P(_i("MMU OK. Resuming temperature..."));
|
||||||
delay_keep_alive(3000);
|
delay_keep_alive(3000);
|
||||||
}
|
}
|
||||||
mmu_wait_for_heater_blocking();
|
mmu_wait_for_heater_blocking();
|
||||||
}
|
}
|
||||||
if (move_axes) {
|
if (move_axes) {
|
||||||
lcd_clear();
|
lcd_clear();
|
||||||
lcd_display_message_fullscreen_P(_i("MMU OK. Resuming position..."));
|
lcd_display_message_fullscreen_P(_i("MMU OK. Resuming position..."));
|
||||||
current_position[X_AXIS] = x_position_bckp;
|
current_position[X_AXIS] = x_position_bckp;
|
||||||
current_position[Y_AXIS] = y_position_bckp;
|
current_position[Y_AXIS] = y_position_bckp;
|
||||||
plan_buffer_line_curposXYZE(50, active_extruder);
|
plan_buffer_line_curposXYZE(50);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
current_position[Z_AXIS] = z_position_bckp;
|
current_position[Z_AXIS] = z_position_bckp;
|
||||||
plan_buffer_line_curposXYZE(15, active_extruder);
|
plan_buffer_line_curposXYZE(15);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
@ -807,19 +807,19 @@ void mmu_load_to_nozzle()
|
||||||
current_position[E_AXIS] += 7.2f;
|
current_position[E_AXIS] += 7.2f;
|
||||||
}
|
}
|
||||||
float feedrate = 562;
|
float feedrate = 562;
|
||||||
plan_buffer_line_curposXYZE(feedrate / 60, active_extruder);
|
plan_buffer_line_curposXYZE(feedrate / 60);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
current_position[E_AXIS] += 14.4f;
|
current_position[E_AXIS] += 14.4f;
|
||||||
feedrate = 871;
|
feedrate = 871;
|
||||||
plan_buffer_line_curposXYZE(feedrate / 60, active_extruder);
|
plan_buffer_line_curposXYZE(feedrate / 60);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
current_position[E_AXIS] += 36.0f;
|
current_position[E_AXIS] += 36.0f;
|
||||||
feedrate = 1393;
|
feedrate = 1393;
|
||||||
plan_buffer_line_curposXYZE(feedrate / 60, active_extruder);
|
plan_buffer_line_curposXYZE(feedrate / 60);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
current_position[E_AXIS] += 14.4f;
|
current_position[E_AXIS] += 14.4f;
|
||||||
feedrate = 871;
|
feedrate = 871;
|
||||||
plan_buffer_line_curposXYZE(feedrate / 60, active_extruder);
|
plan_buffer_line_curposXYZE(feedrate / 60);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
if (!saved_e_relative_mode) axis_relative_modes &= ~E_AXIS_MASK;
|
if (!saved_e_relative_mode) axis_relative_modes &= ~E_AXIS_MASK;
|
||||||
}
|
}
|
||||||
|
|
@ -1072,7 +1072,7 @@ void mmu_filament_ramming()
|
||||||
for(uint8_t i = 0; i < (sizeof(ramming_sequence)/sizeof(E_step));++i)
|
for(uint8_t i = 0; i < (sizeof(ramming_sequence)/sizeof(E_step));++i)
|
||||||
{
|
{
|
||||||
current_position[E_AXIS] += pgm_read_float(&(ramming_sequence[i].extrude));
|
current_position[E_AXIS] += pgm_read_float(&(ramming_sequence[i].extrude));
|
||||||
plan_buffer_line_curposXYZE(pgm_read_float(&(ramming_sequence[i].feed_rate)), active_extruder);
|
plan_buffer_line_curposXYZE(pgm_read_float(&(ramming_sequence[i].feed_rate)));
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1446,9 +1446,9 @@ bFilamentAction=false; // NOT in "mmu_fil_eject_menu(
|
||||||
static bool can_load()
|
static bool can_load()
|
||||||
{
|
{
|
||||||
current_position[E_AXIS] += 60;
|
current_position[E_AXIS] += 60;
|
||||||
plan_buffer_line_curposXYZE(MMU_LOAD_FEEDRATE, active_extruder);
|
plan_buffer_line_curposXYZE(MMU_LOAD_FEEDRATE);
|
||||||
current_position[E_AXIS] -= 52;
|
current_position[E_AXIS] -= 52;
|
||||||
plan_buffer_line_curposXYZE(MMU_LOAD_FEEDRATE, active_extruder);
|
plan_buffer_line_curposXYZE(MMU_LOAD_FEEDRATE);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
|
|
||||||
uint_least8_t filament_detected_count = 0;
|
uint_least8_t filament_detected_count = 0;
|
||||||
|
|
@ -1458,7 +1458,7 @@ static bool can_load()
|
||||||
for(uint_least8_t i = 0; i < steps; ++i)
|
for(uint_least8_t i = 0; i < steps; ++i)
|
||||||
{
|
{
|
||||||
current_position[E_AXIS] -= e_increment;
|
current_position[E_AXIS] -= e_increment;
|
||||||
plan_buffer_line_curposXYZE(MMU_LOAD_FEEDRATE, active_extruder);
|
plan_buffer_line_curposXYZE(MMU_LOAD_FEEDRATE);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
if(0 == PIN_GET(IR_SENSOR_PIN))
|
if(0 == PIN_GET(IR_SENSOR_PIN))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -671,8 +671,16 @@ void planner_abort_hard()
|
||||||
waiting_inside_plan_buffer_line_print_aborted = true;
|
waiting_inside_plan_buffer_line_print_aborted = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void plan_buffer_line_curposXYZE(float feed_rate, uint8_t extruder) {
|
void plan_buffer_line_curposXYZE(float feed_rate) {
|
||||||
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], feed_rate, extruder );
|
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], feed_rate, active_extruder );
|
||||||
|
}
|
||||||
|
|
||||||
|
void plan_buffer_line_destinationXYZE(float feed_rate) {
|
||||||
|
plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feed_rate, active_extruder);
|
||||||
|
}
|
||||||
|
|
||||||
|
void plan_set_position_curposXYZE(){
|
||||||
|
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
||||||
}
|
}
|
||||||
|
|
||||||
float junction_deviation = 0.1;
|
float junction_deviation = 0.1;
|
||||||
|
|
|
||||||
|
|
@ -154,7 +154,11 @@ vector_3 plan_get_position();
|
||||||
/// plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], ...
|
/// plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], ...
|
||||||
/// saves almost 5KB.
|
/// saves almost 5KB.
|
||||||
/// The performance penalty is negligible, since these planned lines are usually maintenance moves with the extruder.
|
/// The performance penalty is negligible, since these planned lines are usually maintenance moves with the extruder.
|
||||||
void plan_buffer_line_curposXYZE(float feed_rate, uint8_t extruder);
|
void plan_buffer_line_curposXYZE(float feed_rate);
|
||||||
|
|
||||||
|
void plan_buffer_line_destinationXYZE(float feed_rate);
|
||||||
|
|
||||||
|
void plan_set_position_curposXYZE();
|
||||||
|
|
||||||
void plan_buffer_line(float x, float y, float z, const float &e, float feed_rate, uint8_t extruder, const float* gcode_target = NULL);
|
void plan_buffer_line(float x, float y, float z, const float &e, float feed_rate, uint8_t extruder, const float* gcode_target = NULL);
|
||||||
//void plan_buffer_line(const float &x, const float &y, const float &z, const float &e, float feed_rate, const uint8_t &extruder);
|
//void plan_buffer_line(const float &x, const float &y, const float &z, const float &e, float feed_rate, const uint8_t &extruder);
|
||||||
|
|
|
||||||
|
|
@ -2919,7 +2919,7 @@ static void _lcd_move(const char *name, int axis, int min, int max)
|
||||||
if (max_software_endstops && current_position[axis] > max) current_position[axis] = max;
|
if (max_software_endstops && current_position[axis] > max) current_position[axis] = max;
|
||||||
lcd_encoder = 0;
|
lcd_encoder = 0;
|
||||||
world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]);
|
world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]);
|
||||||
plan_buffer_line_curposXYZE(manual_feedrate[axis] / 60, active_extruder);
|
plan_buffer_line_curposXYZE(manual_feedrate[axis] / 60);
|
||||||
lcd_draw_update = 1;
|
lcd_draw_update = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2944,7 +2944,7 @@ static void lcd_move_e()
|
||||||
{
|
{
|
||||||
current_position[E_AXIS] += float((int)lcd_encoder) * move_menu_scale;
|
current_position[E_AXIS] += float((int)lcd_encoder) * move_menu_scale;
|
||||||
lcd_encoder = 0;
|
lcd_encoder = 0;
|
||||||
plan_buffer_line_curposXYZE(manual_feedrate[E_AXIS] / 60, active_extruder);
|
plan_buffer_line_curposXYZE(manual_feedrate[E_AXIS] / 60);
|
||||||
lcd_draw_update = 1;
|
lcd_draw_update = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -3462,7 +3462,7 @@ bool lcd_calibrate_z_end_stop_manual(bool only_z)
|
||||||
{
|
{
|
||||||
// Don't know where we are. Let's claim we are Z=0, so the soft end stops will not be triggered when moving up.
|
// Don't know where we are. Let's claim we are Z=0, so the soft end stops will not be triggered when moving up.
|
||||||
current_position[Z_AXIS] = 0;
|
current_position[Z_AXIS] = 0;
|
||||||
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
plan_set_position_curposXYZE();
|
||||||
|
|
||||||
// Until confirmed by the confirmation dialog.
|
// Until confirmed by the confirmation dialog.
|
||||||
for (;;) {
|
for (;;) {
|
||||||
|
|
@ -3484,7 +3484,7 @@ bool lcd_calibrate_z_end_stop_manual(bool only_z)
|
||||||
// Only move up, whatever direction the user rotates the encoder.
|
// Only move up, whatever direction the user rotates the encoder.
|
||||||
current_position[Z_AXIS] += fabs(lcd_encoder);
|
current_position[Z_AXIS] += fabs(lcd_encoder);
|
||||||
lcd_encoder = 0;
|
lcd_encoder = 0;
|
||||||
plan_buffer_line_curposXYZE(manual_feedrate[Z_AXIS] / 60, active_extruder);
|
plan_buffer_line_curposXYZE(manual_feedrate[Z_AXIS] / 60);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (lcd_clicked()) {
|
if (lcd_clicked()) {
|
||||||
|
|
@ -3520,7 +3520,7 @@ calibrated:
|
||||||
else {
|
else {
|
||||||
current_position[Z_AXIS] = Z_MAX_POS+4.f;
|
current_position[Z_AXIS] = Z_MAX_POS+4.f;
|
||||||
}
|
}
|
||||||
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
plan_set_position_curposXYZE();
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
canceled:
|
canceled:
|
||||||
|
|
@ -4038,7 +4038,7 @@ void prusa_statistics_err(char c){
|
||||||
}
|
}
|
||||||
|
|
||||||
static void prusa_statistics_case0(uint8_t statnr){
|
static void prusa_statistics_case0(uint8_t statnr){
|
||||||
SERIAL_ECHO("{");
|
SERIAL_ECHO('{');
|
||||||
prusa_stat_printerstatus(statnr);
|
prusa_stat_printerstatus(statnr);
|
||||||
prusa_stat_farm_number();
|
prusa_stat_farm_number();
|
||||||
prusa_stat_printinfo();
|
prusa_stat_printinfo();
|
||||||
|
|
@ -4066,7 +4066,7 @@ void prusa_statistics(int _message, uint8_t _fil_nr) {
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SERIAL_ECHO("{");
|
SERIAL_ECHO('{');
|
||||||
prusa_stat_printerstatus(1);
|
prusa_stat_printerstatus(1);
|
||||||
prusa_stat_farm_number();
|
prusa_stat_farm_number();
|
||||||
prusa_stat_diameter();
|
prusa_stat_diameter();
|
||||||
|
|
@ -4899,7 +4899,7 @@ void lcd_language()
|
||||||
static void wait_preheat()
|
static void wait_preheat()
|
||||||
{
|
{
|
||||||
current_position[Z_AXIS] = 100; //move in z axis to make space for loading filament
|
current_position[Z_AXIS] = 100; //move in z axis to make space for loading filament
|
||||||
plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 60, active_extruder);
|
plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 60);
|
||||||
delay_keep_alive(2000);
|
delay_keep_alive(2000);
|
||||||
lcd_display_message_fullscreen_P(_T(MSG_WIZARD_HEATING));
|
lcd_display_message_fullscreen_P(_T(MSG_WIZARD_HEATING));
|
||||||
lcd_set_custom_characters();
|
lcd_set_custom_characters();
|
||||||
|
|
@ -6387,13 +6387,13 @@ void unload_filament()
|
||||||
// extr_unload2();
|
// extr_unload2();
|
||||||
|
|
||||||
current_position[E_AXIS] -= 45;
|
current_position[E_AXIS] -= 45;
|
||||||
plan_buffer_line_curposXYZE(5200 / 60, active_extruder);
|
plan_buffer_line_curposXYZE(5200 / 60);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
current_position[E_AXIS] -= 15;
|
current_position[E_AXIS] -= 15;
|
||||||
plan_buffer_line_curposXYZE(1000 / 60, active_extruder);
|
plan_buffer_line_curposXYZE(1000 / 60);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
current_position[E_AXIS] -= 20;
|
current_position[E_AXIS] -= 20;
|
||||||
plan_buffer_line_curposXYZE(1000 / 60, active_extruder);
|
plan_buffer_line_curposXYZE(1000 / 60);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
|
|
||||||
lcd_display_message_fullscreen_P(_T(MSG_PULL_OUT_FILAMENT));
|
lcd_display_message_fullscreen_P(_T(MSG_PULL_OUT_FILAMENT));
|
||||||
|
|
@ -7353,13 +7353,13 @@ void lcd_print_stop()
|
||||||
cancel_heatup = true; //unroll temperature wait loop stack.
|
cancel_heatup = true; //unroll temperature wait loop stack.
|
||||||
|
|
||||||
current_position[Z_AXIS] += 10; //lift Z.
|
current_position[Z_AXIS] += 10; //lift Z.
|
||||||
plan_buffer_line_curposXYZE(manual_feedrate[Z_AXIS] / 60, active_extruder);
|
plan_buffer_line_curposXYZE(manual_feedrate[Z_AXIS] / 60);
|
||||||
|
|
||||||
if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]) //if axis are homed, move to parked position.
|
if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]) //if axis are homed, move to parked position.
|
||||||
{
|
{
|
||||||
current_position[X_AXIS] = X_CANCEL_POS;
|
current_position[X_AXIS] = X_CANCEL_POS;
|
||||||
current_position[Y_AXIS] = Y_CANCEL_POS;
|
current_position[Y_AXIS] = Y_CANCEL_POS;
|
||||||
plan_buffer_line_curposXYZE(manual_feedrate[0] / 60, active_extruder);
|
plan_buffer_line_curposXYZE(manual_feedrate[0] / 60);
|
||||||
}
|
}
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
|
|
||||||
|
|
@ -7713,7 +7713,7 @@ bool lcd_selftest()
|
||||||
current_position[Y_AXIS] += 4;
|
current_position[Y_AXIS] += 4;
|
||||||
#endif //TMC2130
|
#endif //TMC2130
|
||||||
current_position[Z_AXIS] = current_position[Z_AXIS] + 10;
|
current_position[Z_AXIS] = current_position[Z_AXIS] + 10;
|
||||||
plan_buffer_line_curposXYZE(manual_feedrate[0] / 60, active_extruder);
|
plan_buffer_line_curposXYZE(manual_feedrate[0] / 60);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
set_destination_to_current();
|
set_destination_to_current();
|
||||||
_progress = lcd_selftest_screen(TestScreen::AxisZ, _progress, 3, true, 1500);
|
_progress = lcd_selftest_screen(TestScreen::AxisZ, _progress, 3, true, 1500);
|
||||||
|
|
@ -7725,7 +7725,7 @@ bool lcd_selftest()
|
||||||
|
|
||||||
//raise Z to not damage the bed during and hotend testing
|
//raise Z to not damage the bed during and hotend testing
|
||||||
current_position[Z_AXIS] += 20;
|
current_position[Z_AXIS] += 20;
|
||||||
plan_buffer_line_curposXYZE(manual_feedrate[0] / 60, active_extruder);
|
plan_buffer_line_curposXYZE(manual_feedrate[0] / 60);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -7733,7 +7733,7 @@ bool lcd_selftest()
|
||||||
if (_result)
|
if (_result)
|
||||||
{
|
{
|
||||||
current_position[Z_AXIS] = current_position[Z_AXIS] + 10;
|
current_position[Z_AXIS] = current_position[Z_AXIS] + 10;
|
||||||
plan_buffer_line_curposXYZE(manual_feedrate[0] / 60, active_extruder);
|
plan_buffer_line_curposXYZE(manual_feedrate[0] / 60);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
_progress = lcd_selftest_screen(TestScreen::Home, 0, 2, true, 0);
|
_progress = lcd_selftest_screen(TestScreen::Home, 0, 2, true, 0);
|
||||||
bool bres = tmc2130_home_calibrate(X_AXIS);
|
bool bres = tmc2130_home_calibrate(X_AXIS);
|
||||||
|
|
@ -7829,7 +7829,7 @@ bool lcd_selftest()
|
||||||
|
|
||||||
static void reset_crash_det(unsigned char axis) {
|
static void reset_crash_det(unsigned char axis) {
|
||||||
current_position[axis] += 10;
|
current_position[axis] += 10;
|
||||||
plan_buffer_line_curposXYZE(manual_feedrate[0] / 60, active_extruder);
|
plan_buffer_line_curposXYZE(manual_feedrate[0] / 60);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
if (eeprom_read_byte((uint8_t*)EEPROM_CRASH_DET)) tmc2130_sg_stop_on_crash = true;
|
if (eeprom_read_byte((uint8_t*)EEPROM_CRASH_DET)) tmc2130_sg_stop_on_crash = true;
|
||||||
}
|
}
|
||||||
|
|
@ -7858,7 +7858,7 @@ static bool lcd_selfcheck_axis_sg(unsigned char axis) {
|
||||||
// first axis length measurement begin
|
// first axis length measurement begin
|
||||||
|
|
||||||
current_position[axis] -= (axis_length + margin);
|
current_position[axis] -= (axis_length + margin);
|
||||||
plan_buffer_line_curposXYZE(manual_feedrate[0] / 60, active_extruder);
|
plan_buffer_line_curposXYZE(manual_feedrate[0] / 60);
|
||||||
|
|
||||||
|
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
|
|
@ -7868,11 +7868,11 @@ static bool lcd_selfcheck_axis_sg(unsigned char axis) {
|
||||||
current_position_init = st_get_position_mm(axis);
|
current_position_init = st_get_position_mm(axis);
|
||||||
|
|
||||||
current_position[axis] += 2 * margin;
|
current_position[axis] += 2 * margin;
|
||||||
plan_buffer_line_curposXYZE(manual_feedrate[0] / 60, active_extruder);
|
plan_buffer_line_curposXYZE(manual_feedrate[0] / 60);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
|
|
||||||
current_position[axis] += axis_length;
|
current_position[axis] += axis_length;
|
||||||
plan_buffer_line_curposXYZE(manual_feedrate[0] / 60, active_extruder);
|
plan_buffer_line_curposXYZE(manual_feedrate[0] / 60);
|
||||||
|
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
|
|
||||||
|
|
@ -7888,11 +7888,11 @@ static bool lcd_selfcheck_axis_sg(unsigned char axis) {
|
||||||
|
|
||||||
|
|
||||||
current_position[axis] -= margin;
|
current_position[axis] -= margin;
|
||||||
plan_buffer_line_curposXYZE(manual_feedrate[0] / 60, active_extruder);
|
plan_buffer_line_curposXYZE(manual_feedrate[0] / 60);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
|
|
||||||
current_position[axis] -= (axis_length + margin);
|
current_position[axis] -= (axis_length + margin);
|
||||||
plan_buffer_line_curposXYZE(manual_feedrate[0] / 60, active_extruder);
|
plan_buffer_line_curposXYZE(manual_feedrate[0] / 60);
|
||||||
|
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
|
|
||||||
|
|
@ -7917,7 +7917,7 @@ static bool lcd_selfcheck_axis_sg(unsigned char axis) {
|
||||||
|
|
||||||
lcd_selftest_error(TestError::Axis, _error_1, "");
|
lcd_selftest_error(TestError::Axis, _error_1, "");
|
||||||
current_position[axis] = 0;
|
current_position[axis] = 0;
|
||||||
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
plan_set_position_curposXYZE();
|
||||||
reset_crash_det(axis);
|
reset_crash_det(axis);
|
||||||
enable_endstops(true);
|
enable_endstops(true);
|
||||||
endstops_hit_on_purpose();
|
endstops_hit_on_purpose();
|
||||||
|
|
@ -7937,13 +7937,13 @@ static bool lcd_selfcheck_axis_sg(unsigned char axis) {
|
||||||
|
|
||||||
lcd_selftest_error(TestError::Pulley, _error_1, "");
|
lcd_selftest_error(TestError::Pulley, _error_1, "");
|
||||||
current_position[axis] = 0;
|
current_position[axis] = 0;
|
||||||
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
plan_set_position_curposXYZE();
|
||||||
reset_crash_det(axis);
|
reset_crash_det(axis);
|
||||||
endstops_hit_on_purpose();
|
endstops_hit_on_purpose();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
current_position[axis] = 0;
|
current_position[axis] = 0;
|
||||||
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
plan_set_position_curposXYZE();
|
||||||
reset_crash_det(axis);
|
reset_crash_det(axis);
|
||||||
endstops_hit_on_purpose();
|
endstops_hit_on_purpose();
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -7965,13 +7965,13 @@ static bool lcd_selfcheck_axis(int _axis, int _travel)
|
||||||
|
|
||||||
if (_axis == X_AXIS) {
|
if (_axis == X_AXIS) {
|
||||||
current_position[Z_AXIS] += 17;
|
current_position[Z_AXIS] += 17;
|
||||||
plan_buffer_line_curposXYZE(manual_feedrate[0] / 60, active_extruder);
|
plan_buffer_line_curposXYZE(manual_feedrate[0] / 60);
|
||||||
}
|
}
|
||||||
|
|
||||||
do {
|
do {
|
||||||
current_position[_axis] = current_position[_axis] - 1;
|
current_position[_axis] = current_position[_axis] - 1;
|
||||||
|
|
||||||
plan_buffer_line_curposXYZE(manual_feedrate[0] / 60, active_extruder);
|
plan_buffer_line_curposXYZE(manual_feedrate[0] / 60);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
#ifdef TMC2130
|
#ifdef TMC2130
|
||||||
if ((READ(Z_MIN_PIN) ^ (bool)Z_MIN_ENDSTOP_INVERTING))
|
if ((READ(Z_MIN_PIN) ^ (bool)Z_MIN_ENDSTOP_INVERTING))
|
||||||
|
|
@ -8051,7 +8051,7 @@ static bool lcd_selfcheck_axis(int _axis, int _travel)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
current_position[_axis] = 0; //simulate axis home to avoid negative numbers for axis position, especially Z.
|
current_position[_axis] = 0; //simulate axis home to avoid negative numbers for axis position, especially Z.
|
||||||
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
plan_set_position_curposXYZE();
|
||||||
|
|
||||||
return _stepresult;
|
return _stepresult;
|
||||||
}
|
}
|
||||||
|
|
@ -8074,17 +8074,17 @@ static bool lcd_selfcheck_pulleys(int axis)
|
||||||
current_position_init = current_position[axis];
|
current_position_init = current_position[axis];
|
||||||
|
|
||||||
current_position[axis] += 2;
|
current_position[axis] += 2;
|
||||||
plan_buffer_line_curposXYZE(manual_feedrate[0] / 60, active_extruder);
|
plan_buffer_line_curposXYZE(manual_feedrate[0] / 60);
|
||||||
for (i = 0; i < 5; i++) {
|
for (i = 0; i < 5; i++) {
|
||||||
refresh_cmd_timeout();
|
refresh_cmd_timeout();
|
||||||
current_position[axis] = current_position[axis] + move;
|
current_position[axis] = current_position[axis] + move;
|
||||||
st_current_set(0, 850); //set motor current higher
|
st_current_set(0, 850); //set motor current higher
|
||||||
plan_buffer_line_curposXYZE(200, active_extruder);
|
plan_buffer_line_curposXYZE(200);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
if (SilentModeMenu != SILENT_MODE_OFF) st_current_set(0, tmp_motor[0]); //set back to normal operation currents
|
if (SilentModeMenu != SILENT_MODE_OFF) st_current_set(0, tmp_motor[0]); //set back to normal operation currents
|
||||||
else st_current_set(0, tmp_motor_loud[0]); //set motor current back
|
else st_current_set(0, tmp_motor_loud[0]); //set motor current back
|
||||||
current_position[axis] = current_position[axis] - move;
|
current_position[axis] = current_position[axis] - move;
|
||||||
plan_buffer_line_curposXYZE(50, active_extruder);
|
plan_buffer_line_curposXYZE(50);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
if (((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) ||
|
if (((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) ||
|
||||||
((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1)) {
|
((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1)) {
|
||||||
|
|
@ -8101,7 +8101,7 @@ static bool lcd_selfcheck_pulleys(int axis)
|
||||||
endstop_triggered = true;
|
endstop_triggered = true;
|
||||||
if (current_position_init - 1 <= current_position[axis] && current_position_init + 1 >= current_position[axis]) {
|
if (current_position_init - 1 <= current_position[axis] && current_position_init + 1 >= current_position[axis]) {
|
||||||
current_position[axis] += 10;
|
current_position[axis] += 10;
|
||||||
plan_buffer_line_curposXYZE(manual_feedrate[0] / 60, active_extruder);
|
plan_buffer_line_curposXYZE(manual_feedrate[0] / 60);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
return(true);
|
return(true);
|
||||||
}
|
}
|
||||||
|
|
@ -8112,7 +8112,7 @@ static bool lcd_selfcheck_pulleys(int axis)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
current_position[axis] -= 1;
|
current_position[axis] -= 1;
|
||||||
plan_buffer_line_curposXYZE(manual_feedrate[0] / 60, active_extruder);
|
plan_buffer_line_curposXYZE(manual_feedrate[0] / 60);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
if (_millis() > timeout_counter) {
|
if (_millis() > timeout_counter) {
|
||||||
lcd_selftest_error(TestError::Pulley, (axis == 0) ? "X" : "Y", "");
|
lcd_selftest_error(TestError::Pulley, (axis == 0) ? "X" : "Y", "");
|
||||||
|
|
@ -8142,7 +8142,7 @@ static bool lcd_selfcheck_endstops()
|
||||||
#endif //!TMC2130
|
#endif //!TMC2130
|
||||||
if ((READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING) == 1) current_position[2] += 10;
|
if ((READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING) == 1) current_position[2] += 10;
|
||||||
}
|
}
|
||||||
plan_buffer_line_curposXYZE(manual_feedrate[0] / 60, active_extruder);
|
plan_buffer_line_curposXYZE(manual_feedrate[0] / 60);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
|
@ -8653,7 +8653,7 @@ static FanCheck lcd_selftest_fan_auto(int _fan)
|
||||||
static int lcd_selftest_screen(TestScreen screen, int _progress, int _progress_scale, bool _clear, int _delay)
|
static int lcd_selftest_screen(TestScreen screen, int _progress, int _progress_scale, bool _clear, int _delay)
|
||||||
{
|
{
|
||||||
|
|
||||||
lcd_update_enable(false);
|
lcd_update_enable(false);
|
||||||
|
|
||||||
const char *_indicator = (_progress >= _progress_scale) ? "-" : "|";
|
const char *_indicator = (_progress >= _progress_scale) ? "-" : "|";
|
||||||
|
|
||||||
|
|
@ -8701,7 +8701,7 @@ static int lcd_selftest_screen(TestScreen screen, int _progress, int _progress_s
|
||||||
{
|
{
|
||||||
//SERIAL_ECHOLNPGM("Other tests");
|
//SERIAL_ECHOLNPGM("Other tests");
|
||||||
|
|
||||||
TestScreen _step_block = TestScreen::AxisX;
|
TestScreen _step_block = TestScreen::AxisX;
|
||||||
lcd_selftest_screen_step(2, 2, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), "X", _indicator);
|
lcd_selftest_screen_step(2, 2, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), "X", _indicator);
|
||||||
|
|
||||||
_step_block = TestScreen::AxisY;
|
_step_block = TestScreen::AxisY;
|
||||||
|
|
@ -8713,8 +8713,8 @@ static int lcd_selftest_screen(TestScreen screen, int _progress, int _progress_s
|
||||||
_step_block = TestScreen::Bed;
|
_step_block = TestScreen::Bed;
|
||||||
lcd_selftest_screen_step(3, 0, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), "Bed", _indicator);
|
lcd_selftest_screen_step(3, 0, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), "Bed", _indicator);
|
||||||
|
|
||||||
_step_block = TestScreen::Hotend;
|
_step_block = TestScreen::Hotend;
|
||||||
lcd_selftest_screen_step(3, 9, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), "Hotend", _indicator);
|
lcd_selftest_screen_step(3, 9, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), "Hotend", _indicator);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_delay > 0) delay_keep_alive(_delay);
|
if (_delay > 0) delay_keep_alive(_delay);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue