Adjust axis homed / trusted methods (#20323)

This commit is contained in:
Scott Lahteine
2020-11-29 19:06:40 -06:00
parent f22b677906
commit 448cf2c357
22 changed files with 118 additions and 149 deletions

View File

@ -319,15 +319,14 @@ void GcodeSuite::G28() {
#endif
const float z_homing_height =
ENABLED(UNKNOWN_Z_NO_RAISE) && !TEST(axis_known_position, Z_AXIS)
? 0
: (parser.seenval('R') ? parser.value_linear_units() : Z_HOMING_HEIGHT);
const float z_homing_height = TERN1(UNKNOWN_Z_NO_RAISE, axis_is_trusted(Z_AXIS))
? (parser.seenval('R') ? parser.value_linear_units() : Z_HOMING_HEIGHT)
: 0;
if (z_homing_height && (doX || doY || TERN0(Z_SAFE_HOMING, doZ))) {
// Raise Z before homing any other axes and z is not already high enough (never lower z)
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Raise Z (before homing) by ", z_homing_height);
do_z_clearance(z_homing_height, true, DISABLED(UNKNOWN_Z_NO_RAISE));
do_z_clearance(z_homing_height, axis_is_trusted(Z_AXIS), DISABLED(UNKNOWN_Z_NO_RAISE));
}
#if ENABLED(QUICK_HOME)

View File

@ -39,7 +39,7 @@
void GcodeSuite::G34() {
// Home before the alignment procedure
if (!all_axes_known()) home_all_axes();
if (!all_axes_trusted()) home_all_axes();
SET_SOFT_ENDSTOP_LOOSE(true);
TEMPORARY_BED_LEVELING_STATE(false);

View File

@ -167,7 +167,7 @@ void GcodeSuite::G34() {
);
// Home before the alignment procedure
if (!all_axes_known()) home_all_axes();
if (!all_axes_trusted()) home_all_axes();
// Move the Z coordinate realm towards the positive - dirty trick
current_position.z += z_probe * 0.5f;

View File

@ -102,7 +102,7 @@ void GcodeSuite::M600() {
#if ENABLED(HOME_BEFORE_FILAMENT_CHANGE)
// If needed, home before parking for filament change
if (!all_axes_known()) home_all_axes();
if (!all_axes_trusted()) home_all_axes();
#endif
#if HAS_MULTI_EXTRUDER

View File

@ -59,10 +59,8 @@
void GcodeSuite::M701() {
xyz_pos_t park_point = NOZZLE_PARK_POINT;
#if ENABLED(NO_MOTION_BEFORE_HOMING)
// Don't raise Z if the machine isn't homed
if (axes_should_home()) park_point.z = 0;
#endif
// Don't raise Z if the machine isn't homed
if (TERN0(NO_MOTION_BEFORE_HOMING, axes_should_home())) park_point.z = 0;
#if ENABLED(MIXING_EXTRUDER)
const int8_t target_e_stepper = get_target_e_stepper_from_command();
@ -147,10 +145,8 @@ void GcodeSuite::M701() {
void GcodeSuite::M702() {
xyz_pos_t park_point = NOZZLE_PARK_POINT;
#if ENABLED(NO_MOTION_BEFORE_HOMING)
// Don't raise Z if the machine isn't homed
if (axes_should_home()) park_point.z = 0;
#endif
// Don't raise Z if the machine isn't homed
if (TERN0(NO_MOTION_BEFORE_HOMING, axes_should_home())) park_point.z = 0;
#if ENABLED(MIXING_EXTRUDER)
const uint8_t old_mixing_tool = mixer.get_current_vtool();