Welcome! Log In Create A New Profile

Advanced

Marlin and endstop setting

Posted by Mr Kroll 
Marlin and endstop setting
July 04, 2024 09:43AM
Hello,

I am compiling Marlin 2.1.2.2 for a BTT SKR_3EZ with TMC2209 steppers.

I have set up sensorless homing;
Trinamically for the X & Y
Using a BL Touch sensor in the dedicated slots for the Z axis.

I would like to use the X_MIN & Y_MIN plugs for another purpose, [input pins for custom user defined buttons], However:

//===========================================================================
//============================== Endstop Settings ===========================
//===========================================================================

// @section endstops

// Specify here all the endstop connectors that are connected to any endstop or probe.
// Almost all printers will be using one per axis. Probes will use one or more of the
// extra connectors. Leave undefined any used for non-endstop and non-probe purposes.

#define USE_XMIN_PLUG
#define USE_YMIN_PLUG

when I comment out these two lines;

//#define USE_XMIN_PLUG
//#define USE_YMIN_PLUG

I receive this compilation error and the build fails;

Marlin\src\HAL\STM32\..\../inc/SanityCheck.h:2259:8: error: #error "Enable USE_XMIN_PLUG when homing X to MIN."

How can I correct this to free up these resources?
Attachments:
open | download - Configuration.h (126.6 KB)
open | download - Configuration_adv.h (173.5 KB)
open | download - pins_BTT_SKR_V3_0_common.h (20 KB)
Re: Marlin and endstop setting
July 04, 2024 10:09AM
Sensorless homing is marketing BS

In reality the tmc stepper driver has a pin (diag) that is connected to the endstop pin that triggers when the stepper detects a lack of movement. (like when it hit the end of travel)

//
// Trinamic Stallguard pins
//
#define X_DIAG_PIN PC1 // X-STOP
#define Y_DIAG_PIN PC3 // Y-STOP
#define Z_DIAG_PIN PC0 // Z-STOP
#define E0_DIAG_PIN PC2 // E0DET
#define E1_DIAG_PIN PA0 // E1DET


Ie the endstop pins are still needed, you cannot free them up and have sensor-less homing


This is also why the endstop definition code is a little complicated

eg

//
// Limit Switches
//
#ifdef X_STALL_SENSITIVITY
#define X_STOP_PIN X_DIAG_PIN
#if X_HOME_TO_MIN
#define X_MAX_PIN PC2 // E0DET
#else
#define X_MIN_PIN PC2 // E0DET
#endif


If your using sensorless, it has to change the pins so the min or max endstop is set to the pin diag is conneced to, which changes if you home to min or max

Edited 7 time(s). Last edit at 07/04/2024 10:19AM by Dust.
Re: Marlin and endstop setting
July 04, 2024 07:18PM
Thankyou very much for the thorough reply!
That little bit of understanding will lead to quite a bit of learning in configuring Marlin
It explains why thing were behaving so weirdly as I was Playing with the system.

I will have to look at reassigning other resources for the mods that I am working on.

Thank you very much, Shane
Sorry, only registered users may post in this forum.

Click here to login