mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2024-12-01 07:42:37 +00:00
✨ BLTouch High Speed mode runtime configuration (#22916)
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
parent
c1dba3d028
commit
2893048e29
@ -897,12 +897,14 @@
|
|||||||
//#define BLTOUCH_FORCE_MODE_SET
|
//#define BLTOUCH_FORCE_MODE_SET
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Use "HIGH SPEED" mode for probing.
|
* Enable "HIGH SPEED" option for probing.
|
||||||
* Danger: Disable if your probe sometimes fails. Only suitable for stable well-adjusted systems.
|
* Danger: Disable if your probe sometimes fails. Only suitable for stable well-adjusted systems.
|
||||||
* This feature was designed for Deltabots with very fast Z moves; however, higher speed Cartesians
|
* This feature was designed for Deltabots with very fast Z moves; however, higher speed Cartesians
|
||||||
* might be able to use it. If the machine can't raise Z fast enough the BLTouch may go into ALARM.
|
* might be able to use it. If the machine can't raise Z fast enough the BLTouch may go into ALARM.
|
||||||
|
*
|
||||||
|
* Set the default state here, change with 'M401 S' or UI, use M500 to save, M502 to reset.
|
||||||
*/
|
*/
|
||||||
//#define BLTOUCH_HS_MODE
|
//#define BLTOUCH_HS_MODE true
|
||||||
|
|
||||||
// Safety: Enable voltage mode settings in the LCD menu.
|
// Safety: Enable voltage mode settings in the LCD menu.
|
||||||
//#define BLTOUCH_LCD_VOLTAGE_MENU
|
//#define BLTOUCH_LCD_VOLTAGE_MENU
|
||||||
|
@ -28,7 +28,12 @@
|
|||||||
|
|
||||||
BLTouch bltouch;
|
BLTouch bltouch;
|
||||||
|
|
||||||
bool BLTouch::last_written_mode; // Initialized by settings.load, 0 = Open Drain; 1 = 5V Drain
|
bool BLTouch::od_5v_mode; // Initialized by settings.load, 0 = Open Drain; 1 = 5V Drain
|
||||||
|
#ifdef BLTOUCH_HS_MODE
|
||||||
|
bool BLTouch::high_speed_mode; // Initialized by settings.load, 0 = Low Speed; 1 = High Speed
|
||||||
|
#else
|
||||||
|
constexpr bool BLTouch::high_speed_mode;
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "../module/servo.h"
|
#include "../module/servo.h"
|
||||||
#include "../module/probe.h"
|
#include "../module/probe.h"
|
||||||
@ -64,17 +69,14 @@ void BLTouch::init(const bool set_voltage/*=false*/) {
|
|||||||
#else
|
#else
|
||||||
|
|
||||||
if (DEBUGGING(LEVELING)) {
|
if (DEBUGGING(LEVELING)) {
|
||||||
DEBUG_ECHOLNPGM("last_written_mode - ", last_written_mode);
|
PGMSTR(mode0, "OD");
|
||||||
DEBUG_ECHOLNPGM("config mode - "
|
PGMSTR(mode1, "5V");
|
||||||
#if ENABLED(BLTOUCH_SET_5V_MODE)
|
DEBUG_ECHOPGM("BLTouch Mode: ");
|
||||||
"BLTOUCH_SET_5V_MODE"
|
DEBUG_ECHOPGM_P(bltouch.od_5v_mode ? mode1 : mode0);
|
||||||
#else
|
DEBUG_ECHOLNPGM(" (Default " TERN(BLTOUCH_SET_5V_MODE, "5V", "OD") ")");
|
||||||
"OD"
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool should_set = last_written_mode != ENABLED(BLTOUCH_SET_5V_MODE);
|
const bool should_set = od_5v_mode != ENABLED(BLTOUCH_SET_5V_MODE);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -193,7 +195,7 @@ void BLTouch::mode_conv_proc(const bool M5V) {
|
|||||||
_mode_store();
|
_mode_store();
|
||||||
if (M5V) _set_5V_mode(); else _set_OD_mode();
|
if (M5V) _set_5V_mode(); else _set_OD_mode();
|
||||||
_stow();
|
_stow();
|
||||||
last_written_mode = M5V;
|
od_5v_mode = M5V;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // BLTOUCH
|
#endif // BLTOUCH
|
||||||
|
@ -23,10 +23,6 @@
|
|||||||
|
|
||||||
#include "../inc/MarlinConfigPre.h"
|
#include "../inc/MarlinConfigPre.h"
|
||||||
|
|
||||||
#if DISABLED(BLTOUCH_HS_MODE)
|
|
||||||
#define BLTOUCH_SLOW_MODE 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// BLTouch commands are sent as servo angles
|
// BLTouch commands are sent as servo angles
|
||||||
typedef unsigned char BLTCommand;
|
typedef unsigned char BLTCommand;
|
||||||
|
|
||||||
@ -70,8 +66,17 @@ typedef unsigned char BLTCommand;
|
|||||||
|
|
||||||
class BLTouch {
|
class BLTouch {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
static void init(const bool set_voltage=false);
|
static void init(const bool set_voltage=false);
|
||||||
static bool last_written_mode; // Initialized by settings.load, 0 = Open Drain; 1 = 5V Drain
|
static bool od_5v_mode; // Initialized by settings.load, 0 = Open Drain; 1 = 5V Drain
|
||||||
|
|
||||||
|
#ifdef BLTOUCH_HS_MODE
|
||||||
|
static bool high_speed_mode; // Initialized by settings.load, 0 = Low Speed; 1 = High Speed
|
||||||
|
#else
|
||||||
|
static constexpr bool high_speed_mode = false;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static inline float z_extra_clearance() { return high_speed_mode ? 7 : 0; }
|
||||||
|
|
||||||
// DEPLOY and STOW are wrapped for error handling - these are used by homing and by probing
|
// DEPLOY and STOW are wrapped for error handling - these are used by homing and by probing
|
||||||
static bool deploy() { return deploy_proc(); }
|
static bool deploy() { return deploy_proc(); }
|
||||||
|
@ -33,6 +33,10 @@
|
|||||||
#include "../../module/tool_change.h"
|
#include "../../module/tool_change.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if ENABLED(BLTOUCH)
|
||||||
|
#include "../../feature/bltouch.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
|
#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
|
||||||
#include "../../core/debug_out.h"
|
#include "../../core/debug_out.h"
|
||||||
|
|
||||||
@ -102,7 +106,7 @@ void GcodeSuite::G35() {
|
|||||||
// In BLTOUCH HS mode, the probe travels in a deployed state.
|
// In BLTOUCH HS mode, the probe travels in a deployed state.
|
||||||
// Users of G35 might have a badly misaligned bed, so raise Z by the
|
// Users of G35 might have a badly misaligned bed, so raise Z by the
|
||||||
// length of the deployed pin (BLTOUCH stroke < 7mm)
|
// length of the deployed pin (BLTOUCH stroke < 7mm)
|
||||||
do_blocking_move_to_z(SUM_TERN(BLTOUCH_HS_MODE, Z_CLEARANCE_BETWEEN_PROBES, 7));
|
do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES + TERN0(BLTOUCH, bltouch.z_extra_clearance()));
|
||||||
const float z_probed_height = probe.probe_at_point(tramming_points[i], PROBE_PT_RAISE, 0, true);
|
const float z_probed_height = probe.probe_at_point(tramming_points[i], PROBE_PT_RAISE, 0, true);
|
||||||
|
|
||||||
if (isnan(z_probed_height)) {
|
if (isnan(z_probed_height)) {
|
||||||
|
@ -45,6 +45,10 @@
|
|||||||
#include "../../libs/least_squares_fit.h"
|
#include "../../libs/least_squares_fit.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if ENABLED(BLTOUCH)
|
||||||
|
#include "../../feature/bltouch.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
|
#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
|
||||||
#include "../../core/debug_out.h"
|
#include "../../core/debug_out.h"
|
||||||
|
|
||||||
@ -149,7 +153,7 @@ void GcodeSuite::G34() {
|
|||||||
// In BLTOUCH HS mode, the probe travels in a deployed state.
|
// In BLTOUCH HS mode, the probe travels in a deployed state.
|
||||||
// Users of G34 might have a badly misaligned bed, so raise Z by the
|
// Users of G34 might have a badly misaligned bed, so raise Z by the
|
||||||
// length of the deployed pin (BLTOUCH stroke < 7mm)
|
// length of the deployed pin (BLTOUCH stroke < 7mm)
|
||||||
#define Z_BASIC_CLEARANCE (Z_CLEARANCE_BETWEEN_PROBES + 7.0f * BOTH(BLTOUCH, BLTOUCH_HS_MODE))
|
#define Z_BASIC_CLEARANCE (Z_CLEARANCE_BETWEEN_PROBES + TERN0(BLTOUCH, bltouch.z_extra_clearance()))
|
||||||
|
|
||||||
// Compute a worst-case clearance height to probe from. After the first
|
// Compute a worst-case clearance height to probe from. After the first
|
||||||
// iteration this will be re-calculated based on the actual bed position
|
// iteration this will be re-calculated based on the actual bed position
|
||||||
|
@ -28,13 +28,27 @@
|
|||||||
#include "../../module/motion.h"
|
#include "../../module/motion.h"
|
||||||
#include "../../module/probe.h"
|
#include "../../module/probe.h"
|
||||||
|
|
||||||
|
#ifdef BLTOUCH_HS_MODE
|
||||||
|
#include "../../feature/bltouch.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* M401: Deploy and activate the Z probe
|
* M401: Deploy and activate the Z probe
|
||||||
|
*
|
||||||
|
* With BLTOUCH_HS_MODE:
|
||||||
|
* S<bool> Set High Speed (HS) Mode and exit without deploy
|
||||||
*/
|
*/
|
||||||
void GcodeSuite::M401() {
|
void GcodeSuite::M401() {
|
||||||
|
if (parser.seen('S')) {
|
||||||
|
#ifdef BLTOUCH_HS_MODE
|
||||||
|
bltouch.high_speed_mode = parser.value_bool();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
else {
|
||||||
probe.deploy();
|
probe.deploy();
|
||||||
TERN_(PROBE_TARE, probe.tare());
|
TERN_(PROBE_TARE, probe.tare());
|
||||||
report_current_position();
|
report_current_position();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1577,6 +1577,9 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if ENABLED(BLTOUCH_HS_MODE) && BLTOUCH_HS_MODE == 0
|
||||||
|
#error "BLTOUCH_HS_MODE must now be defined as true or false, indicating the default state."
|
||||||
|
#endif
|
||||||
#if BLTOUCH_DELAY < 200
|
#if BLTOUCH_DELAY < 200
|
||||||
#error "BLTOUCH_DELAY less than 200 is unsafe and is not supported."
|
#error "BLTOUCH_DELAY less than 200 is unsafe and is not supported."
|
||||||
#endif
|
#endif
|
||||||
|
@ -491,6 +491,7 @@ namespace Language_en {
|
|||||||
LSTR MSG_BLTOUCH_STOW = _UxGT("Stow");
|
LSTR MSG_BLTOUCH_STOW = _UxGT("Stow");
|
||||||
LSTR MSG_BLTOUCH_DEPLOY = _UxGT("Deploy");
|
LSTR MSG_BLTOUCH_DEPLOY = _UxGT("Deploy");
|
||||||
LSTR MSG_BLTOUCH_SW_MODE = _UxGT("SW-Mode");
|
LSTR MSG_BLTOUCH_SW_MODE = _UxGT("SW-Mode");
|
||||||
|
LSTR MSG_BLTOUCH_SPEED_MODE = _UxGT("High Speed");
|
||||||
LSTR MSG_BLTOUCH_5V_MODE = _UxGT("5V-Mode");
|
LSTR MSG_BLTOUCH_5V_MODE = _UxGT("5V-Mode");
|
||||||
LSTR MSG_BLTOUCH_OD_MODE = _UxGT("OD-Mode");
|
LSTR MSG_BLTOUCH_OD_MODE = _UxGT("OD-Mode");
|
||||||
LSTR MSG_BLTOUCH_MODE_STORE = _UxGT("Mode-Store");
|
LSTR MSG_BLTOUCH_MODE_STORE = _UxGT("Mode-Store");
|
||||||
|
@ -217,13 +217,13 @@ static void _lcd_level_bed_corners_get_next_position() {
|
|||||||
|
|
||||||
bool _lcd_level_bed_corners_probe(bool verify=false) {
|
bool _lcd_level_bed_corners_probe(bool verify=false) {
|
||||||
if (verify) do_blocking_move_to_z(current_position.z + LEVEL_CORNERS_Z_HOP); // do clearance if needed
|
if (verify) do_blocking_move_to_z(current_position.z + LEVEL_CORNERS_Z_HOP); // do clearance if needed
|
||||||
TERN_(BLTOUCH_SLOW_MODE, bltouch.deploy()); // Deploy in LOW SPEED MODE on every probe action
|
TERN_(BLTOUCH, if (!bltouch.high_speed_mode) bltouch.deploy()); // Deploy in LOW SPEED MODE on every probe action
|
||||||
do_blocking_move_to_z(last_z - LEVEL_CORNERS_PROBE_TOLERANCE, MMM_TO_MMS(Z_PROBE_FEEDRATE_SLOW)); // Move down to lower tolerance
|
do_blocking_move_to_z(last_z - LEVEL_CORNERS_PROBE_TOLERANCE, MMM_TO_MMS(Z_PROBE_FEEDRATE_SLOW)); // Move down to lower tolerance
|
||||||
if (TEST(endstops.trigger_state(), Z_MIN_PROBE)) { // check if probe triggered
|
if (TEST(endstops.trigger_state(), Z_MIN_PROBE)) { // check if probe triggered
|
||||||
endstops.hit_on_purpose();
|
endstops.hit_on_purpose();
|
||||||
set_current_from_steppers_for_axis(Z_AXIS);
|
set_current_from_steppers_for_axis(Z_AXIS);
|
||||||
sync_plan_position();
|
sync_plan_position();
|
||||||
TERN_(BLTOUCH_SLOW_MODE, bltouch.stow()); // Stow in LOW SPEED MODE on every trigger
|
TERN_(BLTOUCH, if (!bltouch.high_speed_mode) bltouch.stow()); // Stow in LOW SPEED MODE on every trigger
|
||||||
// Triggered outside tolerance range?
|
// Triggered outside tolerance range?
|
||||||
if (ABS(current_position.z - last_z) > LEVEL_CORNERS_PROBE_TOLERANCE) {
|
if (ABS(current_position.z - last_z) > LEVEL_CORNERS_PROBE_TOLERANCE) {
|
||||||
last_z = current_position.z; // Above tolerance. Set a new Z for subsequent corners.
|
last_z = current_position.z; // Above tolerance. Set a new Z for subsequent corners.
|
||||||
@ -249,7 +249,7 @@ static void _lcd_level_bed_corners_get_next_position() {
|
|||||||
}
|
}
|
||||||
idle();
|
idle();
|
||||||
}
|
}
|
||||||
TERN_(BLTOUCH_SLOW_MODE, bltouch.stow());
|
TERN_(BLTOUCH, if (!bltouch.high_speed_mode) bltouch.stow());
|
||||||
ui.goto_screen(_lcd_draw_probing);
|
ui.goto_screen(_lcd_draw_probing);
|
||||||
return (probe_triggered);
|
return (probe_triggered);
|
||||||
}
|
}
|
||||||
@ -263,13 +263,14 @@ static void _lcd_level_bed_corners_get_next_position() {
|
|||||||
do {
|
do {
|
||||||
ui.refresh(LCDVIEW_REDRAW_NOW);
|
ui.refresh(LCDVIEW_REDRAW_NOW);
|
||||||
_lcd_draw_probing(); // update screen with # of good points
|
_lcd_draw_probing(); // update screen with # of good points
|
||||||
do_blocking_move_to_z(SUM_TERN(BLTOUCH_HS_MODE, current_position.z + LEVEL_CORNERS_Z_HOP, 7)); // clearance
|
|
||||||
|
do_blocking_move_to_z(current_position.z + LEVEL_CORNERS_Z_HOP + TERN0(BLTOUCH, bltouch.z_extra_clearance())); // clearance
|
||||||
|
|
||||||
_lcd_level_bed_corners_get_next_position(); // Select next corner coordinates
|
_lcd_level_bed_corners_get_next_position(); // Select next corner coordinates
|
||||||
current_position -= probe.offset_xy; // Account for probe offsets
|
current_position -= probe.offset_xy; // Account for probe offsets
|
||||||
do_blocking_move_to_xy(current_position); // Goto corner
|
do_blocking_move_to_xy(current_position); // Goto corner
|
||||||
|
|
||||||
TERN_(BLTOUCH_HS_MODE, bltouch.deploy()); // Deploy in HIGH SPEED MODE
|
TERN_(BLTOUCH, if (bltouch.high_speed_mode) bltouch.deploy()); // Deploy in HIGH SPEED MODE
|
||||||
if (!_lcd_level_bed_corners_probe()) { // Probe down to tolerance
|
if (!_lcd_level_bed_corners_probe()) { // Probe down to tolerance
|
||||||
if (_lcd_level_bed_corners_raise()) { // Prompt user to raise bed if needed
|
if (_lcd_level_bed_corners_raise()) { // Prompt user to raise bed if needed
|
||||||
#if ENABLED(LEVEL_CORNERS_VERIFY_RAISED) // Verify
|
#if ENABLED(LEVEL_CORNERS_VERIFY_RAISED) // Verify
|
||||||
@ -290,10 +291,12 @@ static void _lcd_level_bed_corners_get_next_position() {
|
|||||||
|
|
||||||
} while (good_points < nr_edge_points); // loop until all points within tolerance
|
} while (good_points < nr_edge_points); // loop until all points within tolerance
|
||||||
|
|
||||||
#if ENABLED(BLTOUCH_HS_MODE)
|
#if ENABLED(BLTOUCH)
|
||||||
|
if (bltouch.high_speed_mode)
|
||||||
// In HIGH SPEED MODE do clearance and stow at the very end
|
// In HIGH SPEED MODE do clearance and stow at the very end
|
||||||
do_blocking_move_to_z(current_position.z + LEVEL_CORNERS_Z_HOP);
|
do_blocking_move_to_z(current_position.z + LEVEL_CORNERS_Z_HOP);
|
||||||
bltouch.stow();
|
bltouch.stow();
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ui.goto_screen(_lcd_draw_level_prompt); // prompt for bed leveling
|
ui.goto_screen(_lcd_draw_level_prompt); // prompt for bed leveling
|
||||||
|
@ -217,11 +217,14 @@ void menu_advanced_settings();
|
|||||||
|
|
||||||
#if ENABLED(BLTOUCH_LCD_VOLTAGE_MENU)
|
#if ENABLED(BLTOUCH_LCD_VOLTAGE_MENU)
|
||||||
void bltouch_report() {
|
void bltouch_report() {
|
||||||
SERIAL_ECHOLNPGM("EEPROM Last BLTouch Mode - ", bltouch.last_written_mode);
|
PGMSTR(mode0, "OD");
|
||||||
SERIAL_ECHOLNPGM("Configuration BLTouch Mode - " TERN(BLTOUCH_SET_5V_MODE, "5V", "OD"));
|
PGMSTR(mode1, "5V");
|
||||||
|
SERIAL_ECHOPGM("BLTouch Mode: ");
|
||||||
|
SERIAL_ECHOPGM_P(bltouch.od_5v_mode ? mode1 : mode0);
|
||||||
|
SERIAL_ECHOLNPGM(" (Default " TERN(BLTOUCH_SET_5V_MODE, "5V", "OD") ")");
|
||||||
char mess[21];
|
char mess[21];
|
||||||
strcpy_P(mess, PSTR("BLTouch Mode - "));
|
strcpy_P(mess, PSTR("BLTouch Mode: "));
|
||||||
strcpy_P(&mess[15], bltouch.last_written_mode ? PSTR("5V") : PSTR("OD"));
|
strcpy_P(&mess[15], bltouch.od_5v_mode ? mode1 : mode0);
|
||||||
ui.set_status(mess);
|
ui.set_status(mess);
|
||||||
ui.return_to_status();
|
ui.return_to_status();
|
||||||
}
|
}
|
||||||
@ -235,6 +238,9 @@ void menu_advanced_settings();
|
|||||||
ACTION_ITEM(MSG_BLTOUCH_DEPLOY, bltouch._deploy);
|
ACTION_ITEM(MSG_BLTOUCH_DEPLOY, bltouch._deploy);
|
||||||
ACTION_ITEM(MSG_BLTOUCH_STOW, bltouch._stow);
|
ACTION_ITEM(MSG_BLTOUCH_STOW, bltouch._stow);
|
||||||
ACTION_ITEM(MSG_BLTOUCH_SW_MODE, bltouch._set_SW_mode);
|
ACTION_ITEM(MSG_BLTOUCH_SW_MODE, bltouch._set_SW_mode);
|
||||||
|
#ifdef BLTOUCH_HS_MODE
|
||||||
|
EDIT_ITEM(bool, MSG_BLTOUCH_SPEED_MODE, &bltouch.high_speed_mode);
|
||||||
|
#endif
|
||||||
#if ENABLED(BLTOUCH_LCD_VOLTAGE_MENU)
|
#if ENABLED(BLTOUCH_LCD_VOLTAGE_MENU)
|
||||||
CONFIRM_ITEM(MSG_BLTOUCH_5V_MODE, MSG_BLTOUCH_5V_MODE, MSG_BUTTON_CANCEL, bltouch._set_5V_mode, nullptr, GET_TEXT(MSG_BLTOUCH_MODE_CHANGE));
|
CONFIRM_ITEM(MSG_BLTOUCH_5V_MODE, MSG_BLTOUCH_5V_MODE, MSG_BUTTON_CANCEL, bltouch._set_5V_mode, nullptr, GET_TEXT(MSG_BLTOUCH_MODE_CHANGE));
|
||||||
CONFIRM_ITEM(MSG_BLTOUCH_OD_MODE, MSG_BLTOUCH_OD_MODE, MSG_BUTTON_CANCEL, bltouch._set_OD_mode, nullptr, GET_TEXT(MSG_BLTOUCH_MODE_CHANGE));
|
CONFIRM_ITEM(MSG_BLTOUCH_OD_MODE, MSG_BLTOUCH_OD_MODE, MSG_BUTTON_CANCEL, bltouch._set_OD_mode, nullptr, GET_TEXT(MSG_BLTOUCH_MODE_CHANGE));
|
||||||
|
@ -36,6 +36,10 @@
|
|||||||
#include "../../module/probe.h"
|
#include "../../module/probe.h"
|
||||||
#include "../../gcode/queue.h"
|
#include "../../gcode/queue.h"
|
||||||
|
|
||||||
|
#if ENABLED(BLTOUCH)
|
||||||
|
#include "../../feature/bltouch.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
//#define DEBUG_OUT 1
|
//#define DEBUG_OUT 1
|
||||||
#include "../../core/debug_out.h"
|
#include "../../core/debug_out.h"
|
||||||
|
|
||||||
@ -51,7 +55,7 @@ static int8_t reference_index; // = 0
|
|||||||
static bool probe_single_point() {
|
static bool probe_single_point() {
|
||||||
do_blocking_move_to_z(TERN(BLTOUCH, Z_CLEARANCE_DEPLOY_PROBE, Z_CLEARANCE_BETWEEN_PROBES));
|
do_blocking_move_to_z(TERN(BLTOUCH, Z_CLEARANCE_DEPLOY_PROBE, Z_CLEARANCE_BETWEEN_PROBES));
|
||||||
// Stow after each point with BLTouch "HIGH SPEED" mode for push-pin safety
|
// Stow after each point with BLTouch "HIGH SPEED" mode for push-pin safety
|
||||||
const float z_probed_height = probe.probe_at_point(tramming_points[tram_index], TERN(BLTOUCH_HS_MODE, PROBE_PT_STOW, PROBE_PT_RAISE), 0, true);
|
const float z_probed_height = probe.probe_at_point(tramming_points[tram_index], TERN0(BLTOUCH, bltouch.high_speed_mode) ? PROBE_PT_STOW : PROBE_PT_RAISE, 0, true);
|
||||||
z_measured[tram_index] = z_probed_height;
|
z_measured[tram_index] = z_probed_height;
|
||||||
if (reference_index < 0) reference_index = tram_index;
|
if (reference_index < 0) reference_index = tram_index;
|
||||||
move_to_tramming_wait_pos();
|
move_to_tramming_wait_pos();
|
||||||
|
@ -1803,8 +1803,8 @@ void prepare_line_to_destination() {
|
|||||||
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Home Fast: ", move_length, "mm");
|
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Home Fast: ", move_length, "mm");
|
||||||
do_homing_move(axis, move_length, 0.0, !use_probe_bump);
|
do_homing_move(axis, move_length, 0.0, !use_probe_bump);
|
||||||
|
|
||||||
#if BOTH(HOMING_Z_WITH_PROBE, BLTOUCH_SLOW_MODE)
|
#if BOTH(HOMING_Z_WITH_PROBE, BLTOUCH)
|
||||||
if (axis == Z_AXIS) bltouch.stow(); // Intermediate STOW (in LOW SPEED MODE)
|
if (axis == Z_AXIS && !bltouch.high_speed_mode) bltouch.stow(); // Intermediate STOW (in LOW SPEED MODE)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// If a second homing move is configured...
|
// If a second homing move is configured...
|
||||||
@ -1837,8 +1837,9 @@ void prepare_line_to_destination() {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if BOTH(HOMING_Z_WITH_PROBE, BLTOUCH_SLOW_MODE)
|
#if BOTH(HOMING_Z_WITH_PROBE, BLTOUCH)
|
||||||
if (axis == Z_AXIS && bltouch.deploy()) return; // Intermediate DEPLOY (in LOW SPEED MODE)
|
if (axis == Z_AXIS && !bltouch.high_speed_mode && bltouch.deploy())
|
||||||
|
return; // Intermediate DEPLOY (in LOW SPEED MODE)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Slow move towards endstop until triggered
|
// Slow move towards endstop until triggered
|
||||||
|
@ -489,8 +489,10 @@ bool Probe::probe_down_to_z(const_float_t z, const_feedRate_t fr_mm_s) {
|
|||||||
#if BOTH(HAS_TEMP_HOTEND, WAIT_FOR_HOTEND)
|
#if BOTH(HAS_TEMP_HOTEND, WAIT_FOR_HOTEND)
|
||||||
thermalManager.wait_for_hotend_heating(active_extruder);
|
thermalManager.wait_for_hotend_heating(active_extruder);
|
||||||
#endif
|
#endif
|
||||||
|
#if ENABLED(BLTOUCH)
|
||||||
if (TERN0(BLTOUCH_SLOW_MODE, bltouch.deploy())) return true; // Deploy in LOW SPEED MODE on every probe action
|
if (!bltouch.high_speed_mode && bltouch.deploy())
|
||||||
|
return true; // Deploy in LOW SPEED MODE on every probe action
|
||||||
|
#endif
|
||||||
|
|
||||||
// Disable stealthChop if used. Enable diag1 pin on driver.
|
// Disable stealthChop if used. Enable diag1 pin on driver.
|
||||||
#if ENABLED(SENSORLESS_PROBING)
|
#if ENABLED(SENSORLESS_PROBING)
|
||||||
@ -531,8 +533,10 @@ bool Probe::probe_down_to_z(const_float_t z, const_feedRate_t fr_mm_s) {
|
|||||||
set_homing_current(false);
|
set_homing_current(false);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (probe_triggered && TERN0(BLTOUCH_SLOW_MODE, bltouch.stow())) // Stow in LOW SPEED MODE on every trigger
|
#if ENABLED(BLTOUCH)
|
||||||
return true;
|
if (probe_triggered && !bltouch.high_speed_mode && bltouch.stow())
|
||||||
|
return true; // Stow in LOW SPEED MODE on every trigger
|
||||||
|
#endif
|
||||||
|
|
||||||
// Clear endstop flags
|
// Clear endstop flags
|
||||||
endstops.hit_on_purpose();
|
endstops.hit_on_purpose();
|
||||||
@ -762,8 +766,9 @@ float Probe::probe_at_point(const_float_t rx, const_float_t ry, const ProbePtRai
|
|||||||
DEBUG_POS("", current_position);
|
DEBUG_POS("", current_position);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if BOTH(BLTOUCH, BLTOUCH_HS_MODE)
|
#if ENABLED(BLTOUCH)
|
||||||
if (bltouch.triggered()) bltouch._reset();
|
if (bltouch.high_speed_mode && bltouch.triggered())
|
||||||
|
bltouch._reset();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// On delta keep Z below clip height or do_blocking_move_to will abort
|
// On delta keep Z below clip height or do_blocking_move_to will abort
|
||||||
|
@ -301,7 +301,10 @@ typedef struct SettingsDataStruct {
|
|||||||
//
|
//
|
||||||
// BLTOUCH
|
// BLTOUCH
|
||||||
//
|
//
|
||||||
bool bltouch_last_written_mode;
|
bool bltouch_od_5v_mode;
|
||||||
|
#ifdef BLTOUCH_HS_MODE
|
||||||
|
bool bltouch_high_speed_mode; // M401 S
|
||||||
|
#endif
|
||||||
|
|
||||||
//
|
//
|
||||||
// Kinematic Settings
|
// Kinematic Settings
|
||||||
@ -918,9 +921,15 @@ void MarlinSettings::postprocess() {
|
|||||||
// BLTOUCH
|
// BLTOUCH
|
||||||
//
|
//
|
||||||
{
|
{
|
||||||
_FIELD_TEST(bltouch_last_written_mode);
|
_FIELD_TEST(bltouch_od_5v_mode);
|
||||||
const bool bltouch_last_written_mode = TERN(BLTOUCH, bltouch.last_written_mode, false);
|
const bool bltouch_od_5v_mode = TERN0(BLTOUCH, bltouch.od_5v_mode);
|
||||||
EEPROM_WRITE(bltouch_last_written_mode);
|
EEPROM_WRITE(bltouch_od_5v_mode);
|
||||||
|
|
||||||
|
#ifdef BLTOUCH_HS_MODE
|
||||||
|
_FIELD_TEST(bltouch_high_speed_mode);
|
||||||
|
const bool bltouch_high_speed_mode = TERN0(BLTOUCH, bltouch.high_speed_mode);
|
||||||
|
EEPROM_WRITE(bltouch_high_speed_mode);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -1810,13 +1819,23 @@ void MarlinSettings::postprocess() {
|
|||||||
// BLTOUCH
|
// BLTOUCH
|
||||||
//
|
//
|
||||||
{
|
{
|
||||||
_FIELD_TEST(bltouch_last_written_mode);
|
_FIELD_TEST(bltouch_od_5v_mode);
|
||||||
#if ENABLED(BLTOUCH)
|
#if ENABLED(BLTOUCH)
|
||||||
const bool &bltouch_last_written_mode = bltouch.last_written_mode;
|
const bool &bltouch_od_5v_mode = bltouch.od_5v_mode;
|
||||||
#else
|
#else
|
||||||
bool bltouch_last_written_mode;
|
bool bltouch_od_5v_mode;
|
||||||
|
#endif
|
||||||
|
EEPROM_READ(bltouch_od_5v_mode);
|
||||||
|
|
||||||
|
#ifdef BLTOUCH_HS_MODE
|
||||||
|
_FIELD_TEST(bltouch_high_speed_mode);
|
||||||
|
#if ENABLED(BLTOUCH)
|
||||||
|
const bool &bltouch_high_speed_mode = bltouch.high_speed_mode;
|
||||||
|
#else
|
||||||
|
bool bltouch_high_speed_mode;
|
||||||
|
#endif
|
||||||
|
EEPROM_READ(bltouch_high_speed_mode);
|
||||||
#endif
|
#endif
|
||||||
EEPROM_READ(bltouch_last_written_mode);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -2827,11 +2846,11 @@ void MarlinSettings::reset() {
|
|||||||
TERN_(HAS_PTC, ptc.reset());
|
TERN_(HAS_PTC, ptc.reset());
|
||||||
|
|
||||||
//
|
//
|
||||||
// BLTOUCH
|
// BLTouch
|
||||||
//
|
//
|
||||||
//#if ENABLED(BLTOUCH)
|
#ifdef BLTOUCH_HS_MODE
|
||||||
// bltouch.last_written_mode;
|
bltouch.high_speed_mode = ENABLED(BLTOUCH_HS_MODE);
|
||||||
//#endif
|
#endif
|
||||||
|
|
||||||
//
|
//
|
||||||
// Kinematic settings
|
// Kinematic settings
|
||||||
|
Loading…
Reference in New Issue
Block a user