I know this is the same title as #12726, however I rather started a new issue for clarity as I made quite a few tests. It is also hard to decide if this is a [BUG] or [FR] for Marlin, however it is certainly [BUG] for me.
I have Ender 3 with SKR Mini E3 v1.2 board, which has separate connectors for Z-endstop switch and BLTouch probe. For the whole day I am trying to configure Marlin bugfix-2.0.x
to achieve seemingly very simple things:
ENDSTOPS_ALWAYS_ON_DEFAULT
in Configuration_adv.h, however look at the following line.That's it. Below is the description of all combinations of configurations, tested on the Ender 3 using SKR Mini E3 v1.2 with Z-endstop switch connected to the Z-STOP connector (PC2) and BLTouch connected to the SERVOS and PROBE connector (PC14).
Thanks to #7470, #define ENDSTOPS_ALWAYS_ON_DEFAULT
is always uncommented (enabled). In every step/combination, all other relevant configuration defines are shown for clarity. All 4 files are also in the attached Base config (Z-endstop only, no BLTouch, homing at X=0, Y=0).zip file, the configuration in them matches the config in Option 1.
/* pins_BTT_SKR_MINI_E3_V1_2.h */
#define Z_STOP_PIN PC2
#define Z_MIN_PROBE_PIN PC14
/* Configuration.h */
//#define BLTOUCH
//#define Z_SAFE_HOMING
//#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
/* Conditionals_LCD.h */
#define HAS_CUSTOM_PROBE_PIN DISABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
#define HOMING_Z_WITH_PROBE (Z_HOME_DIR < 0 && !HAS_CUSTOM_PROBE_PIN)
Default configuration, using only Z-endstop switch as Z-endstop. Printer homes X and Y, then Z at the same spot (X = 0, Y = 0).
From this point onwards, the following is also uncommented:
// Configuration.h
#define ENDSTOPPULLUP_ZMIN_PROBE
// Configuration_adv.h
#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping
#define BABYSTEP_ZPROBE_GFX_OVERLAY // Enable graphical overlay on Z-offset editor
In every of the following options, after homing X and Y, printer goes to the center of the bed and performs Z-homing (Z_SAFE_HOMING
) :heavy_check_mark:.
/* pins_BTT_SKR_MINI_E3_V1_2.h */
#define Z_STOP_PIN PC2
#define Z_MIN_PROBE_PIN PC14
/* Configuration.h */
#define BLTOUCH
#define Z_SAFE_HOMING
//#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
/* Conditionals_LCD.h */
#define HAS_CUSTOM_PROBE_PIN DISABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
#define HOMING_Z_WITH_PROBE (Z_HOME_DIR < 0 && !HAS_CUSTOM_PROBE_PIN)
/* pins_BTT_SKR_MINI_E3_V1_2.h */
#define Z_STOP_PIN PC2
#define Z_MIN_PROBE_PIN PC14
/* Configuration.h */
#define BLTOUCH
#define Z_SAFE_HOMING
#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
/* Conditionals_LCD.h */
#define HAS_CUSTOM_PROBE_PIN DISABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
#define HOMING_Z_WITH_PROBE (Z_HOME_DIR < 0 && !HAS_CUSTOM_PROBE_PIN)
Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
we specified that the BLTouch is connected to the Z-endstop switch pin, therefore it is :heavy_check_mark: that Marlin only monitors Z-endstop switch because it thinks it is actually the BLTouch./* pins_BTT_SKR_MINI_E3_V1_2.h */
#define Z_STOP_PIN PC14 // PC2
//#define Z_MIN_PROBE_PIN PC14
/* Configuration.h */
#define BLTOUCH
#define Z_SAFE_HOMING
#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
/* Conditionals_LCD.h */
#define HAS_CUSTOM_PROBE_PIN DISABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
#define HOMING_Z_WITH_PROBE (Z_HOME_DIR < 0 && !HAS_CUSTOM_PROBE_PIN)
:x: overall despite all :heavy_check_mark:, because we lost the Z-endstop switch.
/* pins_BTT_SKR_MINI_E3_V1_2.h */
#define Z_STOP_PIN PC2
#define Z_MIN_PROBE_PIN PC14
/* Configuration.h */
#define BLTOUCH
#define Z_SAFE_HOMING
#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
/* Conditionals_LCD.h */
#define HAS_CUSTOM_PROBE_PIN true // DISABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
#define HOMING_Z_WITH_PROBE (Z_HOME_DIR < 0 && !HAS_CUSTOM_PROBE_PIN)
This was accidentally tested as I forgot to comment #define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
.
Effectively printer is unstoppable when homing Z and will smash to the bed.
/* pins_BTT_SKR_MINI_E3_V1_2.h */
#define Z_STOP_PIN PC2
#define Z_MIN_PROBE_PIN PC14
/* Configuration.h */
#define BLTOUCH
#define Z_SAFE_HOMING
//#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
/* Conditionals_LCD.h */
#define HAS_CUSTOM_PROBE_PIN true // DISABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
#define HOMING_Z_WITH_PROBE (Z_HOME_DIR < 0 && !HAS_CUSTOM_PROBE_PIN)
/* pins_BTT_SKR_MINI_E3_V1_2.h */
#define Z_STOP_PIN PC2
#define Z_MIN_PROBE_PIN PC14
/* Configuration.h */
#define BLTOUCH
#define Z_SAFE_HOMING
//#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
/* Conditionals_LCD.h */
#define HAS_CUSTOM_PROBE_PIN true // DISABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
#define HOMING_Z_WITH_PROBE (Z_HOME_DIR < 0)
I have run out of ideas. Maybe the solution would be:
/* Conditionals_LCD.h */
#define HAS_CUSTOM_PROBE_PIN (defined(Z_STOP_PIN) && defined(Z_MIN_PROBE_PIN) && (Z_STOP_PIN != Z_MIN_PROBE_PIN))
#define HOMING_Z_WITH_PROBE (Z_HOME_DIR < 0)
and some fix for Option 7 point 1.
Hmm, is the other thing more of a bug
BLTouch is not used if using separate pin (that is if
Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
is disabled)"
because of the HOMING_Z_WITH_PROBE
logic in Conditionals_LCD.h,
or a feature request
Cofiguration option to use Z-endstop switch and BLTouch probe simultaneously
?
Reading this again I do not understand the HOMING_Z_WITH_PROBE
logic - shouldn't the normal operation of the Z-endstop switch be retained (unless configured otherwise, e.g. with Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
or commenting #define Z_STOP_PIN
) and BLTouch probe just used in conjunction if the BLTOUCH
is defined?