Add BLTouch Support (can be enabled with #define KNUTWURST_BLTOUCH)

This commit is contained in:
Knutwurst
2020-07-14 20:09:41 +02:00
parent 5d3be2c342
commit 97d6db15cf
2 changed files with 58 additions and 7 deletions

View File

@@ -40,6 +40,8 @@
#define KNUTWURST_MEGAS #define KNUTWURST_MEGAS
#define KNUTWURST_TMC #define KNUTWURST_TMC
//#define KNUTWURST_BLTOUCH
//#define KNUTWURST_DEBUG
//#define POWER_OUTAGE_TEST //#define POWER_OUTAGE_TEST
//=========================================================================== //===========================================================================
@@ -909,7 +911,9 @@
* - normally-open switches to 5V and D32. * - normally-open switches to 5V and D32.
* *
*/ */
//#define Z_MIN_PROBE_PIN 32 // Pin 32 is the RAMPS default #if ENABLED(KNUTWURST_BLTOUCH)
#define Z_MIN_PROBE_PIN 2 // Pin 32 is the RAMPS default
#endif
/** /**
* Probe Type * Probe Type
@@ -923,7 +927,10 @@
* Use G29 repeatedly, adjusting the Z height at each point with movement commands * Use G29 repeatedly, adjusting the Z height at each point with movement commands
* or (with LCD_BED_LEVELING) the LCD controller. * or (with LCD_BED_LEVELING) the LCD controller.
*/ */
#if DISABLED(KNUTWURST_BLTOUCH)
#define PROBE_MANUALLY #define PROBE_MANUALLY
#endif
//#define MANUAL_PROBE_START_Z 0.2 //#define MANUAL_PROBE_START_Z 0.2
/** /**
@@ -947,7 +954,9 @@
/** /**
* The BLTouch probe uses a Hall effect sensor and emulates a servo. * The BLTouch probe uses a Hall effect sensor and emulates a servo.
*/ */
//#define BLTOUCH #if ENABLED(KNUTWURST_BLTOUCH)
#define BLTOUCH
#endif
/** /**
* Touch-MI Probe by hotends.fr * Touch-MI Probe by hotends.fr
@@ -1019,14 +1028,20 @@
* *
* Specify a Probe position as { X, Y, Z } * Specify a Probe position as { X, Y, Z }
*/ */
#if ENABLED(KNUTWURST_BLTOUCH)
#define NOZZLE_TO_PROBE_OFFSET { 29, -15, 0 }
#endif
#if DISABLED(KNUTWURST_BLTOUCH)
#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 }
#endif
// Most probes should stay away from the edges of the bed, but // Most probes should stay away from the edges of the bed, but
// with NOZZLE_AS_PROBE this can be negative for a wider probing area. // with NOZZLE_AS_PROBE this can be negative for a wider probing area.
#define MIN_PROBE_EDGE 10 #define MIN_PROBE_EDGE 10
// X and Y axis travel speed (mm/m) between probes // X and Y axis travel speed (mm/m) between probes
#define XY_PROBE_SPEED 8000 #define XY_PROBE_SPEED 3600
// Feedrate (mm/m) for the first approach when double-probing (MULTIPLE_PROBING == 2) // Feedrate (mm/m) for the first approach when double-probing (MULTIPLE_PROBING == 2)
#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z
@@ -1065,14 +1080,23 @@
#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes #define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes
//#define Z_AFTER_PROBING 5 // Z position after probing is done //#define Z_AFTER_PROBING 5 // Z position after probing is done
#if ENABLED(KNUTWURST_BLTOUCH)
#define Z_PROBE_LOW_POINT -5 // Farthest distance below the trigger-point to go before stopping
#endif
#if DISABLED(KNUTWURST_BLTOUCH)
#define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping
#endif
// For M851 give a range for adjusting the Z probe offset // For M851 give a range for adjusting the Z probe offset
#define Z_PROBE_OFFSET_RANGE_MIN -20 #define Z_PROBE_OFFSET_RANGE_MIN -20
#define Z_PROBE_OFFSET_RANGE_MAX 20 #define Z_PROBE_OFFSET_RANGE_MAX 20
// Enable the M48 repeatability test to test probe accuracy // Enable the M48 repeatability test to test probe accuracy
//#define Z_MIN_PROBE_REPEATABILITY_TEST #if ENABLED(KNUTWURST_BLTOUCH)
#define Z_MIN_PROBE_REPEATABILITY_TEST
#endif
// Before deploy/stow pause for user confirmation // Before deploy/stow pause for user confirmation
//#define PAUSE_BEFORE_DEPLOY_STOW //#define PAUSE_BEFORE_DEPLOY_STOW
@@ -1286,11 +1310,21 @@
* leveling in steps so you can manually adjust the Z height at each grid-point. * leveling in steps so you can manually adjust the Z height at each grid-point.
* With an LCD controller the process is guided step-by-step. * With an LCD controller the process is guided step-by-step.
*/ */
#if ENABLED(KNUTWURST_BLTOUCH)
//#define AUTO_BED_LEVELING_3POINT
//#define AUTO_BED_LEVELING_LINEAR
#define AUTO_BED_LEVELING_BILINEAR
//#define AUTO_BED_LEVELING_UBL
//#define MESH_BED_LEVELING
#endif
#if DISABLED(KNUTWURST_BLTOUCH)
//#define AUTO_BED_LEVELING_3POINT //#define AUTO_BED_LEVELING_3POINT
//#define AUTO_BED_LEVELING_LINEAR //#define AUTO_BED_LEVELING_LINEAR
//#define AUTO_BED_LEVELING_BILINEAR //#define AUTO_BED_LEVELING_BILINEAR
//#define AUTO_BED_LEVELING_UBL //#define AUTO_BED_LEVELING_UBL
#define MESH_BED_LEVELING #define MESH_BED_LEVELING
#endif
/** /**
* Normally G28 leaves leveling disabled on completion. Enable * Normally G28 leaves leveling disabled on completion. Enable
@@ -1303,7 +1337,9 @@
* Turn on with the command 'M111 S32'. * Turn on with the command 'M111 S32'.
* NOTE: Requires a lot of PROGMEM! * NOTE: Requires a lot of PROGMEM!
*/ */
//#define DEBUG_LEVELING_FEATURE #if ENABLED(KNUTWURST_DEBUG)
#define DEBUG_LEVELING_FEATURE
#endif
#if ANY(MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL) #if ANY(MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL)
// Gradually reduce leveling correction until a set height is reached, // Gradually reduce leveling correction until a set height is reached,
@@ -1335,7 +1371,7 @@
#if EITHER(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR) #if EITHER(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR)
// Set the number of grid points per dimension. // Set the number of grid points per dimension.
#define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_X 5
#define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
// Probe along the Y axis, advancing X after each column // Probe along the Y axis, advancing X after each column

View File

@@ -35,6 +35,8 @@
#define KNUTWURST_MEGAS_ADV #define KNUTWURST_MEGAS_ADV
#define KNUTWURST_TMC_ADV #define KNUTWURST_TMC_ADV
//#define KNUTWURST_BLTOUCH
//#define KNUTWURST_DEBUG
// @section temperature // @section temperature
@@ -1471,7 +1473,9 @@
* *
* Warning: Does not respect endstops! * Warning: Does not respect endstops!
*/ */
//#define BABYSTEPPING #if ENABLED(KNUTWURST_BLTOUCH)
#define BABYSTEPPING
#endif
#if ENABLED(BABYSTEPPING) #if ENABLED(BABYSTEPPING)
//#define INTEGRATED_BABYSTEPPING // EXPERIMENTAL integration of babystepping into the Stepper ISR //#define INTEGRATED_BABYSTEPPING // EXPERIMENTAL integration of babystepping into the Stepper ISR
//#define BABYSTEP_WITHOUT_HOMING //#define BABYSTEP_WITHOUT_HOMING
@@ -1556,12 +1560,23 @@
* probe points will follow. This prevents any change from causing * probe points will follow. This prevents any change from causing
* the probe to be unable to reach any points. * the probe to be unable to reach any points.
*/ */
#if ENABLED(KNUTWURST_BLTOUCH)
#if PROBE_SELECTED && !IS_KINEMATIC
#define MIN_PROBE_EDGE_LEFT 10
#define MIN_PROBE_EDGE_RIGHT 10
#define MIN_PROBE_EDGE_FRONT 10
#define MIN_PROBE_EDGE_BACK 10
#endif
#endif
#if DISABLED(KNUTWURST_BLTOUCH)
#if PROBE_SELECTED && !IS_KINEMATIC #if PROBE_SELECTED && !IS_KINEMATIC
//#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE
//#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE
//#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE
//#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE
#endif #endif
#endif
#if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL)
// Override the mesh area if the automatic (max) area is too large // Override the mesh area if the automatic (max) area is too large