PROBE_MANUALLY etc.
This commit is contained in:
@@ -225,7 +225,7 @@ void MarlinSettings::postprocess() {
|
||||
// Make sure delta kinematics are updated before refreshing the
|
||||
// planner position so the stepper counts will be set correctly.
|
||||
#if ENABLED(DELTA)
|
||||
recalc_delta_settings(delta_radius, delta_diagonal_rod, delta_tower_angle_trim);
|
||||
recalc_delta_settings();
|
||||
#endif
|
||||
|
||||
// Refresh steps_to_mm with the reciprocal of axis_steps_per_mm
|
||||
|
@@ -56,18 +56,20 @@ float delta_safe_distance_from_top();
|
||||
* Recalculate factors used for delta kinematics whenever
|
||||
* settings have been changed (e.g., by M665).
|
||||
*/
|
||||
void recalc_delta_settings(const float radius, const float diagonal_rod, const float tower_angle_trim[ABC]) {
|
||||
void recalc_delta_settings() {
|
||||
const float trt[ABC] = DELTA_RADIUS_TRIM_TOWER,
|
||||
drt[ABC] = DELTA_DIAGONAL_ROD_TRIM_TOWER;
|
||||
delta_tower[A_AXIS][X_AXIS] = cos(RADIANS(210 + tower_angle_trim[A_AXIS])) * (radius + trt[A_AXIS]); // front left tower
|
||||
delta_tower[A_AXIS][Y_AXIS] = sin(RADIANS(210 + tower_angle_trim[A_AXIS])) * (radius + trt[A_AXIS]);
|
||||
delta_tower[B_AXIS][X_AXIS] = cos(RADIANS(330 + tower_angle_trim[B_AXIS])) * (radius + trt[B_AXIS]); // front right tower
|
||||
delta_tower[B_AXIS][Y_AXIS] = sin(RADIANS(330 + tower_angle_trim[B_AXIS])) * (radius + trt[B_AXIS]);
|
||||
delta_tower[C_AXIS][X_AXIS] = cos(RADIANS( 90 + tower_angle_trim[C_AXIS])) * (radius + trt[C_AXIS]); // back middle tower
|
||||
delta_tower[C_AXIS][Y_AXIS] = sin(RADIANS( 90 + tower_angle_trim[C_AXIS])) * (radius + trt[C_AXIS]);
|
||||
delta_diagonal_rod_2_tower[A_AXIS] = sq(diagonal_rod + drt[A_AXIS]);
|
||||
delta_diagonal_rod_2_tower[B_AXIS] = sq(diagonal_rod + drt[B_AXIS]);
|
||||
delta_diagonal_rod_2_tower[C_AXIS] = sq(diagonal_rod + drt[C_AXIS]);
|
||||
delta_tower[A_AXIS][X_AXIS] = cos(RADIANS(210 + delta_tower_angle_trim[A_AXIS])) * (delta_radius + trt[A_AXIS]); // front left tower
|
||||
delta_tower[A_AXIS][Y_AXIS] = sin(RADIANS(210 + delta_tower_angle_trim[A_AXIS])) * (delta_radius + trt[A_AXIS]);
|
||||
delta_tower[B_AXIS][X_AXIS] = cos(RADIANS(330 + delta_tower_angle_trim[B_AXIS])) * (delta_radius + trt[B_AXIS]); // front right tower
|
||||
delta_tower[B_AXIS][Y_AXIS] = sin(RADIANS(330 + delta_tower_angle_trim[B_AXIS])) * (delta_radius + trt[B_AXIS]);
|
||||
delta_tower[C_AXIS][X_AXIS] = cos(RADIANS( 90 + delta_tower_angle_trim[C_AXIS])) * (delta_radius + trt[C_AXIS]); // back middle tower
|
||||
delta_tower[C_AXIS][Y_AXIS] = sin(RADIANS( 90 + delta_tower_angle_trim[C_AXIS])) * (delta_radius + trt[C_AXIS]);
|
||||
delta_diagonal_rod_2_tower[A_AXIS] = sq(delta_diagonal_rod + drt[A_AXIS]);
|
||||
delta_diagonal_rod_2_tower[B_AXIS] = sq(delta_diagonal_rod + drt[B_AXIS]);
|
||||
delta_diagonal_rod_2_tower[C_AXIS] = sq(delta_diagonal_rod + drt[C_AXIS]);
|
||||
update_software_endstops(Z_AXIS);
|
||||
axis_homed[X_AXIS] = axis_homed[Y_AXIS] = axis_homed[Z_AXIS] = false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -43,7 +43,7 @@ extern float delta_tower[ABC][2],
|
||||
* Recalculate factors used for delta kinematics whenever
|
||||
* settings have been changed (e.g., by M665).
|
||||
*/
|
||||
void recalc_delta_settings(const float radius, const float diagonal_rod, const float tower_angle_trim[ABC]);
|
||||
void recalc_delta_settings();
|
||||
|
||||
/**
|
||||
* Delta Inverse Kinematics
|
||||
|
@@ -509,10 +509,9 @@ static bool do_probe_move(const float z, const float fr_mm_m) {
|
||||
* @details Used by probe_pt to do a single Z probe.
|
||||
* Leaves current_position[Z_AXIS] at the height where the probe triggered.
|
||||
*
|
||||
* @param short_move Flag for a shorter probe move towards the bed
|
||||
* @return The raw Z position where the probe was triggered
|
||||
*/
|
||||
static float run_z_probe(const bool short_move=true) {
|
||||
static float run_z_probe() {
|
||||
|
||||
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
||||
if (DEBUGGING(LEVELING)) DEBUG_POS(">>> run_z_probe", current_position);
|
||||
@@ -549,8 +548,8 @@ static float run_z_probe(const bool short_move=true) {
|
||||
}
|
||||
#endif
|
||||
|
||||
// move down slowly to find bed
|
||||
if (do_probe_move(-10 + (short_move ? 0 : -(Z_MAX_LENGTH)), Z_PROBE_SPEED_SLOW)) return NAN;
|
||||
// Move down slowly to find bed, not too far
|
||||
if (do_probe_move(-10, Z_PROBE_SPEED_SLOW)) return NAN;
|
||||
|
||||
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
||||
if (DEBUGGING(LEVELING)) DEBUG_POS("<<< run_z_probe", current_position);
|
||||
@@ -589,12 +588,11 @@ float probe_pt(const float &rx, const float &ry, const bool stow, const uint8_t
|
||||
|
||||
const float nx = rx - (X_PROBE_OFFSET_FROM_EXTRUDER), ny = ry - (Y_PROBE_OFFSET_FROM_EXTRUDER);
|
||||
|
||||
if (printable
|
||||
if (!printable
|
||||
? !position_is_reachable(nx, ny)
|
||||
: !position_is_reachable_by_probe(rx, ry)
|
||||
) return NAN;
|
||||
|
||||
|
||||
const float old_feedrate_mm_s = feedrate_mm_s;
|
||||
|
||||
#if ENABLED(DELTA)
|
||||
@@ -602,12 +600,6 @@ float probe_pt(const float &rx, const float &ry, const bool stow, const uint8_t
|
||||
do_blocking_move_to_z(delta_clip_start_height);
|
||||
#endif
|
||||
|
||||
#if HAS_SOFTWARE_ENDSTOPS
|
||||
// Store the status of the soft endstops and disable if we're probing a non-printable location
|
||||
static bool enable_soft_endstops = soft_endstops_enabled;
|
||||
if (!printable) soft_endstops_enabled = false;
|
||||
#endif
|
||||
|
||||
feedrate_mm_s = XY_PROBE_FEEDRATE_MM_S;
|
||||
|
||||
// Move the probe to the given XY
|
||||
@@ -615,7 +607,7 @@ float probe_pt(const float &rx, const float &ry, const bool stow, const uint8_t
|
||||
|
||||
float measured_z = NAN;
|
||||
if (!DEPLOY_PROBE()) {
|
||||
measured_z = run_z_probe(printable);
|
||||
measured_z = run_z_probe();
|
||||
|
||||
if (!stow)
|
||||
do_blocking_move_to_z(current_position[Z_AXIS] + Z_CLEARANCE_BETWEEN_PROBES, MMM_TO_MMS(Z_PROBE_SPEED_FAST));
|
||||
@@ -623,11 +615,6 @@ float probe_pt(const float &rx, const float &ry, const bool stow, const uint8_t
|
||||
if (STOW_PROBE()) measured_z = NAN;
|
||||
}
|
||||
|
||||
#if HAS_SOFTWARE_ENDSTOPS
|
||||
// Restore the soft endstop status
|
||||
soft_endstops_enabled = enable_soft_endstops;
|
||||
#endif
|
||||
|
||||
if (verbose_level > 2) {
|
||||
SERIAL_PROTOCOLPGM("Bed X: ");
|
||||
SERIAL_PROTOCOL_F(LOGICAL_X_POSITION(rx), 3);
|
||||
|
Reference in New Issue
Block a user