Merge branch 'M48_fix_for_nozzle_as_probe' into 'master'

2-M48 fix for nozzle as probe

Closes #2

See merge request lulzbot3d/marlin!6
This commit is contained in:
Brian Kahl 2021-09-15 14:02:56 +00:00
commit 4ebad9cf84
4 changed files with 44 additions and 24 deletions

View File

@ -97,7 +97,7 @@
// Author info of this build printed to the host during boot and M115
#define STRING_CONFIG_H_AUTHOR "Lulzbot" // Who made the changes.
#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes)
#define LULZBOT_FW_VERSION "2.0.9.0.5"
#define LULZBOT_FW_VERSION "2.0.9.0.6"
/**
* *** VENDORS PLEASE READ ***
@ -1574,6 +1574,24 @@
#define PROBING_MARGIN -9
#endif
#endif
//Defining a safe position to probe for M48 and PROBE_OFFSET_WIZARD
#if ANY(Sidekick_289, Sidekick_747)
#define PROBE_SAFE_POINT { X_CENTER, Y_CENTER }
#elif ENABLED(MiniV2)
#define PROBE_SAFE_POINT { -4, -4 }
#elif ENABLED(TAZ6)
#define PROBE_SAFE_POINT { -8, -8 }
#elif ENABLED(Workhorse)
#define PROBE_SAFE_POINT { -10, -10 }
#elif ANY(TAZPro, TAZProXT)
#if DEFINED(TOOLHEAD_Quiver_DualExtruder)
#define PROBE_SAFE_POINT { -6, -9 } //safe probe point for dual extruder on Pro/XT
#else
#define PROBE_SAFE_POINT { -1, -9 } //safe probe point for single extruder toolheads on Pro/XT
#endif
#endif
// X and Y axis travel speed (mm/min) between probes
#define XY_PROBE_FEEDRATE (200*60)
@ -1651,9 +1669,7 @@
#define Z_PROBE_OFFSET_RANGE_MAX 5
// Enable the M48 repeatability test to test probe accuracy
#if ENABLED(LULZBOT_BLTouch)
#define Z_MIN_PROBE_REPEATABILITY_TEST
#endif
#define Z_MIN_PROBE_REPEATABILITY_TEST
// Before deploy/stow pause for user confirmation
//#define PAUSE_BEFORE_DEPLOY_STOW

View File

@ -1272,15 +1272,7 @@
#define PROBE_OFFSET_WIZARD_START_Z 1.0
// Set a convenient position to do the calibration (probing point and nozzle/bed-distance)
#if ANY(Sidekick_289, Sidekick_747)
#define PROBE_OFFSET_WIZARD_XY_POS { X_CENTER, Y_CENTER }
#elif ENABLED(MiniV2)
#define PROBE_OFFSET_WIZARD_XY_POS { -4, -4 }
#elif ENABLED(TAZ6)
#define PROBE_OFFSET_WIZARD_XY_POS { -8, -8 }
#elif ENABLED(Workhorse)
#define PROBE_OFFSET_WIZARD_XY_POS { -10, -10 }
#endif
#define PROBE_OFFSET_WIZARD_XY_POS PROBE_SAFE_POINT
#endif
#endif
@ -4111,6 +4103,12 @@
#define GANTRY_CALIBRATION_COMMANDS_POST "G28"
#endif
#if ANY(TAZPro,TAZProXT,Workhorse)
#define X_LEVEL_SEQUENCE
#endif
#if defined (X_LEVEL_SEQUENCE)
#define LEVELING_COMMANDS "G28 Z\nM18 Z\nG4 P300\nG28 Z" //Homing to the top, disabling the Z motors for 300ms and then rehoming Z
#endif
/**
* Instant freeze / unfreeze functionality
* Specified pin has pullup and connecting to ground will instantly pause motion.

View File

@ -28,6 +28,7 @@
#include "../../module/motion.h"
#include "../../module/probe.h"
#include "../../lcd/marlinui.h"
#include "../../../Configuration_adv.h"
#include "../../feature/bedlevel/bedlevel.h"
@ -72,6 +73,9 @@ void GcodeSuite::M48() {
const ProbePtRaise raise_after = parser.boolval('E') ? PROBE_PT_STOW : PROBE_PT_RAISE;
constexpr xy_pos_t probe_point = PROBE_SAFE_POINT;
do_blocking_move_to_xy(probe_point); //moving toolhead to a safe probing point
// Test at the current position by default, overridden by X and Y
const xy_pos_t test_position = {
parser.linearval('X', current_position.x + probe.offset_xy.x), // If no X use the probe's current X position

View File

@ -40,7 +40,7 @@ using namespace Theme;
#define LEVEL_AXIS_POS BTN_POS(1,2), BTN_SIZE(2,1)
#define BED_MESH_TITLE_POS BTN_POS(1,3), BTN_SIZE(2,1)
#define PROBE_BED_POS BTN_POS(1,4), BTN_SIZE(1,1)
#define TEST_MESH_POS BTN_POS(2,4), BTN_SIZE(1,1)
#define M48_TEST_POS BTN_POS(2,4), BTN_SIZE(1,1)
#define SHOW_MESH_POS BTN_POS(1,5), BTN_SIZE(1,1)
#define EDIT_MESH_POS BTN_POS(2,5), BTN_SIZE(1,1)
#define BLTOUCH_TITLE_POS BTN_POS(1,6), BTN_SIZE(2,1)
@ -54,7 +54,7 @@ using namespace Theme;
#define LEVEL_AXIS_POS BTN_POS(1,2), BTN_SIZE(3,1)
#define BED_MESH_TITLE_POS BTN_POS(1,3), BTN_SIZE(2,1)
#define PROBE_BED_POS BTN_POS(1,4), BTN_SIZE(1,1)
#define TEST_MESH_POS BTN_POS(2,4), BTN_SIZE(1,1)
#define M48_TEST_POS BTN_POS(2,4), BTN_SIZE(1,1)
#define SHOW_MESH_POS BTN_POS(1,5), BTN_SIZE(1,1)
#define EDIT_MESH_POS BTN_POS(2,5), BTN_SIZE(1,1)
#define BLTOUCH_TITLE_POS BTN_POS(3,3), BTN_SIZE(1,1)
@ -81,12 +81,12 @@ void LevelingMenu::onRedraw(draw_mode_t what) {
.text(BLTOUCH_TITLE_POS, GET_TEXT_F(MSG_BLTOUCH))
#endif
.font(font_medium).colors(normal_btn)
.enabled(EITHER(Z_STEPPER_AUTO_ALIGN,MECHANICAL_GANTRY_CALIBRATION))
.enabled(ANY(Z_STEPPER_AUTO_ALIGN,MECHANICAL_GANTRY_CALIBRATION,X_LEVEL_SEQUENCE))
.tag(2).button(LEVEL_AXIS_POS, GET_TEXT_F(MSG_LEVEL_X_AXIS))
.tag(3).button(PROBE_BED_POS, GET_TEXT_F(MSG_PROBE_BED))
.enabled(ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)) //Taking over mesh view option due to using Bilinear leveling and not being able to edit the mesh
.tag(4).button(M48_TEST_POS, GET_TEXT_F(MSG_M48_TEST))
#if DISABLED (AUTO_BED_LEVELING_BILINEAR)
.enabled(ENABLED(HAS_MESH))
.tag(4).button(SHOW_MESH_POS, GET_TEXT_F(MSG_SHOW_MESH))
.enabled(ENABLED(HAS_MESH))
.tag(5).button(EDIT_MESH_POS, GET_TEXT_F(MSG_EDIT_MESH))
.enabled(ENABLED(G26_MESH_VALIDATION))
@ -106,6 +106,8 @@ bool LevelingMenu::onTouchEnd(uint8_t tag) {
case 1: GOTO_PREVIOUS(); break;
#if EITHER(Z_STEPPER_AUTO_ALIGN,MECHANICAL_GANTRY_CALIBRATION)
case 2: SpinnerDialogBox::enqueueAndWait_P(F("G34")); break;
#else
case 2: SpinnerDialogBox::enqueueAndWait_P(F(LEVELING_COMMANDS)); break;
#endif
case 3:
#ifndef BED_LEVELING_COMMANDS
@ -117,8 +119,8 @@ bool LevelingMenu::onTouchEnd(uint8_t tag) {
SpinnerDialogBox::enqueueAndWait_P(F(BED_LEVELING_COMMANDS));
#endif
break;
case 4: SpinnerDialogBox::enqueueAndWait_P(F("G28O\nM48")); break;
#if ENABLED(AUTO_BED_LEVELING_UBL)
case 4: BedMeshViewScreen::show(); break;
case 5: BedMeshEditScreen::show(); break;
#endif
#if ENABLED(G26_MESH_VALIDATION)