From db12ccab558e43bc27f424ad546b0459a697cf77 Mon Sep 17 00:00:00 2001 From: Timothy Hoogland Date: Mon, 9 Oct 2023 18:22:25 -0500 Subject: [PATCH] BLTouch Fixes & EStep Updates Added https://github.com/MarlinFirmware/Marlin/pull/25656 --- .../Firmware/Marlin/Configuration.h | 13 ++++++++++--- .../TH3D_EZBoardV2/Firmware/Marlin/Configuration.h | 13 ++++++++++--- Firmware/Marlin/Configuration_backend.h | 6 ++++-- Firmware/Marlin/src/feature/bltouch.cpp | 11 ++++++++--- 4 files changed, 32 insertions(+), 11 deletions(-) diff --git a/Board_Configs/TH3D_EZBoardLite/Firmware/Marlin/Configuration.h b/Board_Configs/TH3D_EZBoardLite/Firmware/Marlin/Configuration.h index 3f676b9b190a..e1e40aec1a26 100644 --- a/Board_Configs/TH3D_EZBoardLite/Firmware/Marlin/Configuration.h +++ b/Board_Configs/TH3D_EZBoardLite/Firmware/Marlin/Configuration.h @@ -207,12 +207,19 @@ // EXTRUDER SETTINGS ------------------------------- // Use to set custom esteps and/or reverse your E Motor direction if you are installing an extruder that needs the direction reversed. // If you reversed the wiring on your E motor already (like the Bondtech Guide says to do) then you do not need to reverse it in the firmware here. - +// +// Example EStep Values For Common Extuders: +// TH3D Aluminum Extruder --- 95 ESteps +// LGX/LGX Lite/NG Extruder - 400 ESteps +// TH3D Tough Extruder V2 --- 407 ESteps +// TH3D Tough Extruder V1 --- 410 ESteps +// Bondtech BMG Extruder ---- 415 ESteps +// Creality Sprite Extruder - 425 ESteps +// LDO Orbiter/Sherpa Mini -- 690 ESteps +// // If you want to change the Esteps for your printer you can uncomment the below line and set CUSTOM_ESTEPS_VALUE to what you want - USE WHOLE NUMBERS ONLY // This option sets the esteps from the CUSTOM_ESTEPS_VALUE line below. // If you need to reverse the e motor direction also enabled the REVERSE_E_MOTOR_DIRECTION option. -// Example EStep Values: TH3D Aluminum Extruder - 95 ESteps, TH3D Tough Extruder - 410 ESteps, BMG Extruder - 415 ESteps -// When installing a Tough Extruder or E3D Titan or Bondtech that is Geared you likely need to enable the REVERSE_E_MOTOR_DIRECTION option //#define CUSTOM_ESTEPS #define CUSTOM_ESTEPS_VALUE 410 //#define REVERSE_E_MOTOR_DIRECTION diff --git a/Board_Configs/TH3D_EZBoardV2/Firmware/Marlin/Configuration.h b/Board_Configs/TH3D_EZBoardV2/Firmware/Marlin/Configuration.h index 99440cef3950..5c599b1655dd 100644 --- a/Board_Configs/TH3D_EZBoardV2/Firmware/Marlin/Configuration.h +++ b/Board_Configs/TH3D_EZBoardV2/Firmware/Marlin/Configuration.h @@ -235,12 +235,19 @@ // EXTRUDER SETTINGS ------------------------------- // Use to set custom esteps and/or reverse your E Motor direction if you are installing an extruder that needs the direction reversed. // If you reversed the wiring on your E motor already (like the Bondtech Guide says to do) then you do not need to reverse it in the firmware here. - +// +// Example EStep Values For Common Extuders: +// TH3D Aluminum Extruder --- 95 ESteps +// LGX/LGX Lite/NG Extruder - 400 ESteps +// TH3D Tough Extruder V2 --- 407 ESteps +// TH3D Tough Extruder V1 --- 410 ESteps +// Bondtech BMG Extruder ---- 415 ESteps +// Creality Sprite Extruder - 425 ESteps +// LDO Orbiter/Sherpa Mini -- 690 ESteps +// // If you want to change the Esteps for your printer you can uncomment the below line and set CUSTOM_ESTEPS_VALUE to what you want - USE WHOLE NUMBERS ONLY // This option sets the esteps from the CUSTOM_ESTEPS_VALUE line below. // If you need to reverse the e motor direction also enabled the REVERSE_E_MOTOR_DIRECTION option. -// Example EStep Values: TH3D Aluminum Extruder - 95 ESteps, TH3D Tough Extruder - 410 ESteps, BMG Extruder - 415 ESteps -// When installing a Tough Extruder or E3D Titan or Bondtech that is Geared you likely need to enable the REVERSE_E_MOTOR_DIRECTION option //#define CUSTOM_ESTEPS #define CUSTOM_ESTEPS_VALUE 410 //#define REVERSE_E_MOTOR_DIRECTION diff --git a/Firmware/Marlin/Configuration_backend.h b/Firmware/Marlin/Configuration_backend.h index 8992ead8c166..2af69ca77d2e 100644 --- a/Firmware/Marlin/Configuration_backend.h +++ b/Firmware/Marlin/Configuration_backend.h @@ -260,7 +260,9 @@ #define Z_PROBE_OFFSET_RANGE_MAX 1 #define Z_MIN_PROBE_REPEATABILITY_TEST - #define Z_AFTER_HOMING 5 + #if NONE(BLTOUCH) + #define Z_AFTER_HOMING 5 + #endif #define Z_PROBE_LOW_POINT -10 #if NONE(BLTOUCH) @@ -561,7 +563,7 @@ #endif #if ENABLED(BLTOUCH) - #define Z_CLEARANCE_DEPLOY_PROBE 8 + #define Z_CLEARANCE_DEPLOY_PROBE 5 #define Z_CLEARANCE_BETWEEN_PROBES 5 #define Z_CLEARANCE_MULTI_PROBE 5 #define Z_PROBE_FEEDRATE_SLOW (Z_PROBE_FEEDRATE_FAST / 2) diff --git a/Firmware/Marlin/src/feature/bltouch.cpp b/Firmware/Marlin/src/feature/bltouch.cpp index fe56341a47ec..1c6c1eb4aa55 100644 --- a/Firmware/Marlin/src/feature/bltouch.cpp +++ b/Firmware/Marlin/src/feature/bltouch.cpp @@ -42,9 +42,14 @@ bool BLTouch::od_5v_mode; // Initialized by settings.load, 0 = Open Drai #include "../core/debug_out.h" bool BLTouch::command(const BLTCommand cmd, const millis_t &ms) { - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("BLTouch Command :", cmd); - servo[Z_PROBE_SERVO_NR].move(cmd); - safe_delay(_MAX(ms, (uint32_t)BLTOUCH_DELAY)); // BLTOUCH_DELAY is also the *minimum* delay + const BLTCommand current = servo[Z_PROBE_SERVO_NR].read(); + if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("BLTouch from ", current, " to ", cmd); + // If the new command is the same, skip it (and the delay). + // The previous write should've already delayed to detect the alarm. + if (cmd != current) { + servo[Z_PROBE_SERVO_NR].move(cmd); + safe_delay(_MAX(ms, (uint32_t)BLTOUCH_DELAY)); // BLTOUCH_DELAY is also the *minimum* delay + } return triggered(); }