mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2024-11-25 16:47:29 +08:00
Merge 4831ff8050
into 220cd5a640
This commit is contained in:
commit
b7001ee106
@ -375,18 +375,16 @@ void GcodeSuite::G28() {
|
||||
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("R0 = No Z raise");
|
||||
}
|
||||
else {
|
||||
bool with_probe = ENABLED(HOMING_Z_WITH_PROBE);
|
||||
// Raise above the current Z (which should be synced in the planner)
|
||||
// The "height" for Z is a coordinate. But if Z is not trusted/homed make it relative.
|
||||
if (seenR || !(z_min_trusted || axis_should_home(Z_AXIS))) {
|
||||
z_homing_height += current_position.z;
|
||||
with_probe = false;
|
||||
}
|
||||
|
||||
if (may_skate) {
|
||||
// Apply Z clearance before doing any lateral motion
|
||||
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Raise Z before homing:");
|
||||
do_z_clearance(z_homing_height, with_probe);
|
||||
do_z_clearance(z_homing_height);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1289,10 +1289,8 @@ void do_blocking_move_to(const xyze_pos_t &raw, const_feedRate_t fr_mm_s/*=0.0f*
|
||||
* - If lowering is not allowed then skip a downward move
|
||||
* - Execute the move at the probing (or homing) feedrate
|
||||
*/
|
||||
void do_z_clearance(const_float_t zclear, const bool with_probe/*=true*/, const bool lower_allowed/*=false*/) {
|
||||
UNUSED(with_probe);
|
||||
void do_z_clearance(const_float_t zclear, const bool lower_allowed/*=false*/) {
|
||||
float zdest = zclear;
|
||||
TERN_(HAS_BED_PROBE, if (with_probe && probe.offset.z < 0) zdest -= probe.offset.z);
|
||||
NOMORE(zdest, Z_MAX_POS);
|
||||
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("do_z_clearance(", zclear, " [", current_position.z, " to ", zdest, "], ", lower_allowed, ")");
|
||||
if ((!lower_allowed && zdest < current_position.z) || zdest == current_position.z) return;
|
||||
@ -1300,7 +1298,7 @@ void do_blocking_move_to(const xyze_pos_t &raw, const_feedRate_t fr_mm_s/*=0.0f*
|
||||
}
|
||||
void do_z_clearance_by(const_float_t zclear) {
|
||||
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("do_z_clearance_by(", zclear, ")");
|
||||
do_z_clearance(current_position.z + zclear, false);
|
||||
do_z_clearance(current_position.z + zclear);
|
||||
}
|
||||
/**
|
||||
* Move Z to Z_POST_CLEARANCE,
|
||||
@ -1309,7 +1307,7 @@ void do_blocking_move_to(const xyze_pos_t &raw, const_feedRate_t fr_mm_s/*=0.0f*
|
||||
void do_move_after_z_homing() {
|
||||
DEBUG_SECTION(mzah, "do_move_after_z_homing", DEBUGGING(LEVELING));
|
||||
#ifdef Z_POST_CLEARANCE
|
||||
do_z_clearance(Z_POST_CLEARANCE, true, true);
|
||||
do_z_clearance(Z_POST_CLEARANCE, true);
|
||||
#elif ENABLED(USE_PROBE_FOR_Z_HOMING)
|
||||
probe.move_z_after_probing();
|
||||
#endif
|
||||
|
@ -423,12 +423,12 @@ void restore_feedrate_and_scaling();
|
||||
#define Z_POST_CLEARANCE Z_CLEARANCE_FOR_HOMING
|
||||
#endif
|
||||
#endif
|
||||
void do_z_clearance(const_float_t zclear, const bool with_probe=true, const bool lower_allowed=false);
|
||||
void do_z_clearance(const_float_t zclear, const bool lower_allowed=false);
|
||||
void do_z_clearance_by(const_float_t zclear);
|
||||
void do_move_after_z_homing();
|
||||
inline void do_z_post_clearance() { do_z_clearance(Z_POST_CLEARANCE); }
|
||||
#else
|
||||
inline void do_z_clearance(float, bool=true, bool=false) {}
|
||||
inline void do_z_clearance(float, bool=false) {}
|
||||
inline void do_z_clearance_by(float) {}
|
||||
#endif
|
||||
|
||||
|
@ -796,7 +796,7 @@ float Probe::run_z_probe(const bool sanity_check/*=true*/, const_float_t z_min_p
|
||||
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("1st Probe Z:", z1);
|
||||
|
||||
// Raise to give the probe clearance
|
||||
do_z_clearance(z1 + (Z_CLEARANCE_MULTI_PROBE), false);
|
||||
do_z_clearance(z1 + (Z_CLEARANCE_MULTI_PROBE));
|
||||
|
||||
#elif Z_PROBE_FEEDRATE_FAST != Z_PROBE_FEEDRATE_SLOW
|
||||
|
||||
@ -857,7 +857,7 @@ float Probe::run_z_probe(const bool sanity_check/*=true*/, const_float_t z_min_p
|
||||
#if EXTRA_PROBING > 0
|
||||
< TOTAL_PROBING - 1
|
||||
#endif
|
||||
) do_z_clearance(z + (Z_CLEARANCE_MULTI_PROBE), false);
|
||||
) do_z_clearance(z + (Z_CLEARANCE_MULTI_PROBE));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -211,7 +211,7 @@ public:
|
||||
static void move_z_after_probing() {
|
||||
DEBUG_SECTION(mzah, "move_z_after_probing", DEBUGGING(LEVELING));
|
||||
#ifdef Z_AFTER_PROBING
|
||||
do_z_clearance(Z_AFTER_PROBING, true, true); // Move down still permitted
|
||||
do_z_clearance(Z_AFTER_PROBING, true); // Move down still permitted
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -1012,7 +1012,7 @@ volatile bool Temperature::raw_temps_ready = false;
|
||||
planner.sync_fan_speeds(fan_speed);
|
||||
#endif
|
||||
|
||||
do_z_clearance(MPC_TUNING_END_Z, false);
|
||||
do_z_clearance(MPC_TUNING_END_Z);
|
||||
|
||||
TERN_(TEMP_TUNING_MAINTAIN_FAN, adaptive_fan_slowing = true);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user